#建新用户user,新用户密码为PASSword123.
create user "user"@"%" identified by 'PASSword123.';
#赋予用户对数据库wordpress的全部权限
grant all privileges on wordpress.* to 'user'@"%" identified by 'PASSword123.';
#使配置生效。
flush privileges;
#退出MySQL。
exit;
2)MySQL8.0创建用户并授权的命令
mysql>create user dongxt@'%' identified by 'password';
mysql>grant all privileges on *.* to dongxt@'%' with grant option;
mysql>flush privileges;
mysql>alter user dongxt@'%' identified with mysql_native_password by 'password';