mysql 创建用户-并且授权只读

select host,user,authentication_string from mysql.user; -- 查询用户
-- drop user 'topingr_reader'@'%';	-- 删除用户
grant all privileges on test_database.* to 'topingr_reader'@'%' identified by 'tpreader@123' with grant option;  -- 创建用户
GRANT SELECT ON topingr.* TO 'topingr_reader'@'%' IDENTIFIED BY "tpreader@123";	-- 授权
posted @ 2022-03-01 10:52  小马快跑3  阅读(169)  评论(0编辑  收藏  举报