ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
直接按忘记密码的方式进行重置:
1 2 3 4 5 6 7 8
#关闭服务,修改配置文件,跳过授权表,再启动服务 #/app/service/mysql/bin/mysql -uroot UPDATE user SET authentication_string=password('BZ5mulg8PM') , password_expired='N' WHERE user='root'; SELECT authentication_string , password_expired FROM user WHERE user='root'; #再关闭服务,将配置文件中跳过授权表的部分注释掉,重新启动服务 #/app/service/mysql/bin/mysql -uroot -p'BZ5mulg8PM' GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'BZ5mulg8PM' WITH GRANT OPTION; FLUSH PRIVILEGES;
相关命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#拷贝命令(root 权限运行) cp /app/service/mysql/support-files/mysql.server /app/service/mysql_service #编辑脚本(root 权限运行) vi /etc/init.d/mysql
#添加相关命令的软连接(root 权限运行) ln -s /app/service/mysql/bin/mysql* /usr/bin/ #本地登录 mysql -uroot -p'fjphty:BI96t' #修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'kGXSu4fjF' PASSWORD EXPIRE NEVER;
修改日志的时间戳
1 2
SHOW GLOBAL VARIABLES LIKE 'log_timestamps'; SET GLOBAL log_timestamps = SYSTEM;