ip连接mysql时报不能连接
问题: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时报不能连接的更多相关文章
- 【转载】在使用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 ...
- 解决使用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 ...
- idea启动服务连接mysql后 Navicat连接mysql就报错2013-Lost connection toMySQL server at
我是使用navicat的windows端 连接centos下mysql服务器 第一次常规连接mysql正常,idea启动服务连接mysql后 Navicat连接mysql就报错2013-Lost co ...
- python MySQLdb连接mysql时报错
故障现象: >>> import MySQLdb >>> conn = MySQLdb.connect(host=,charset="utf8" ...
- HttpResponse,render,redirect,静态文件配置,request对象方法,pycharm连接MySQL,django连接MySQL,django ORM
HttpResponse 主要用于返回字符串类型的数据 def index(request): return HttpResponse('index页面') 在页面中就会显示 index页面 rend ...
- 使用navicat连接mysql时报错:2059 - authentication plugin 'caching_sha2_password'
首先从本地登录mysql数据库,进入mysql控制台,输入如下命令: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_passwo ...
- 连接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 = ...
- 连接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 ...
- Navicat Premium 12连接MySQL时报错2059和1045的解决办法
参考连接:https://www.jianshu.com/p/15876ad165f5 https://jingyan.baidu.com/article/c275f6ba479ca9e33d7567 ...
随机推荐
- 手把手带你阅读Mybatis源码(一)构造篇
前言 今天会给大家分享我们常用的持久层框架——MyBatis的工作原理和源码解析,后续会围绕Mybatis框架做一些比较深入的讲解,之后这部分内容会归置到公众号菜单栏:连载中…-框架分析中,欢迎探讨! ...
- Python趣味入门02: 妥妥地安装配置Python(Windows版)
< 上一篇:Python趣味入门01:你真的了解Python么? 本篇内容手把手教您如何去网上下载安装Python的运行环境,本文写于2020年Python稳定的版本是3.8,Windows流行 ...
- 吴恩达deepLearning.ai循环神经网络RNN学习笔记_看图就懂了!!!(理论篇)
前言 目录: RNN提出的背景 - 一个问题 - 为什么不用标准神经网络 - RNN模型怎么解决这个问题 - RNN模型适用的数据特征 - RNN几种类型 RNN模型结构 - RNN block - ...
- [PowerShell]Windows服务开启、重启、关闭
# 获取服务信息 PS C:\Users\Administrator> Get-Service win* Status Name DisplayName ------ ---- -------- ...
- docker安装db2数据库
查询可安装的db2镜像 # docker search db2 [root@docker-servers ~]# docker search db2 INDEX NAME DESCRIPTION ST ...
- 并发编程之线程池ThreadPoolExecutor
前言 在我们平时自己写线程的测试demo时,一般都是用new Thread的方式来创建线程.但是,我们知道创建线程对象,就会在内存中开辟空间,而线程中的任务执行完毕之后,就会销毁. 单个线程的话还好, ...
- 安全扫描工具Acunetix即AWVS_13.x系列破解版Linux & Windows
本站所提供工具仅供技术学习交流.请勿用于非法行为.否则后果自负. Acunetix,自动化网络应用安全软件的先驱,已经宣布发布Acunetix第13版.新版本提供了一个改进的用户界面,并引入了创新,如 ...
- The finally block does not always execute in try finally
A finally block does not always xecute. The code in the try block could go into an infinite loop, th ...
- R12客户表结构分析
客户表/联系人/PARTY关联 HZ_PARTIES 客户账户表 HZ_CUST_ACCOUNTS 例子: select hp.party_number --客户注册标识 ...
- 在qt5中使用qtmqtt库
qtmqtt库源码下载链接 链接:https://pan.baidu.com/s/1TyqbLX5x17mwhAX-OJiorw 提取码:i6ww perl安装下载链接 链接:https://pan. ...