mysql常用命令

创建用户并授权

创建一个数据库nacos(规定字符集utf-8)
create database if not exists nacos default charset utf8 collate utf8_general_ci;

创建一个nacos的用户
create user 'nacos'@'%' identified by 'xxxxxxxx';

把nacos数据库的所有权限授权给nacos用户
grant all privileges on 'nacos'.* to 'nacos'@'%';

刷新权限
flush privileges; 

查看用户权限
show grants for nacos;

 

posted @ 2021-10-19 10:53  伸手触摸阳光  阅读(26)  评论(0编辑  收藏  举报