当前位置: 移动技术网 > IT编程>数据库>Mysql > MySQL给新建用户并赋予权限最简单的方法

MySQL给新建用户并赋予权限最简单的方法

2020年03月09日  | 移动技术网IT编程  | 我要评论

创建一个用户:

create user 'oukele'@'%' identified by 'oukele'; 

 

提示下面所列出的信息的话,得刷新一下权限表

the mysql server is running with the --skip-grant-tables option so it cannot execute this st...

步骤如下:

扩展学习

mysql 新建用户并赋予远程访问权限

[root@demo /]# mysql -u root -p #登录服务器数据库

enter password:123xxx

#1.创建一个新用户 testuser 密码为 testuserpass

create user 'testuser'@'localhost' identified by 'testuserpass';

#2.创建数据库testdb

create database testdb;

#3.执行命令为testuser用户添加使用testdb权限

grant all privileges on testdb.* to testuser@localhost identified by 'testuserpass';

#4.执行命令,为testuser用户添加远程访问权限

grant all privileges on testdb.* to 'testuser'@'%' identified by 'testuserpass' with grant option;

#5.刷新权限表

flush privileges;

以上就是本次知识点的全部内容,更多相关知识点可以在下方相关文章里查找。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网