1、创建用户:
create user 'usertest'@'%' identified by 'test_user';
2、进入mysql : use mysql;
创建数据库:create database test_data DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
grant all privileges on `test_data`.* to 'test_user'@'%' identified by 'test123';
flush privileges;
详情可参考:https://www.2cto.com/database/201412/357165.html
http://www.cnblogs.com/eczhou/archive/2012/07/12/2588187.html