MySQL can log in without a password

use mysql;

update user set authentication_string=password("your password") where user='root'; #(version without password field, that is, version <=5.7)
update user set password=password('your password') where user='root'; #(version with password field, version>5.7)

update user set plugin="mysql_native_password"; 

flush privileges;

exit;

Restart the service: service mysqld restart

 

 

 

Reference: https://www.cnblogs.com/youpeng/p/11905051.html

Guess you like

Origin blog.csdn.net/zwx_lucky/article/details/107408617