MySql教程

mysql常用命令

本文主要是介绍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;

 

这篇关于mysql常用命令的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!