1:linux登录mysql

[root@localhost mysql]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
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>

2:查看user表,修改连接级别

mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> select host,user from user;
+-----------+------------------+
| host | user |
+-----------+------------------+
| localhost | root |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
+-----------+------------------+
4 rows in set (0.00 sec)
可以看到,root用户的host值为localhost,这代表只能本地连接,将localhost修改为%
update user set host='%' where user='root';

3:可能你觉得到这一步就完事了,但是使用navicat连接测试时,会提示无法解析主机名相关的错误,这是mysql8的一些安全策略的问题,具体请左转google,解决办法如下

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'yourpassword';
FLUSH PRIVILEGES;

4:完毕

mysql 8.0.13开启远程连接 配置方式的更多相关文章

  1. mysql新增用户并开启远程连接

    之前使用mysql一直使用root来连接登录数据库,现在想使用新的用户名来连接数据库,碰到数据连接不上的情况. 把这些记录下来,以备后用 1.首先,创建用户 CREATE USER 'xiazhenx ...

  2. 服务器上 MySql 8.0.16创建远程连接账号、获取初始密码、修改密码、重启命令等

    一. 创建远程连接账号 1. 终端连接服务器 ssh -p 端口号 用户名@ip地址 例如:ssh -p 22 yyy@1.2.3.4 2.进入mysql mysql -u 用户名 -p 然后输入密码 ...

  3. ubuntu mysql新增用户并开启远程连接

    1.首先用root用户登录mysql mysql -u root -p 输入密码后登录成功 2.新建用户 use mysql; select host,user from user;(查看现有用户) ...

  4. docker 部署 mongodb 并且开启远程连接

    mongodb 使用 docker 部署 mongodb 拉取镜像 docker pull mongo 可以查看镜像是否下载成功 docker images | grep mongo 应该会有如下的显 ...

  5. yum 安装 Mysql error ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) 开启远程连接 修改登入密码 忘记root密码 配置防火墙规则 随手mark

    yum 安装 MYsql:        yum install mysql mysql-server mysql-devel -y 1.1 登入报错: ERROR 1045 (28000): Acc ...

  6. mysql如何开启远程连接

    链接地址:http://jingyan.baidu.com/article/046a7b3ed85f3ef9c27fa9dc.html 大家在公司工作中,经常会遇到mysql数据库存储于某个人的电脑上 ...

  7. MySQL开启远程连接权限

    对于我们刚开始安装的mysql或者mariadb来说,默认是不开启远程连接的.所以需要我们手动开启远程连接的权限.如果你是使用docker安装mysql那需要先进入容器中,这里就不讲如何进入容器了,百 ...

  8. MySQL开启远程连接的方法

    默认情况下,mysql只允许本地登录,如果要开启远程连接,则需要修改/etc/mysql/my.conf文件. 一.修改/etc/mysql/my.conf找到bind-address = 127.0 ...

  9. mysql开启远程连接及本地连接

    问题描述 在本机windows上连接linux服务器上的mysql报错:host'XXX' is not allowed to connect to this mysql server. 这个错误是由 ...

随机推荐

  1. IO调度 | Linux块设备中的IO路径及调度策略

    当文件系统通过submit_bio提交IO之后,请求就进入了通用块层.通用块层会对IO进行一些预处理的动作,其目的是为了保证请求能够更加合理的发送到底层的磁盘设备,尽量保证性能最佳.这里面比较重要的就 ...

  2. kotlin 泛型函数

    fun<T> singletonList(item:T):List<T>{ ..... } fun<T>T.basicToString():String{ .... ...

  3. android Vitamio Live 实时视频 记录

    Vitamio 下载地址: https://github.com/yixia/VitamioBundle/releases https://github.com/yixia/VitamioBundle ...

  4. Qt编写安防视频监控系统1-通道切换

    一.前言 通道切换在视频监控系统中是最基础的必备功能,一般都会提供1通道+4通道+6通道+8通道+9通道+16通道这几个通道切换,可能做得比较好的还会提供24通道+32通道的,这个可能对电脑的配置就有 ...

  5. spark入门备忘---1

    import org.apache.spark.{SparkContext, SparkConf} import scala.math.random /** * 利用spark进行圆周率的计算 */ ...

  6. PAT 甲级 1028 List Sorting (25 分)(排序,简单题)

    1028 List Sorting (25 分)   Excel can sort records according to any column. Now you are supposed to i ...

  7. 参照UB单创建DN并过账

    *&---------------------------------------------------------------------* *& Form FRM_DN_POST ...

  8. Delphi10.2安装过程详解

    下载好的Delphi10.2是iso镜像,使用虚拟光驱,快速装载后,提示安装   运行setup.exe安装程序,选择安装语言——点击OK,最好关闭网络和退出其他软件   勾选同意条款,点击next ...

  9. 启动mongodb报错,无法连接mongodb

    报错原因如下: MongoDB shell version v3.4.2 connecting to: mongodb://127.0.0.1:27017 --01T12:: W NETWORK [t ...

  10. jenkins容器内修改root密码--ubuntu系统

    http://www.voidcn.com/article/p-yvnoogkc-ng.html 由于jenkins官方镜像是ubuntu系统,所有啥的都用 sudo 换到root账号,然后登陆har ...