mysql新增用户并授权

安装mysql

apt-get install mysql

使用安全设置,禁用root,匿名等,然后用root登录mysql

mysql_secure_installation
mysql -u root -p

输入root密码

切换数据库

mysql>use mysql;

查看当前用户

mysql>SELECT Host,User,Select_priv,Grant_priv from user;

新建用户

mysql>CREATE USER 'aaa'@'%' IDENTIFIED BY '123';

授于全部权限

mysql>grant all on *.* to abc@% with grant option;

 

myql -u root//进入入mysql
create database nextcloud;
create user ‘123’@’%’ identified by ‘456’;
grant all privileges on nextcloud.* to ‘123’@’%’;

木易的技术记录 » mysql新增用户并授权

顶 (0)

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

置顶文章