1、找不到文件路径时,使用whereis ***;
2、MySQL5.7更改密码时出现ERROR 1054 (42S22): Unknown column 'password' in 'field list'
使用命令:update user set mysql.authentication_string=123456 where user="root";
3、5.7.21 MySQL修改密码步骤:
1)vim /etc/my.cnf 在[mysqld]后添加skip-grant-tables绕过密码
2)重启:service mysqld restart
3)进入:$ mysql
4)use mysql;
update user set authentication_string=PASSWORD("123456") where User='root';
update user set plugin="mysql_native_password" where User='root';
flush privileges;
quit
5)vim /etc/my.cnf 还原配置
6)重启:service mysqld restart
7)进入:mysql -uroot -p
Enter password:
使用新密码,即可登录
4、修改密码时:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
解决方法:mysql -u root -p#登录
mysql>set global validate_password_policy=0;#密码强度设为最低等级
mysql>set global validate_password_length=4;#密码允许最小长度为4
mysql>flush privileges; #更新授权表,生效
5、授权:
grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
6、重启生效:
systemctl restart mysqld