mysql8.0授权远程登录
之前一直用mysql5.6 远程授权登录,后来换mysql8.0原来的授权方式报错
mysql> grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'root' with grant option' at line 1
mysql> create user 'brady'@'%' identified by 'brady';
Query OK, 0 rows affected (0.02 sec)
8.0授权方式不一样
不能授权给自己
root@a21073c9b9f7:/# mysql -uroot -p
mysql: [Warning] World-writable config file '/etc/mysql/conf.d/mysql.cnf' is ignored.
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.13 MySQL Community Server - GPL Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'root' with grant option' at line 1
先创建一个其他用户
mysql> create user 'brady'@'%' identified by 'brady';
Query OK, 0 rows affected (0.02 sec) mysql>
mysql>
mysql> grant all privileges on *.* to 'brady'@'%' identified by 'brady' with grant option;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'brady' with grant option' at line 1
mysql> GRANT ALL PRIVILEGES ON *.* TO 'brady'@'%';
Query OK, 0 rows affected (0.04 sec) mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec) mysql> ALTER USER 'brady'@'%' IDENTIFIED WITH mysql_native_password BY 'brady';
Query OK, 0 rows affected (0.02 sec) mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
如果用Navicat连接的回报不支持caching_sha2_password验证方式的错误。 将远程访问用户的验证方式改为: msyql_native_password 执行: ALTER USER 'username'@'%' IDENTIFIED WITH mysql_native_password BY 'password'; FLUSH PRIVILEGES;
mysql8.0授权远程登录的更多相关文章
- MySQL 授权远程登录(Ubuntu 环境)
环境:Ubuntu 13.10 (GNU/Linux 3.11.0-12-generic i686) 在用 Navicat 连接远程数据库时报错: ERROR (HY000): Host *** is ...
- Mysql8.0 创建远程登陆账户
mysql8和原来的版本有点不一样,8的安全级别更高,所以在创建远程连接用户的时候, 不能用原来的命令(同时创建用户和赋权): mysql>grant all PRIVILEGES on *.* ...
- ubantu18.04中mysql8.0设置远程连接的问题
在mysql8.0中的配置文件中默认是没有绑定地址的,但是可以自己配置,在my.cnf中 这里使用另一种方式: 首先先连接到自己的数据库执行: use mysql; select host,user ...
- [mysql]增加用户 授权 远程登录
mysql创建用户和授权 1.创建用户: (注意:下面的指令,请在root用户下输入) CREATE USER "用户名" IDENTIFIED BY "密码" ...
- 数据库相关--mysql8.0设置root登录密码
系统:win7 64位 MySQL 8.0 .11 1.启动服务: $ net start mysql 进入MySQL(mysql -hlocalhost -uroot): 2.选择mysql ...
- mysql8.x开启远程登录
mysql8.x密码的认证方式变了,需要修改远程认证方式 问题描述 Connection to lab-130-mysql failed.Unable to load authentication p ...
- Ubuntu 18.04 启动root账号并授权远程登录
Ubuntu 18.04 刚刚上市2个月,下载安装,尝尝鲜~ 安装界面看上去舒服许多, 安装的速度也较之前17.04 和16.04 都快了许多.抱歉,未截图. Ubuntu 安装完成后默认不启动roo ...
- Mysql授权远程登录
在命令行输入如下命令即可: Grant all privileges on *.* to ' with grant option; 再执行 flush privileges
- Navicat连接远程MySQL8.0数据库
前言: 如果你有一台服务器,并且安装了Mysql8.0及以上版本数据库.此时想通过本地Navicat软件连接远程服务器上的mysql数据库.那么接下来你就要完成以下准备工作: 登录远程服务器上的数据库 ...
随机推荐
- linux删除用户报错:userdel: user prize is currently used by process 28021
之前创建了一个普通用户prize,现在想删掉它: [root@VM_0_14_centos /]# userdel prize userdel: user prize 发现原来我克隆了一个会话,另一个 ...
- 【Tomcat】Tomcat 配置开机启动
参考:[Linux]开机自动启动脚本 环境:Linux环境(CentOS 7.4) 步骤 1.在/etc/rc.d/rc.local文件底部,添加内容: # apache-tomcat- /data/ ...
- Silence Removal and End Point Detection MATLAB Code
转载自:http://ganeshtiwaridotcomdotnp.blogspot.com/2011/08/silence-removal-and-end-point-detection.html ...
- RabbitMQ官方教程五 Topic(GOLANG语言实现)
在上一教程中,我们改进了日志记录系统. 我们没有使用只能进行虚拟广播的fanout交换器,而是使用直接交换器,并有可能选择性地接收日志. 尽管使用直接交换改进了我们的系统,但它仍然存在局限性-它不能基 ...
- Linux下操作数据库
一.安装数据库 1.卸载旧版本 检查是否安装有MySQL Server:rpm -qa | grep mysql rpm -e mysql_libs //普通删除模式 rpm -e --nod ...
- QT QML之Label, TextField
现在不是去想缺少什么的时候,该想一想凭现有的东西你能做什么.------ 海明威 <老人与海> Label { id: tipLabel width: 120 height: 40 tex ...
- [转帖]再谈IO的异步,同步,阻塞和非阻塞
再谈IO的异步,同步,阻塞和非阻塞 https://yq.aliyun.com/articles/53674?spm=a2c4e.11155435.0.0.48bfe8efHUE8wg krypt ...
- Java基础笔试练习(六)
1.在Java中,一个类可同时定义许多同名的方法,这些方法的形式参数个数.类型或顺序各不相同,传回的值也可以不相同.这种面向对象程序的特性称为? A.隐藏 B.覆盖 C.重载 D.Java不支持此特性 ...
- QT http请求数据
1.创建一个请求类(HttpWork): HttpWork.h头文件 #pragma once #include <QObject> #include <QNetworkAccess ...
- 链表习题(1)-设计一个递归算法,删除不带头结点的单链表L中所有值为x的结点
/*设计一个递归算法,删除不带头结点的单链表L中所有值为x的结点*/ /* 算法思想:设f(L,x)的功能是删除以L为首结点指针的单链表中所有值等于x的结点, 则显然有f(L->next,x)的 ...