文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>MySQL恢复root密码

MySQL恢复root密码

时间:2007-09-05  来源:Ksharp

To reset a forgotten mysql root password you have to start MySQL by bypassing all privileges and reset the root password. It is highly suggest you do this in single user mode, since it is still possible for every user to access the mysql.sock, if you haven't changed privileges. What you should do:

/etc/init.d/mysql stop
/usr/bin/mysqld_safe --skip-grant-tables --skip-networking &
mysql -u root
use mysql;
UPDATE user SET Password=PASSWORD("your password here") WHERE User="root";
exit
# kill all the mysql processes
/etc/init.d/mysql stop
# Start MySQL again
/etc/init.d/mysql start

至于停mysql的方法有很多,我是查出进程直接kill:)

ps -ef|grep mysql

kill -9 进程号

还可以

/bin/kill `cat /var/run/mysqld/mysqld.pid`  2>; /dev/null

附一条修复mysql数据库表的命令

/usr/local/bin/mysqlcheck -uroot -p  -r [database name]

排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载