[SOLVED]: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’

Dear All,

Today I have restored all Databases of mysql 5.1 to mysql 5.5 and connected with user root  and  faced a strange issue for below commands

mysql> CREATE USER ‘abcd’@’%’ IDENTIFIED BY ‘password’;

mysql> grant all privileges on *.* to ‘root’@’localhost’ identified by ‘password’ with grant option;

ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

 

As the problem was strange answer was also strange. I tried lots of options and solution was very simple and I enjoyed it.

Steps taken to resolve the issue

  • Connected the source server of which all databases backup was restored say server A
  • Connected to destination server on which all databases are restored say server B
  • On Server A right click on MYSQL database and select copy database
  • In target window select server B and database as mysql in databases list
  • Click on copy button
  • That’s all

After that stop and start MYSQL service of destination server ( server B) , error will not come J

Thanks

Prashant Deshpande

Advertisements

Leave a comment

Filed under Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s