创建数据库账号
create user "atest"@"localhost" identified by "password";
数据库授权
grant all on atest.* to "atest"@"localhost";
insert into mysql.user(Host,User,Password) values("localhost","atest",password("password"));
GRANT USAGE ON *.* TO 'atest'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON atest.* TO 'atest'@'127.0.0.1' IDENTIFIED BY 'password';
创建只有查询功能的账户
GRANT SELECT ON atest.* TO 'atest'@'127.0.0.1' IDENTIFIED BY 'password';
grant all privileges on atest.* to 'atest'@'localhost' identified by 'password'
grant all on atest.* to "atest"@"localhost" identified by "password"
创建数据库
create database atest charset=utf8;
创建数据库账号
create user "atest"@"localhost" identified by "password";
数据库授权
grant all on atest.* to "atest"@"localhost";
也可以合并成
grant all on atest.* to "atest"@"localhost" identified by "password";
执行sql source文件
source d:/test.sql