mysql 5.7
1.grant all privileges on *.* to 'username'@'%' identified by 'username123';
select * from mysql.user;
localhost root
localhost mysql.sys
% username
mysql8
1.create user 'username'@'%' identified by 'username123';
2.grant all privileges on *.* to 'username'@'%';
select * from mysql.user;
localhost root
localhost mysql.sys
localhost mysql.infoschema
% username
remark:
for 5.7 version: can create user by grant privileges one sql at once;
for 5.8 version: must create user first and then grant privileges;
上一篇:MySQL清屏命令
下一篇:MySQL创建用户与授权