CentOS 7安装MySql5.7问题

字数 97阅读 81
  • 报错Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.需要在/etc/my.cnf中添加
[mysqld]
user=mysql # 使用mysql用户
  • 报错Access denied for user 'root'@'localhost' (using password:YES),需要修改密码
    首先配置/etc/my.cnf中添加
[mysqld]
skip-grant-tables=1# 略过密码验证

然后systemctl restart mysqld重启后进入mysql

use mysql;
update user set password=password("*******") where user="*******";  #修改密码报错
  • 在mysql命令行报错ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
SET PASSWORD = PASSWORD('123456');
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
flush privileges;

推荐阅读更多精彩内容