mysql5.7版本开始创建用户需要create user
来源:互联网 发布:野兽派与roseonly 知乎 编辑:程序博客网 时间:2024/05/22 12:59
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;
官方文档是这样给的:
The preferred method is to use account-management statements because they are more concise and lesserror-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'
0 0
- mysql5.7版本开始创建用户需要create user
- 详解oracle用户创建(create user)
- 创建Oracle的用户 create user scott identified by tiger;
- oracle创建用户ORA-01045:user lacks CREATE SESSION privilege;
- mysql5.7 创建用户并授权
- 详解oracle用户创建(create user)及oracle自带账户默认密码
- mysql-创建用户报错ERROR 1396 (HY000): Operation CREATE USER failed for 'XXXX'@'XXXX'
- mysql创建用户ERROR 1396 (HY000): Operation CREATE USER failed for XXXXXXXX
- oracle创建用户ORA-01045:user lacks CREATE SESSION privilege;logon denied..的问题
- mysql5.7创建用户授权-删除用户撤销授权
- mysql5.7创建用户授权删除用户撤销授权
- mysql5.7创建用户授权删除用户撤销授权
- create user rm identified by rmrm;-- 创建新的用户 --grant 权限1、权限2...to 用户 给创建用户权限 --ex:grant create ses
- Mysql:sql create user,grant,flush,drop user(增删用户)
- oracle 创建create user 及授权grant
- Oracle 创建create user 及授权grant
- 针对MySQL5.5版本用%创建用户后在本地(localhost)无法登录的问题
- 采用oracle创建用户并授予dba权限 1)创建用户: create user wmlt identified by wmlt; 2)授予dba权限 grant connect,resou
- alter table move和alter table shrink space的区别
- Zxing扫描二维码
- IOS 网络浅析-(三 NSURLConnection代理)
- java反射之通过反射了解集合泛型的本质
- Android中TextWatcher afterTextChanged无限迭代异常
- mysql5.7版本开始创建用户需要create user
- java-简单的定义二位数组
- Activiti 基础概念 笔记
- IOS 网络浅析 (二 网络异步请求)
- Android横竖屏切换时的生命周期
- 啊哈算法学习-简化版桶排序
- Impala、Hive性能简单对比测试
- iOS9 联系人 ContactFramework
- JZ2440:下载程序到板子上