mysql8创建用户并赋予root权限

1、创建用户:

用户名:xiaoming

密码:123456

mysql> CREATE USER 'xiaoming'@'%' IDENTIFIED BY '123456';

2、赋予权限

mysql> GRANT ALL PRIVILEGES ON *.* TO 'xiaoming'@'%' WITH GRANT OPTION;

3、刷新权限

mysql> flush privileges;

你可能感兴趣的:(mysql,数据库)