1.停止mysql服务:service mysqld stop; 2. mysqld_safe --skip-grant-tables 3. 重新打一个开个SSH连接(即重新打一个新的黑色窗口); 4.输入以下命令: [ root@localhost ~]# mysql mysqluse mysql mysqlupdate user set password=password(123456) where
1.停止mysql服务:service mysqld stop;
2. mysqld_safe --skip-grant-tables
3. 重新打一个开个SSH连接(即重新打一个新的黑色窗口);
4.输入以下命令:
[ root@localhost ~]# mysql
mysql>use mysql
mysql>update user set password=password("123456") where user="root";
mysql>flush privileges;
mysql>exit
pkill -KILL -t pts/0 可将pts为0的**用户(之前运行mysqld_safe的用户窗口)强制踢出
正常启动 MySQL:service mysql start.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn