MySQL如何查看,删除用户

时间:2024-05-19 12:03:37

1.查看所有用户(需要在root用户下进行)

select host,user,password from mysql.user;MySQL如何查看,删除用户

2.删除用户

    mysql>Delete FROM user Where User='用户名' and Host='上图有个host列表所示';//删除用户

    例:mysql>Delete FROM user Where User='yl' and Host='localhost';

   mysql>flush privileges; //刷新权限

   mysql>drop database ylDB; //删除用户的数据库