MYSQL报错:ERROR 1044 (42000): Access denied for user ‘‘@‘localhost‘ to database ‘mysql‘

  1. close mysqlsystemctl stop mysqld.service

  2. Block permissionsmysqld_safe --skip-grant-tables &

  3. access mysqlmysql -u root

  4. Delete empty usersdelete from user where user=''';

  5. Refresh permissionsFLUSH PRIVILEGES;

  6. Restart applicationsystemctl restart mysqld.service

  7. Note: When performing SQL programming under Linux, you need to add a semicolon at the end ;, otherwise it will think that your operation is not completed and will appear even if you press Enter.->
    Insert image description here

Guess you like

Origin blog.csdn.net/weixin_45495923/article/details/131630358