1、登录root用户mysql -u root -p 输入密码 2、创建数据库 create database 数据库名; 3、创建用户 create user '数据库名'@'localhost' identified by '密码'; 4、授权用户 grant all privileges on 数据库名.* to '数据库名'@'localhost'; 5、刷新权限 flush privileges; 5.1、查询用户信息 select host,user,authentication_string,plugin from mysql.user; 6、删除user用户 DROP USER 'username'@'host';格式命令,