mysql创建用户和创建数据库赋值用户操作权限

时间:2024-01-21 16:00:11

mysql 进入mysqldb

SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;

查询所有用户

CREATE USER 'oozie'@'%' IDENTIFIED BY 'oozie';

创建一个用户可以访问所有数据库(%表示)密码是oozie

GRANT ALL PRIVILEGES ON *.* TO 'oozie'@'%' IDENTIFIED BY 'oozie' WITH GRANT OPTION;

赋值所有库的权限给用户oozie 密码是oozie

grant all privileges on ooize.* to 'ooize'@'%' identified by 'ooize';

赋值所有库所有权限给ooize 密码ooize