show databases;
use mysql;#用户数据都在mysql数据库的user表中
grant 权限名称 on 数据库 to 账户@主机 identified by ‘密码’ with grant option;
flush privileges; #刷新权限,修改完后必须要有这一步
例:
grant all privileges on *.* to ‘账户’@’%’ identified by ‘密码’ with grant option;
flush privileges; #刷新权限
*.* :所有数据库
数据库名.* :可以访问该数据库下的所有表
% :任何ip的主机都可以访问
all privileges :获得所有权限
其他权限包括 :create,alter,drop,insert,update,delete,select