An Essay on Error 1045 when logging in for MySQL version 5.7

Source: Internet
Author: User

Before learning to use is Oracle but now in the work of most of the use of MySQL, so I installed a MySQL, download, installation tutorials are from the online Baidu, took a long time to install, the heart is very tired, the tutorial is very much, is not know which to use.

installed, want to create a user, but also Baidu, the last time to log on or found that there are errors. Finally, write a note to prevent forgetting.

Words do not say much,:

Finally created a new user, want to login, error 1045. Mood moment is not good, Baidu a wave, or did not solve, said is very vague. I summed it up a bit.

This error is due to the lack of access rights in the visual tools

To solve this problem. I summed up a wave:

1. Login to the root account, root account password do not remember what the self to Baidu, a lot of tutorials, this is not much to say.

2. In the input mysql>use MySQL;

3. Change the host entry in the user table in the MySQL database: rename localhost to%

Mysql>update user set host= '% ' where user= ' work ';

4. Refresh the MySQL system permissions related table

Mysql>flush privileges;

5. Check the host of the work account (this step is not very useful)

Mysql>select ' host ', ' work ' from the user where user= ' work ';

6. Grant permissions to new users (and change passwords)

Mysql>grant all privileges on * * to ' work ' @ '% ' identified by ' 123456 ' with GRANT OPTION;

7. Modify the Work User password: (5.7 There is no password field, so changing the password also need to change the method)

Mysql>alter USER ' work ' @ '% ' identified by ' PWD ';

8. To log in to the work account by exiting the root account:

mysql>exit;

9. Login to Work account:

C:\users\admin>mysql-u work-p

Success, Perfection! Error 1045 no longer appears.

An Essay on Error 1045 when logging in for MySQL version 5.7

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.