ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password:yes)
so
1. Stop mysql service
systemctl stop mysqld.service
2, modify the profile to log in without password
[HTML] view plain copy
-
- vi/etc/my CNF </ ol>
Add it at the end
[HTML] view plain copy
-
-
- skip – grant – tables </ ol>
-
-
-
- save
-
3. Start mysql
[HTML] view plain copy
-
-
-
- systemctl start mysqld. Service </ ol>
-
-
-
-
-
- 4, log in musql
-
-
[HTML] view plain copy
-
-
-
-
- mysql -u root </ ol>
-
-
-
-
-
-
-
- Be careful not to add minus p here
-
-
-
5, modify the password, mySQL5.7 use this syntax
[HTML] view plain copy
The
-
-
-
-
-
- use mysql; </ ol>
-
-
-
-
[HTML] view plain copy
-
-
-
-
-
-
- update mysql.user set authentication_string=password(‘123456′) where user=’root’; </ ol>
-
-
-
-
-
-
-
-
-
-
-
- 6, go back to the second step remove the plus
-
-
-
-
-
[HTML] view plain copy
-
-
-
-
-
-
-
- skip – grant – tables </ ol>
-
-
-
-
-
-
-
-
-
-
-
-
-
- Save and restart mysql
-
-
-
-
-
-
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
In fact, after installing mysql by default or in the log to generate a default password /var/log/mysqld.log
Login to mysql to reset the default password
[HTML] view plain copy
-
-
-
-
-
-
-
-
- set password = password (‘ you password “); </ ol>
-
-
-
-
-
-
-
If the password level does not match the default level requirement, it will be reported
[HTML] view plain copy
-
-
-
-
-
-
-
-
-
- Your password does not satisfy the current policy requirements
-
-
-
-
-
-
-
-
You need to change the level and the minimum default password number
[HTML] view plain copy
The
-
-
-
-
-
-
-
-
-
- set global validate_password_policy = 0; The set global validate_password_length = 4; </ ol>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- And then just set the password
-
-
-
-
-
-
-
-
# # # # # # # # # # # # # # # # # # #
Error 1130 on remote connection
[HTML] view plain copy
-
-
-
-
-
-
-
-
-
- mysql; The use of mysql; Mysql; Select ‘host’ from user where user=’root’; Mysql; Update user set host =’ %’ where user =’root’; Mysql; Flush privileges; Mysql; Select ‘host’ from user where user=’root’; </ ol>
-
-
-
-
-
-
-
-