mysql 建库与授权

mysql建库与授权

-- 创建数据库
create database test;
-- 创建用户
create user 'etl'@'127.0.0.1' identified by '123456';
-- 数据库授权
grant all on test.* to 'etl'@'127.0.0.1';

-- 查看已创建的数据库
select * from information_schema.schemata;
-- 查看用户
select host,user from mysql.user;
-- 查看用户的数据库授权
select host,db,user from mysql.db;

-- 删除数据库
drop database test;
-- 删除用户
drop user etl;
发布了230 篇原创文章 · 获赞 29 · 访问量 23万+

猜你喜欢

转载自blog.csdn.net/huryer/article/details/103757436