After MySql is newly installed, the root account prompts mysql ERROR 1045 (28000): Access denied for use. The solution is 28000 denied.
After MySQL is newly installed, it is executed for the first time.mysql -uroot -p
The root password is not empty. to reset the root password, follow these steps.
Edit mysql configuration file my. ini (if my_default.ini is used, rename it my. ini) and add
skip-grant-tables
After saving and exiting, restart mysql and click "start"-> "run" (shortcut: Win + R ).
1. stop: Enter net stop mysql
2. start: Enter net start mysql
In this case, enter mysql-u root-p in cmd to log on without a password. When password: is displayed, press enter to enter without ERROR 1045 (28000 ), however, many operations are restricted because we cannot grant (no permission ). Follow the steps below:
1. Enter the mysql database:
mysql> use mysql;Database changed
2. Set a new password for the root user. In the blue section, enter the new password:
Mysql> update user setauthentication_string = password ("new password") where user = "root"; Query OK, 1 rows affected (0.01 sec) Rows matched: 1 Changed: 1 Warnings: 0
3. Refresh the database
mysql> flush privileges;Query OK, 0 rows affected (0.00 sec)
4. Exit mysql:
mysql> quitBye
After modification, modify the my. ini file, delete the "skip-grant-tables" line we just added, save and quit, and restart mysql.
You will be prompted after you log on again
ERROR 1820 (HY000): You must reset your password using ALTER USER statement befo re executing this statement.
Just enterSet password = password ('new password ');
You can.
The above is a small Editor to introduce you to the new installation of MySql, login to the root account prompt mysql ERROR 1045 (28000): Access denied for use solution, I hope to help you, if you have any questions, please leave a message and the editor will reply to you in time. Thank you very much for your support for the help House website!