|
|
#1 |
|
Prospect
Join Date: Apr 2003
Posts: 14
|
mySQL - "Access denied for user" message
Ok, I thought I could do it (and have learnt alot in the mean time) but now I'm stumped.
I installed mysql & got it running (I can see it as a process when I type 'top') but.. when i type in: /usr/local/mysql/bin/mysqladmin -u root password 'new-password' I get the following message: /usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user: 'root@localhost' (Using password: NO)' what have I done or am I missing? Tom K |
|
|
|
|
|
#2 | |||||||||||||||||||
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
Re: mySQL - "Access denied for user" message
I think you want: Code:
/usr/local/mysql/bin/mysqladmin -u root -p xxx But it is better to leave off the "-p xxx" and it will prompt you for your password. |
|||||||||||||||||||
|
|
|
|
|
#3 |
|
Prospect
Join Date: Apr 2003
Posts: 14
|
I still get refused
![]() /usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user: 'root@localhost' (Using password: YES)' & its definatly the correct root password I'm using as its works everywhere else. Tom |
|
|
|
|
|
#4 |
|
MVP
Join Date: Dec 2002
Location: NYC
Posts: 1,005
|
the -p and the password can have no spaces between them.
i.e. -ppassword give that a try |
|
|
|
|
|
#5 |
|
Major Leaguer
Join Date: Feb 2003
Location: Berkeley, CA
Posts: 270
|
Are you trying to log into mysql, or are you trying to change your password?
To change your password (if you already have a password) is mysqladmin -u <user> -p password <newpassword> "password" is the word "password", not your current password. If you don't have a password (i.e., you've just set mysql up), leave the -p off. If you're trying to log into mysql, do this mysql -u <user> -p <databasename> Again, if you've just set mysql up, leave off the -p. Hope that helps!
|
|
|
|
|
|
#6 |
|
Prospect
Join Date: Apr 2003
Posts: 14
|
Cheers grrl_geek & everybody,
I couldn't log in & was trying to reset the passord as I think I accidently set a password for mySQL while playing around - I'm completely new to Unix & am only just starting to get my head round it ![]() so... I thought I might as well start again & used the following comand to unistall mySQL: sudo rm -r mysql* in cd /usr/local Then started the whole process again, following instructions given in the package installer 'read me' file & it all seems to have gone ok except... after managing to startup mySQL (& feeling very pleaased with myself!) I shut down the computer & now after starting back up again & restarting mySQL I get this feedback: Starting mysqld daemon with databases from /usr/local/mysql/data 030426 12:21:24 mysqld ended Now why on earth has it ended???? Tom (its all turing into an epeic event) K |
|
|
|
|
|
#7 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
error log
According to this:
http://www.mysql.com/doc/en/Error_log.html the error log is in a file ending with the suffix ".err" under your data directory. Have a look for such a file and tell us what it contains. One possibility: Is it possible that you have set it up so that mysql automatically restarts when your computer starts up? If so, then it was already running when you tried to run it manually. That would explain why it would appear to stop right away. You can check if mysqld is running by doing: ps -auxww | grep mysqld in a Terminal window. |
|
|
|
|
|
#8 |
|
Prospect
Join Date: Apr 2003
Posts: 14
|
BRILLIANT!
you've sussed it hayne, thinking back, I did do something regarding an auto startup - foolish me - but I spose we all have to start somewhere... I have now managed to log in & have got a connection ID etc.! Thank you all very much for your help - i'm always impressed when I find a really good forum & this seems to be one. Tom K P.S. One last question! I tried to look at the .err file but it won't let me into the data directory - what do I need to do? I tried: sudo cd data but: sudo: cd: command not found is returned. |
|
|
|
|
|
#9 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
sudo
There are only certain commands which 'sudo' allows you to do. 'cd' is not one of them as you found.
If your data directory has permissions that prohibit you (as yourself) from doing 'cd' to it, you could just use 'sudo ls' to see what is in the data directory instead. And then use 'sudo more path/to/the/err/file' to see what is in the err file. Or, if you really wanted to use the 'cd' route, you could use 'sudo -s' to get a new shell in which you would be root. Use 'exit' to get back to your normal self. Do 'man sudo' to read more. |
|
|
|
![]() |
|
|