mysql5.7版本开始创建用户需要create user
mysql5.7版本开始创建用户需要create user
5.7版本之后,直接使用:grant select on MySQL.test01 to hug@localhost; 是不行的,会报错:
Error Code: 1133. Can't find any matching row in the user table
5.7版本创建用户需要这样:
CREATE USER hug@localhost IDENTIFIED BY '123456';
grant all on mysql.* to hug@localhost;
官方文档是这样给的:
KCY[CC.png)
KCY[CC.png)
The preferred method is to use account-management statements because they are more concise and less
error-prone than manipulating the grant tables directly. All such statements are described in Section 13.7.1,
“Account Management Statements”. Direct grant table manipulation is discouraged, and is not described
here. The server is free to ignore rows that become malformed as a result of such modifications.
Another option for creating accounts is to use the GUI tool MySQL Workbench. Also, several third-party
programs offer capabilities for MySQL account administration. phpMyAdmin is one such program.
The following examples show how to use the mysql client program to set up new accounts. These
examples assume that privileges have been set up according to the defaults described in Section 2.10.4,
“Securing the Initial MySQL Accounts”. This means that to make changes, you must connect to the MySQL
server as the MySQL root user, which has the CREATE USER privilege.
First, use the mysql program to connect to the server as the MySQL root user:
shell> mysql --user=root mysql
If you have assigned a password to the root account, you must also supply a --password or -p option.
After connecting to the server as root, you can add new accounts. The following example uses CREATE
USER and GRANT statements to set up four accounts:
mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
mysql5.7版本开始创建用户需要create user的更多相关文章
- MySQL5.7 mysql.user创建用户
mysql -uroot -proot MySQL5.7 mysql.user表没有password字段改 authentication_string: 一. 创建用户: 命令:CREATE USER ...
- mysql5.7创建用户授权删除用户撤销授权
一, 创建用户: 命令: CREATE USER 'username'@'host' IDENTIFIED BY 'password'; 说明:username - 你将创建的用户名, host - ...
- MYSQL创建用户和授权方法(测试mysql5.7)
一.创建用户: 命令:CREATE USER 'username'@'host' IDENTIFIED BY 'password'; 说明:username - 你将创建的用户名, host - 指 ...
- oracle创建用户ORA-01045:user lacks CREATE SESSION privilege;
conn internal/oracle grant user aaaa identified by aaaa; conn aaaa/aaaa 会报错: SQL>conn aaaa/aaaa 会 ...
- mysql 创建用户、设置权限
MySQL创建用户与授权 一. 创建用户 命令: CREATE USER 'username'@'host' IDENTIFIED BY 'password'; 说明: username:你将创建的用 ...
- Oracle 12c创建用户时出现“ORA-65096: invalid common user or role name”的错误
这篇文章主要介绍CDB和PDB的基本管理,资料来源oracle官方. 基本概念: Multitenant Environment:多租户环境 CDB(Container Database):数据库容器 ...
- Oracle创建用户、角色、授权、建表
oracle数据库的权限系统分为系统权限与对象权限.系统权限( database system privilege )可以让用户执行特定的命令集.例如,create table权限允许用户创建表,gr ...
- SQLServer创建用户登录
创建用户登录注意事项 密码是区分大小写的. 只有创建SQL Server登录时,才支持对密码预先进行哈希运算. 如果指定MUST_CHANGE,则CHECK_EXPIRATION和 CHECK_POL ...
- [转载]Oracle创建用户、角色、授权、建表
出处:https://www.cnblogs.com/roger112/p/7685307.html oracle数据库的权限系统分为系统权限与对象权限.系统权限( database system p ...
随机推荐
- ftp服务器安装与配置
ftp服务器安装与配置 1. ftp服务端的安装 1 如果之前配置过ftp服务器的还是之后配置的服务器,无法启动服务,那么基本是配置出现了错误,那么可先完全卸载后再进行安装.如果无法定位多半是镜像源的 ...
- linux shell set命令
Linux set命令用于设置shell. set指令能设置所使用shell的执行方式,可依照不同的需求来做设置. 语法 set [+-abCdefhHklmnpPtuvx] 参数说明: -a 标示已 ...
- HDU - 3247 Resource Archiver (AC自动机,状压dp)
\(\quad\)Great! Your new software is almost finished! The only thing left to do is archiving all you ...
- 集合源码分析[3]-ArrayList 源码分析
历史文章: Collection 源码分析 AbstractList 源码分析 介绍 ArrayList是一个数组队列,相当于动态数组,与Java的数组对比,他的容量可以动态改变. 继承关系 Arra ...
- Kafka分区分配策略(Partition Assignment Strategy
问题 用过 Kafka 的同学用过都知道,每个 Topic 一般会有很多个 partitions.为了使得我们能够及时消费消息,我们也可能会启动多个 Consumer 去消费,而每个 Consumer ...
- 【洛谷P2756】飞行员配对方案问题
题目大意:二分图匹配裸题. 题解:用网络流进行处理. 找配对方案的时候,采用遍历二分图左边的每个节点,找到不与源点相连,且正向边权值为 0,反向边权值为 1 的边,输出即可. 代码如下 #includ ...
- Java Web乱码原因与解决
Java Web乱码原因与解决 一.了解编码常识: 1.ASCII 码 众所周知,这是最简单的编码.它总共可以表示128个字符,0~31是控制字符如换行.回车.删 除等,32~126是打印字符,可以通 ...
- Windows10搭建FTP服务
1.启用Windows10 Ftp服务 打开控制面板->程序和功能->启用或关闭windows功能然后如图: 2.配置FTP用户 我的电脑->右击点击管理->本地用户和组 在A ...
- c语言int型和char型的自动类型转换
; //机器码为0xff unsigned ; //机器码0xfe if (a <= b){ printf("a <= b\n"); } else{ printf(&q ...
- c\c++里struct字节对齐规则
规则一.: 每个成员变量在其结构体内的偏移量都是成员变量类型的大小的倍数. 规则二: 如果有嵌套结构体,那么内嵌结构体的第一个成员变量在外结构体中的偏移量,是内嵌结构体中那个数据类型大小最大的成员 ...