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