- 先创建数据库
- 创建用户并赋予一个数据库的所有权限
use mysql;
create database databaseName character set utf8;
grant all privileges on databaseName.* to username@\'ip\' identified by \'password\';
举例:
use mysql;
create database test_db character set utf8;
grant all privileges on test_db.* to testuser@\'localhost\' identified by \'123456\';