mysql8.0使用笔记

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:文章私人所有,转载请注明出处。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值