mysql.server start
安装完成后记得开启服务
root密码未修改前无法进行其他操作
修改 root 密码
- root 的密码在 mysql8.0 之后得包含大小写字母数字和特殊字符
mysql> use mysql;
mysql> alter user 'root'@'localhost' identified by 'Password1.';
mysql> flush privileges;
创建新用户
mysql> create user 'star'@'%' identified by '123456';
mysql> grant all privileges on *.* to 'star'@'%' with grant option;
mysql> flush privileges;
第三方登陆
- 由于mysql8.0改变了加密方式,导致
caching-sha2-password
登陆错误,新建用户改为mysql_native_password
加密方式就好
mysql> create user 'user'@'%' identified with mysql_native_password by '123456';
mysql> grant all privileges on *.* to 'user'@'%';
mysql> flush privileges;
ps:文章私人所有,转载请注明出处。