CentOS 7安装MySql5.7问题
2018-07-31 本文已影响48人
冷煖自知
- 报错
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;