Skip to main content

Mysql清除多余权限账号

一、清除多余账号权限

 delete from mysql.user where (user,host) not in (select 'root','localhost');

二、创建本地数据库连接(代码调用)

 update user set user="admin" where user="root";
 update mysql.user set user='admin',password=password('redhat12345');
 flush privileges;

三、创建远程数据库连接(远程调试)

 grant all privileges on testDB.* to test@localhost identified by '1234';
 flush privileges;

发表评论