解决1044 - Access denied for user ''@'localhost' to database 'XX'

The first time I used MySQL and Navicat together, I encountered a problem and spent a lot of time on my own, and finally solved it. I hereby record the solution process.

MySQL version: 5.5.8 MySQL Community Server

Navicat Premium version: 11.2.7-unregistered version

1. Create a MySQL connection in Navicat, right-click the connection, and select "New Database"

2. After entering the database name, character set and sorting rules, click "OK", and the following error will be prompted:

Have tried the following two methods:

1. Uninstall and reinstall MySQL several times. It is suspected that the problem occurred in the modify secure setting of the penultimate step, but it is still not resolved;

2. Run the mysql command in the cmd window: Grant All on XX to XX (to the official to find the authorization command for the specified user), but still unresolved

Finally, it was solved in the following way:

Open the file my.ini (Windows system) in the MySQL installation root directory, find the line [mysqld], and add skip-grant-tables below the line 

 

After saving, right-click Computer-Management-Services and Applications-Services, find MySQL, click "Restart this service" on the left, and then enter Navicat to create a new database to solve it.

Guess you like

Origin blog.csdn.net/Xia_Leon/article/details/82907448