Recently in the last interface Test training course, need to use MySQL, downloaded from the official website x64 Compression package version, after the decompression according to Baidu experience in the instructions, step-by-step use, started normal, but encountered an error in the login.
D:\Program files\mysql> mysql-u root-1045 (28000for'root '@'localhost' (using Password:yes)
Workaround:
Edit the MySQL profile My.ini (usually in the MySQL directory, do not know where to search), under the [mysqld] this entry to add
Skip-grant-tables
Restart MySQL after saving exit
1. Click "Start", "Run" (shortcut key Win+r).
2. Start: Enter net stop MySQL
3. Stop: Enter net start MySQL
At this time in the cmd input mysql-u root-p can be used without password login, appear password: When the direct return can enter, will not appear error 1045 (28000), but many operations will be limited, because we can not grant (no permission).
1. Go to MySQL database:
mysql> use MySQL;
2. Set a new password for the root user, and enter the blue part yourself:
mysql> Update user Set Password=password (" new password ") where user="root "1 rows affected (0.01110
3. Refreshing the database
mysql>0 rows affected (0.00 sec)
4. Exit MySQL:
mysql> Quitbye
After the change, and then modify the My.ini this file, we just joined the "Skip-grant-tables" this line to delete, save the exit and then restart MySQL.
MySQL ERROR 1045 (28000): Access denied for user workaround