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 ...
随机推荐
- python3使用ctypes在windows中访问C和C++动态链接库函数示例
python3使用ctypes在windows中访问C和C++动态链接库函数示例 这是我们的第一个示例,我们尽量简单,不传参,不返回,不访问其他的动态链接库 一 测试环境介绍和准备 测试环境: 操作系 ...
- Appium环境搭建-精简版
Appium自动化环境准备 安装配置JDK 下载Android SDK并配置环境变量 安装模拟器或连接真机 安装appium desktop 安装python和pycharm (开发语言和开发工具) ...
- IIS7.0 asp不能连接access数据 静态系统后台列表不显示 的问题
首先看一下系统磁盘的格式,看是NTFS的还是FAT32的,如果是NTFS的一般就是权限的问题,因为iis读取数据库在系统盘是有缓存的,所以对权限有要求,找到系统盘缓存目录: C:/Windows/te ...
- PWA 渐进式Web应用程序 - 解释
想象一下,如果一个网站上所有的功能都能够作为一个移动应用程序为用户所用——任何设备上都可以使用.可接收所有的通知.离线模式可用,为了实现这个愿景,2015年,谷歌创造了渐进式Web应用程序(PWA). ...
- nginx 配置详解(转)
nginx概述 nginx是一款自由的.开源的.高性能的HTTP服务器和反向代理服务器:同时也是一个IMAP.POP3.SMTP代理服务器:nginx可以作为一个HTTP服务器进行网站的发布处理,另外 ...
- Day042---浮动 背景图设置 相对定位绝对定位
1.练习浮动 2.文本属性和字体属性 文本对齐 text-align left 左对齐 right 右对齐 center 中心对齐 justify 两边对齐 只适应于英文 text-indent ...
- maven的安装教程
一.准备工作 1.确定电脑上已经成功安装jdk7.0以上版本 2.win10操作系统 3.maven安装包 下载 ...
- 多输入select
目录 多输入select IO模型 select介绍 小demo 注意 引入电子书 title: 多输入select date: 2019/3/20 17:21:34 toc: true --- 多输 ...
- axios传参
get //通过给定的ID来发送请求 axios.get('/user?ID=12345') .then(function(response){ console.log(response); }).c ...
- 【小白学Lua】之Lua变长参数和unpack函数
一.简介 Lua的变长参数和unpack函数在实际的开发中应用的还挺多的,比如在设计print函数的时候,需要支持对多个变量进行打印输出,这时我们就需要用到Lua中的变长参数和unpack函数了. 二 ...