linux MySQL8.0 创建用户

我之前看的学习视频,但是里面教的办法对于我新安装的MySQL8.0.15不能使用,所以我找了很久的办法

 

这个办法对我没有用处:

insert into mysql.user(host,user,password) values ("localhost","yuyu",password("yuyupassword");
会报下面这个错误:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser
ver version for the right syntax to use near '("yuyupassword")' at line 1

 

添加用户

CREATE USER 'yuyu'@'localhost' IDENTIFIED BY 'password';

之后使用select user,host from mysql.user;查看

(此处不能查看password)

linux MySQL8.0 创建用户_第1张图片

 

 

你可能感兴趣的:(linux,mysql)