问题:springboot项目在用localhost连接mysql时没问题,但当localhost换成ip时出现

该问题:message from server: "Host 'DESKTOP-V8FMU6569' is not allowed to connect to this MySQL server"

意思是:该ip不能连接到mysql。

原因:mysql服务器在安装后,应该默认只能本地localhost才能连接。

解决:

 (1)有安装navicat的,打开找到myql数据库,里面有user表,把user表中的user为root的localhost改成%  。%代表通配,ip都可以访问,如下截图

(2)搞定后 cmd 进入自己mysql数据库

指令为:mysql->mysql-uroot -proot

  然后 mysql->flush privileges;

(3)再去启动自己项目,搞定。

如果没有用navicat,cmd进入mysql数据库

mysql -uroot -proot>use mysql;

mysql>update user set host = '%' where user = 'root';

mysql->flush privileges;

搞定。

参考:https://blog.csdn.net/mao_mao37/article/details/104298661

  https://blog.csdn.net/chaozhiwang/article/details/104295879

ip连接mysql时报不能连接的更多相关文章

  1. 【转载】在使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support

    在使用JDBC连接MySql时报错:You must configure either the server or JDBC driver (via the serverTimezone config ...

  2. 解决使用DBeaver连接MySQL时报错-The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one time zone.

    解决使用DBeaver连接MySQL时报错,其实提示很明显. The server time zone value '�й���׼ʱ��' is unrecognized or represents ...

  3. idea启动服务连接mysql后 Navicat连接mysql就报错2013-Lost connection toMySQL server at

    我是使用navicat的windows端 连接centos下mysql服务器 第一次常规连接mysql正常,idea启动服务连接mysql后 Navicat连接mysql就报错2013-Lost co ...

  4. python MySQLdb连接mysql时报错

    故障现象: >>> import MySQLdb >>> conn = MySQLdb.connect(host=,charset="utf8" ...

  5. HttpResponse,render,redirect,静态文件配置,request对象方法,pycharm连接MySQL,django连接MySQL,django ORM

    HttpResponse 主要用于返回字符串类型的数据 def index(request): return HttpResponse('index页面') 在页面中就会显示 index页面 rend ...

  6. 使用navicat连接mysql时报错:2059 - authentication plugin 'caching_sha2_password'

    首先从本地登录mysql数据库,进入mysql控制台,输入如下命令: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_passwo ...

  7. 连接mysql时报:message from server: "Host '192.168.76.89' is not allowed to connect to this MySQL server 处理方案

    1.先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql; use mysql: 2.执行:select host from user where user = ...

  8. 连接mysql时报:message from server: "Host '192.168.76.89' is not allowed to connect to this MySQL server

    处理方案: 1.先用localhost方式连接到MySQL数据库,然后使用MySQL自带的数据库mysql; use mysql: 2.执行:select host from user where u ...

  9. Navicat Premium 12连接MySQL时报错2059和1045的解决办法

    参考连接:https://www.jianshu.com/p/15876ad165f5 https://jingyan.baidu.com/article/c275f6ba479ca9e33d7567 ...

随机推荐

  1. ISC BIND DNS

    win10,安装BIND9.15.5.x64 安装完成后,计算机服务里启动,总是报无法登陆,但服务属性登陆里设置了密码了啊,就是named,但就是一直报错.后来用下面方法避开了该问题. 安装完成后,服 ...

  2. stm32f407使用Keil uV5建立工程日志

    目录结构 Common           ——包括延时函数等公用函数 STM32F4_FWLIB     ——固件库 Project             ——UV5工程相关文件 Main     ...

  3. 使用 pyenv 管理不同的 Python 版本

    1. pyenv 的安装 $ yum install git -y $ yum install gcc make patch gdbm-devel openssl-devel sqlite-devel ...

  4. Vue过滤器、生命周期函数和vue-resource

    一.过滤器 使用例子: <!DOCTYPE html> <html lang="en"> <head> <meta charset=&qu ...

  5. 前缀和&差分

    一:差分数组概念  一.差分数组的定义及用途 1.定义:对于已知有n个元素的数列d,建立记录它每项与前一项差值的差分数组f:显然,f[1]=d[1]-0=d[1];对于整数i∈[2,n],我们让f[i ...

  6. Vue中的递归组件

    递归函数我们都再熟悉不过了,也就是函数自己调用自己.递归组件也是类似的,在组件的template内部使用组件自身.那递归组件有什么使用场景呢? 我们都知道树这个数据结构就是一种递归的结构,因此我们可以 ...

  7. ES6 - 基础学习(8): Promise 对象

    概述 Promise是异步编程的一种解决方案,比传统的解决方案(多层嵌套回调.回调函数和事件)更强大也更合理.从语法上说,Promise是一个对象,从它可以获取异步操作的消息,Promise 还提供了 ...

  8. mysql 5.7.28 中GROUP BY报错问题 SELECT list is not in GROUP BY clause and contains no

    ----mysql 5.7.28 中GROUP BY报错问题 SELECT list is not in GROUP BY clause and contains no------ 解决方案: sel ...

  9. yum 程序包管理简介

    rpm可以实现程序的快速,简单安装(跟编译安装比),但是rpm自己不能解决依赖,所以很多工具为了自动解决依赖应运而生,其中yum就是其中之一. yum解决依赖的办法: 必须有个文件服务器,里面放置所以 ...

  10. 二、GLTF模型支持

    1.安装ColladaToGltf.exe 2. @echo off cd C:\Users\wangc04\Desktop\daeconverting\ColladaToGltfcollada2gl ...