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 ...
随机推荐
- IOS 选择会员资格
选择会员资格 针对所有 Apple 平台进行开发从未如此简单.要开始为 macOS.iOS.tvOS 和 watchOS 开发 app,请从 Mac App Store 下载 Xcode.如果您已准备 ...
- BZOJ3527[Zjoi2014]力——FFT
题目描述 给出n个数qi,给出Fj的定义如下: 令Ei=Fi/qi,求Ei. 输入 第一行一个整数n. 接下来n行每行输入一个数,第i行表示qi. n≤100000,0<qi<100000 ...
- [NOI2017]游戏
题目描述 http://www.lydsy.com/JudgeOnline/upload/Noi2017D2.pdf 题解 如果说没有x的话,那么每一局只能有两种选择,可以描述为是/非,每条限制也可以 ...
- thinkphp5 去除缓存
array_map('unlink', glob(TEMP_PATH . '/*.php')); rmdir(TEMP_PATH);
- python __call__或者说func()()的理解
__call__ 对象后面加括号,触发执行. 注:构造方法的执行是由创建对象触发的,即:对象 = 类名() :而对于 __call__ 方法的执行是由对象后加括号触发的,即:对象() 或者 类()() ...
- Ubuntu18安装Pycharm时遇到的几个问题
今天给电脑安装了Ubuntu18.04,安装了一些基础软件. 这里是Ubuntu安装Pycharm的一些问题: 1.安装Pycharm. 首先需要到Pycharm官网进行下载安装包,由于我的是Ubun ...
- JMeter二次开发环境配置
本文主要介绍如何在Eclipse中配置JMeter开发环境. 一.下载JMeter源码 1.在JMeter官网下载二进制包和源码包: 解压备用: 二进制解压后文件夹名称为“jmeter_release ...
- H5_0005:JS判断域名和时间有效期的方法
(function () { var n = { c: function (t, e) { //console.log("c"); //把i(15)的d数组转换成字串 for (v ...
- Asp.Net Core 新篇章
一. 二. 三. 系列章节 第一节:.Net Core环境的安装和常用指令 第X节:XXXXXXXXXXXXXXXXXXXXXXXXXXXX 第X节:XXXXXXXXXXXXXXXXXXXXXXXXX ...
- 《JAVA并发编程实战》示例程序 第三章
3.1 可见性 程序清单3-1 在没有同步的情况下共享变量(不要这么做) /** * 主线程和读线程都将访问共享变量:ready 和 number * 结果可能 * 1. 主线程先运行完,读线程后运行 ...