On CentOS 5.x I used webmin panel and I was in mysql settings, I was trying to allow "root" to login from my home ip in addition to localhost.
In the hosts list I had "any" or "localhost", I tried to make it "localhost,84.xx.xx.xx" thinking it will allow me to login from my local computer with mysql administrator program.
After I saved the entered data I cannot do much on mysql
Webmin says DBI connect failed : Access denied for user ''@'localhost' to database 'mysql'
In SSH mysql says ERROR 1044 (42000): Access denied for user ''@'localhost' to database 'mysql'
My guess is that mysql doesn't allow root to connect from any host anymore because I entered incorrect hosts.
I tried uninstalling and reinstalling mysql but no change.
Is there a way to reset this? I have no database data, I can delete all if needed.
Thanks.
Best Answer
Log in at a terminal as root and stop the mysql daemon.
Then start up the mysql daemon and skip the grant tables which stores the passwords and other priviledge information
You should see mysqld start up successfully. Now you should be able to connect to mysql without a password.
and then update the relevant information:
and then restart the mysql daemon as you would normally do
Also take a look at the MySQL documentation to help you out if you get stuck