1

Whenever I try to install mysql 5.0.77 on CentOS 5.5, the installation goes fine. So the whenever I try:

mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

(Password is blank)

On investigating further I found that user table of mysql db is empty. Does anyone knows the solution to this problem.

Thanks.

2 Answers 2

1

did you have an existing install and you upgraded? or is it a fresh install?

If you just installed it, you might try reinstalling the package after purging it.

If it was an upgrade, you can stop it, and run the daemon with:

/usr/sbin/mysqld --skip-grant-tables

then go into the client, create your username. Restart MySQL afterwards as running with skip-grant-tables runs your server with no authentication and any connection has root/grant privileges.

(not 100% sure on the path for mysqld as I run Debian, but, the method is the same)

2
  • Thanks. Its a fresh install. How can I purge the previous install?
    – Gautam
    Oct 15, 2010 at 4:35
  • yum remove packagename;yum install packagename If that doesn't work, try running mysqld with --skip-grant-tables.
    – karmawhore
    Oct 15, 2010 at 4:49
1

Thanks karmawhore! The reinstall did not work. But I solved the problem by manually inserting root in mysql - user table using mysqld --skip-grant-tables.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .