举例:创建abc用户,密码是123456
MySQL -u root -p CREATE USER 'abc'@'localhost' IDENTIFIED BY '123456'; #本地登录 CREATE USER 'abc'@'%' IDENTIFIED BY '123456'; #远程登录 quit mysql -u test -p #测试是否创建成功
删除用户
mysql -u root -p Delete FROM mysql.user Where User=”test” and Host=”localhost”; flush privileges; drop database testDB;
删除账户及权限:
drop user 用户名@’%’; drop user 用户名@ localhost;