登陆MYSQL数据库发现如下报错:
[root@edabo1 ~]# mysql -u root -p
Enter password:
ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.
请问该怎样解决?
关闭mysql:
service mysqld stop
停止 mysqld: [确定]
以非认证方式启动MYSQL:
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
执行下面命令修改密码:
alter user 'root'@'localhost' identified by 'maywide';
执行这句时候错误:
mysql> alter user 'root'@'localhost' identified by 'maywide';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
这个时候我们只需要
flush privileges
一把,在执行就OK了,
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> alter user 'root'@'localhost' identified by 'maywide';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
最后重启mysql 服务即可
service mysqld restart