一、修改密码
mysql -u root -p
update mysql.user set authentication_string = password (“新密码”) where User=”test” and Host=”localhost”;flush privileges;
mysql5.7以后mysql.user表中没有了password字段,而是使用authentication_string来代替。
二、删除用户
mysql -u root -p
Delete FROM mysql.user Where User="用户名" and Host=”localhost”;
flush privileges;
创建用户
命令:CREATE USER 'username'@'host' IDENTIFIED BY 'password';
删除账户及权限: