1.mysql -u root -p
输入密码
2.GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON 数据库名.* TO 用户名@‘主机名’ identified by ‘数据库密码’;
GRANT all ON 数据库名.* TO 用户名@‘主机名’ identified by ‘数据库密码’;
3.flush privileges;
4.show grants for ‘用户名’@‘主机名’;
用户名:root
主机名:localhost