0

Not able to create,drop database from phpmyadmin or mysql command line. It showing error:

  "ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'test123'"

After googling i found that to grant the permission to user using the command:

  GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
  FLUSH PRIVILEGES;

But it also giving the error as mentioned above.

I have also uninstall and install the mysql and phpmyadmin again in the system but still getting same error's.

Please advice.

mysql>show grants;

 +--------------+
 | Grants for root@localhost                                                         |
 +------------------------------------+
 | GRANT USAGE ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD    <secret>      |
 | GRANT ALL PRIVILEGES ON `oe_school`.* TO 'root'@'localhost' WITH GRANT OPTION |

+-----------------------------------------------+

Akhil Thayyil
  • 9,263
  • 6
  • 34
  • 48
Mohd Bashir
  • 949
  • 1
  • 8
  • 17
  • http://stackoverflow.com/questions/8838777/error-1044-42000-access-denied-for-user-localhost-to-database-db try this link. I'm not sure may be help you. – Syed mohamed aladeen Aug 21 '15 at 05:58
  • Probably the password is wrong or the order of arguments in the way you try to connect is wrong. – codez Aug 21 '15 at 06:04
  • when i run the show grants command it show the above result. – Mohd Bashir Aug 21 '15 at 06:06
  • root has no privilege to create something ("GRANT USAGE ..."), it only has privelege `ALL` on the database `oe_school` – Axel Amthor Aug 21 '15 at 06:16
  • @mohd try this command line, it will run the configuration process and let you set the passwords again. `sudo dpkg-reconfigure mysql-server-x.x` – mdamia Aug 22 '15 at 02:27

1 Answers1

0

Finally i solved issue it to uninstall MYSQL and also delete the Mysql folder.

 sudo apt-get remove --purge mysql-server mysql-client mysql-common
 sudo apt-get autoremove
 sudo apt-get autoclean
 sudo rm -rf /var/lib/mysql
Mohd Bashir
  • 949
  • 1
  • 8
  • 17