强制修改mysql 中root的密码

/etc/init.d/mysqld stop   (service mysqld stop )
/usr/bin/mysqld_safe --skip-grant-tables
另外开个SSH连接
[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:/etc/init.d/mysqld start   (service mysqld start)

posted @ 2015-06-22 14:46  Tim&Blog  阅读(775)  评论(0编辑  收藏  举报