1,停止mysql服务
systemctl stop mysqld.service
2,修改配置文件无密码登录
vi /etc/my.cnf
在最尾部加上
skip-grant-tables
保存
3,启动mysql
systemctl start mysqld.service
4,登录musql
mysql -u root
1,停止mysql服务
systemctl stop mysqld.service
2,修改配置文件无密码登录
vi /etc/my.cnf
在最尾部加上
skip-grant-tables
保存
3,启动mysql
systemctl start mysqld.service
4,登录musql
mysql -u root