【mysql】 忘记mysql数据库root密码

1590阅读 0评论2013-04-26 ykyx00
分类:Mysql/postgreSQL

mysql 数据库root密码忘记以后,其实没有想象的那么麻烦,下边看看怎么解决这个问题。

# mysqld --skip-grant-tables

打开另一个窗口

mysql> use mysql;

mysql> update user set password = password("000000") where user = 'root' ;

mysql> flush privileges;


ps:

如果有以下提示,
[ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
需要在/etc/my.cnf [mysqld]下加入一行

user-mysql

 操作完成后可以删除掉

参考:


上一篇:Jenkins使用_5
下一篇:【flash】linux下安装flash插件