标签:mys table done tip 方式 hat href exit and
一段时间没用,又忘记了我的mysql密码了,怎样去重置密码呢?ok,五步,开始!
/etc/init.d/mysql stop
输出 Stopping MySQL database server: mysqld.
mysqld_safe --skip-grant-tables &
输出
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe
mysql -u root
输出显示
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-Debian_1-log
Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the buffer.
mysql>
mysql> use mysql;
mysql> update user set password=PASSWORD("你的密码") where User=‘root‘;
mysql> flush privileges;
mysql> quit
/etc/init.d/mysql stop
Stopping MySQL database server: mysqld
STOPPING server from pid file /var/run/mysqld/mysqld.pid
mysqld_safe[6186]: ended
[1]+ Done mysqld_safe --skip-grant-tables</pre>
/etc/init.d/mysql start
mysql -u root -p
输入这条命令按enter键后再输入密码,就能进去数据库啦!
reference:
https://www.cyberciti.biz/tips/recover-mysql-root-password.html
标签:mys table done tip 方式 hat href exit and
原文地址:http://blog.51cto.com/11834557/2309880