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. centos7 - nginx配置安装phpmyadmin

    原文  https://www.linuxidc.com/Linux/2017-10/147556.htm 使用Nginx搭建phpMyAdmin   Nginx有什么用? Nginx可读作Engin ...

  2. 数据库与linux中quota的作用

    linux命令,quota 命令显示磁盘使用情况和限额.缺省情况下,或者带 -u 标志,只显示用户限额.quota 命令报告 /etc/filesystems 文件中列出的所有文件系统的限额.如果 q ...

  3. C#winform和百度API互动-----之JS读取中C#中的函数

    例子1 线上JS var getcpylocation =window.external.getlocation(); map.centerAndZoom(getcpylocation,12); C# ...

  4. 加载selenium库

    一.maven的下载.解压以及环境变量配置 1.下载maven: 官网下载地址:http://maven.apache.org/download.cgi 在Files下面下载对应的maven版本(官网 ...

  5. 用Excel如何将文本转换为数字的七种方法

    用Excel如何将文本转换为数字的七种方法 当下,很多工作都会用到Excel,下面本文分步介绍了如何将包含文本的Excel单元格转换为包含数字的单元格. 概述: 当导入在另一程序(如 dBASE 或  ...

  6. django项目添加路由----返回给客户端内容-----windows中的python

    django项目添加路由 url函数的第一个参数是匹配url路径的正则表达式,第2个参数是路由函数 第一个正则表达式是r'^$',其中r表示正则表达式字符串不对转义符进行转义.“^”表示匹配URL路径 ...

  7. MLN 讨论 —— 基础知识

    一. MLN相关知识的介绍 1. First-order logic A first-order logic knowledge base (KB) is a set of formulas in f ...

  8. 4.1 python类的特殊成员,偏函数,线程安全,栈,flask上下文

    目录 一. Python 类的特殊成员(部分) 二. Python偏函数 1. 描述 2. 实例一: 取余函数 3. 实例二: 求三个数的和 三. 线程安全 1. 实例一: 无线程,消耗时间过长 2. ...

  9. 申请 Let's Encrypt 通配符 HTTPS 证书

    目录 一.背景知识 1.1.什么是通配符证书 1.2.什么是 Let's Encrypt 二.证书申请(certbot) 2.1.系统确定 2.2.工具安装 2.3.证书申请 2.4.证书查看 2.5 ...

  10. linux下maven环境的搭建

    1.maven的下载 2.maven的安装和环境变量配置 系统环境linux centos7.2 x64 1.maven的下载 下载地址:https://mirrors.tuna.tsinghua.e ...