-- 创建数据库,指定默认字符编码和排序方式
create database db1 default character set utf8mb4 collate utf8mb4_general_ci;
-- 创建用户
CREATE USER 'test'@'127.0.0.1' IDENTIFIED BY '123456';
-- 授权某个数据库给用户
GRANT ALL ON db1.* TO 'test'@'127.0.0.1';
-- 刷新权限
flush privileges;
© 版权声明
THE END