mysqldatabaseaccess-deniedmysql-select-dbmysql-error-1044

mysql> use mysql; but ... ERROR 1044 (42000): Access denied for user '' @ 'localhost' to database 'mysql'


Using mysql.exe, I enter the command mysql> use mysql; but there is an error:

ERROR 1044 (42000): Access denied for user '' @ 'localhost' to database 'mysql'


Solution

  • thanks all, finally I found this reset root password with wrong mysql config… and it works well for me :)

    -Go to your xampp\mysql\bin\ folder
    -Edit my.ini and insert skip-grant-tables below [mysqld]
    -Restart MySQL
    -Set new password for your root user by running UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root' in phpMyAdmin in the mysql database (or just leave it like this if MySQL cannot be accessed from remote hosts)

    AndreKR