mysql8.0创建新用户

查看当前用户

use mysql;
select current_user();
或者:
select User, authentication_string , Host from user;

查看权限

show grants for 'user'@'ip';
或者
show grants;
创建一个给新用户的数据库
create database testDatabase;

创建新用户同时配置给该用户testDatabase的所有权限

create user testUser@'%' identified by 'Password@12345678';
grant all privileges on testDatabase.* to testUser@'%' with grant option;
flush privileges;
posted on 2022-07-11 10:31  小朱配齐  阅读(418)  评论(0编辑  收藏  举报