当前位置:网站首页>Database connection exception: create connection error, url: jdbc: mysql://ip/ Database name, errorcode 0, state 08s01 problem handling
Database connection exception: create connection error, url: jdbc: mysql://ip/ Database name, errorcode 0, state 08s01 problem handling
2022-06-23 05:26:00 【Firewood boy】
Today, some interfaces have been added to the project , After the local test, package and deploy to the test environment , The database connection failed unexpectedly , The error information is as follows :create connection error, url: jdbc:mysql://ip/ Database name , errorCode 0, state 08S01, The meaning of this error message is that the database connection is abnormal , I believe many people have met , Now, I will always follow the positioning idea of this problem in remote database connection .
1. determine mysql Whether the process is running
ps -ef|grep mysqld
If not running , You can start mysql, Starting mode :
service mysql start
sudo service mysqld start
Different installation methods have different startup commands , You can refer to : Super detailed linux Deploy mysql5.7 Actual combat record
2. Try to connect locally mysql See if the connection is successful
win+r, Input cmd, Enter the black window command line , Enter the command :
msyql -h The name of the server where the remote database is located ip -u root -p
Then enter the password , If you can't log in , You need to recheck the database connection information , Notice the name of the database you want to connect to 、 Whether the database port is correct ( The general default port is 3306)、mysql Whether the database allows access to only one connection ip Or all . This is mainly about the database configuration file my.cnf Configuration information in .
Take another look at mysql In the database user In the table host The address of , The default is localhost, That is, it can only be accessed locally , Remote connections are not allowed .
View by :
USE mysql;
SELECT * FROM USER

host Set to %, Indicates yes root The user is at any ip Next visit . If there are no problems above , Keep looking down .
3. Alibaba cloud ecs Server security group settings
As long as it is an application deployed in Alibaba cloud , You need to set an open port in the security group to allow access ip. In actual development , For those deployed on Alibaba cloud mysql In terms of database , You need to add two records to the database port , One is right mysql The database itself allows access to , That is, the corresponding ip Is the Alibaba cloud server address ; The other is for the specified application server ip Turn on .
The reason for the problem here is the database port in the security group settings 3306 There is only one record , Only right java The server where the project is located ip to open up , Add a new one mysql Server ip The problem is solved after recording .
The above is a summary of troubleshooting ideas for abnormal database connections , If it helps you, you are welcome to like your collection or leave a message in the comment area !
边栏推荐
- 基金业绩评价
- 导出带水印的PDF
- Visual display of TEQC quality analysis results using teqcplot
- 弱者易怒如虎,强者平静如水,真正厉害的人早已戒掉了情绪
- [microservices | Nacos] list of issues related to the Nacos version
- 【微服务|Nacos】Nacos版本相关问题一览
- Mongodb sharding principle
- 气象绘图软件Panoply使用教程 (不定时更新)
- Hcip fifth operation
- insert into... Where not exists insert to avoid repeated use
猜你喜欢

牛B程序员在“创建索引”时都会注意啥?

App hangs~

Difficult to find a job in a bad environment? Ali on three sides. Fortunately, he has made full preparations and has offered

konva 系列教程 1:konva 是什么?

Win软件 - (Net-Framework)已处理证书链,但是在不受信任提供程序信任的根证书中终止

Jetpack Compose 从开门到入门之 MenuBar桌面菜单(Desktop Menu)

Spark 离线开发框架设计与实现

What do Niu B programmers pay attention to when "creating an index"?

Drag and drop拖放框架

Onnxoptimizer, onnxsim usage records
随机推荐
MCS:离散随机变量——Bernoulli分布
C'est dur de trouver un emploi? Ali des trois côtés, heureusement qu'il s'est bien préparé et qu'il a pris un produit.
Web 应用程序安全测试指南
Open source ecology 𞓜 super practical open source license basic knowledge literacy post (Part 2)
(IntelliJ)插件一 Background Image Plus
组合式API-composition-api
markdown给图片加背景色
Array The from method creates an undefined array of length n
MCS: continuous random variable - student's t distribution
大環境不好難找工作?三面阿裏,幸好做足了准備,已拿offer
UnityShader入门精要——Unity中的渲染优化技术(四)
Event log keyword: eventlogtags logtags
关于DOS/DDOS攻击和防御
Fund performance evaluation
Swiftui 2.0 course notes Chapter 5
JDBC introductory learning (II) encapsulation tool class
stm32时钟树错误配置导致 开机进入硬中断
Visual display of TEQC quality analysis results using teqcplot
Mmdeploy quick installation and instructions
gis利器之Gdal(三)gdb数据读取