mysql8.0 安装问题汇总
673
0
0
1年前
## this authentication plugin is not supported
MySQL8的默认密码认证方式使用caching_sha2_password,所以访问会提示this user requires mysql native password authentication。
解决方案:etc/my.cnf 添加如下修改
```
[mysqld]
default-authentication-plugin=mysql_native_password
```
## 不能已root 启动
创建mysql账号和组 并授权
```
groupadd mysql
useradd -g mysql mysql
chown -R mysql:mysq /usr/local/mysql
chmod 755 /usr/local/mysql
```
免密登陆
```
mysqld_safe --skip-grant-tables
update user set authentication_string='' where user='root';
```
更改密码
```
use mysql; //选择数据库
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; //更改加密方式
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码'; //更新用户密码
FLUSH PRIVILEGES; //刷新权限
```