1. 创建数据库:
create database test;
2.创建用户:
-----------任何终端都可以连接
grant select,insert,update,delete on test.* to user@"%" Identified by "123456";
------------只让某个地址段连接
grant select,insert,update,delete on test.* to user@"172.44.16.*" Identified by "123456";
------------只让本地连接
grant select,insert,update,delete on test.* to user@"localhost" Identified by "123456";
-----------赋给用户全部的权限在某个数据库
grant all on test.* to user@"localhost" Identified by "123456";
-----------赋给用户全部的数据库权限
grant all on *.* to user@"localhost" Identified by "123456";
数据库创建完毕!