创建一个新的用户username密码为password
CREATE USER username IDENTIFIED BY ‘password‘;
查看所有的用户
select host,user from mysql.user;
给新建立的用户查询和插入的权限
GRANT SELECT, INSERT ON ybc.users TO ‘username‘@‘%‘;
flush privileges;
查看所有用户的权限
show grants for ‘niuxiongcai‘@‘%‘;
时间: 2024-10-06 10:50:29