9
linux 修改MySQL root密码方法之一
source link: https://www.liurongxing.com/linux-mysql-root-password.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
linux 修改MySQL root密码方法之一
如果 MySQL 正在运行,首先结束mysql进程:
service mysql stop
or
ps
aux |
grep
mysql
killall mysqld
#启动 MySQL (非正常方式起动):
mysqld_safe --skip-grant-tables &
这样就可以不需要密码进入 MySQL :
mysql -u root -p
#要求输入密码时直接回车即可
mysql> use mysql
mysql> UPDATE user SET Password=PASSWORD (
'新密码'
) where USER=
'root'
;
mysql> flush privileges;
mysql> quit;
重新结束进程:
service mysql stop
or
ps
aux |
grep
mysql
killall mysqld
用正常方式启动 MySQL :
service mysql start
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK