mysql添加用户并赋予权限命令
添加用户:
create user 'gouge'@'localhost' identified by 'gouge';
赋予权限:
给gouge 用户赋予所有test开头的数据库权限 (test% 代表已test开头的数据库,如果指定单个数据库去掉%即可)
1 grant select,insert,update,delete,create,drop,alter on `test%`.* to 'gouge'@'%' identified by 'gouge'; 2 FLUSH PRIVILEGES;
// 给所有表加权限
grant all privileges on *.* to 'gouge'@'%' identified by 'gouge';
添加最高权限
grant ALL PRIVILEGES on `test%`.* to 'gouge'@'%' identified by 'gouge'; FLUSH PRIVILEGES;