当前位置:网站首页>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 !
边栏推荐
- JDBC入门学习(三)之事务回滚功能的实现
- (IntelliJ) plug in background image plus
- 【微服务|Nacos】Nacos版本相关问题一览
- BGP summary of hcip operation
- MCS:离散随机变量——Bernoulli分布
- 小时候 觉得爸爸就是天 无所不能~
- Missing essential plugin
- 面对新的挑战,成为更好的自己--进击的技术er
- The propeller framework v2.3 releases the highly reusable operator library Phi! Restructure development paradigm to reduce cost and increase efficiency
- Un processus GC complet pour le principe JVM
猜你喜欢

UnityShader入门精要——Unity中的渲染优化技术(四)

Complete one-time GC process of JVM principle

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

JVM原理之完整的一次GC流程

AMS:startActivity桌面启动应用

GO语言-panic和recover

IDEA 代码开发完毕后,提交代码,提交后发现分支不对,怎么撤回

How to conduct exploratory data analysis

Open source ecology 𞓜 super practical open source license basic knowledge literacy post (Part 2)

MCS: continuous random variable lognormal distribution
随机推荐
BGP summary of hcip operation
gis利器之Gdal(三)gdb数据读取
Laravel8 implementation of picture verification code
MMDeploy快速安装及使用说明
小时候 觉得爸爸就是天 无所不能~
What do Niu B programmers pay attention to when "creating an index"?
Penetration test basis | attached test points and test scenarios
Image noise reduction denoise AI
气象绘图软件Panoply使用教程 (不定时更新)
C语言栈实现
[microservices | Nacos] list of issues related to the Nacos version
Three implementation methods: left fixed and right adaptive (Flex, float + BFC, float margin left)
应用挂了~
insert into... Where not exists insert to avoid repeated use
hash---------history
Introduction to JDBC (III) implementation of transaction rollback function
App hangs~
BGP experiment
大環境不好難找工作?三面阿裏,幸好做足了准備,已拿offer
Jetpack compose menubar Desktop Menu from door opening to entry