nayen — 2011-04-18T06:38:40-04:00 — #1
I am a beginner to MySQL and trying to follow Kevin's book. I installed Apache, PHP and MySQL without any problem. I changed the root password using this line:
mysqladmin -u root -p password "newpassword"
Now, when I open MySQL Command Line Client, I can login with my password and it gives error when I type something different other than the password. However, I can also login without typing any password. Is this normal? Is this what it is supposed to be?
gravitationalfx — 2011-04-18T07:36:31-04:00 — #2
Try restarting your MySQL server to ensure it picks up on the new changes.
When you say that you can login without a password, what commands are you using?
Can you select a database and perform a simple SQL command e.g. select * from <table_name> ?
system — 2011-04-18T07:54:24-04:00 — #3
To restart MySQL:
If that doesn't solve it, try (in MySQL):
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypass');
Then restart MySQL again.
If that doesn't work, then try:
SET PASSWORD FOR 'root'@'%' = PASSWORD('mypass');
And restart again lol.
nayen — 2011-04-18T09:04:27-04:00 — #4
Thank you both, restarting the system worked. Now it doesn't login without entering my password.