简体   繁体   中英

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'

  • What does this mean?
  • How so I can access a mysql database?
  • The most important thing is that I want to reset password mysql database, but an error occurs when I enter the command: mysql> use mysql;

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

首先授予用户所有权限,

GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' WITH GRANT OPTION;

Open MySQL interface (phpMyadmin) through browser then

  1. click Users
  2. check users with grant options if it is no then follow below steps
  3. click->edit privileges (if user with 'no' grant option)
  4. then select (global privileges) mark check all
  5. continue these steps to all users

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM