2016年11月

GRANT ALL PRIVILEGES ON *.* TO 'username'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
#如果要授权指定数据库
use dbname
GRANT ALL PRIVILEGES ON dbname.* TO 'username'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;
FLUSH PRIVILEGES;
#创建新帐号 指定权限
mysql> CREATE USER 'sms_www'@'127.0.0.1' IDENTIFIED BY 'pwd';
Query OK, 0 rows affected (0.06 sec)  
mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON `sms`.* TO 'sms_www'@'127.0.0.1';
Query OK, 0 rows affected (0.01 sec)