更改

跳转至: 导航搜索

如何在Linux(CentOS)下重置MySQL根(Root)密码

添加436字节, 2017年11月9日 (四) 10:45
无编辑摘要
[[File:MySQLRoot3.png]]
4.输入“mysqld_safe --skip-grant-tables &”命令以无密码方式进入MySQL安全模式。
备注:在CentOS7及MySQL5.7则需使用以下命令。
1. systemctl stop mysqld
2. mysql -uroot -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
3. systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
4. systemctl start mysqld
5. mysql -uroot
[[File:MySQLRoot4.png]]
5.输入“mysql -u root”并按回车键即可。
匿名用户

导航菜单