当前位置:网站首页>数据库连接不上
数据库连接不上
2022-07-21 05:02:00 【彩虹海。】
数据库连接不上可能有以下几种可能
1、(windows)检查数据库服务是否启动 win+r 输入services.msc
2、(虚拟机)检查防火墙是否关闭/检查是否开放数据库端口3306(以CentOS7版本为例)
- 查看firewall服务状态 systemctl status firewalld
- 出现Active: active (running)切高亮显示则表示是启动状态。
- 出现 Active: inactive (dead)灰色表示停止,看单词也行。
- 查看firewall的状态 firewall-cmd --state
- 开启、重启、关闭、firewalld.service服务
- 开启
service firewalld start - 重启
service firewalld restart - 关闭
service firewalld stop
- 开启
- 查看防火墙规则 firewall-cmd --list-all
- 查询、开放、关闭端口
查询端口是否开放
firewall-cmd --query-port=8080/tcp开放80端口
firewall-cmd --permanent --add-port=80/tcp移除端口
firewall-cmd --permanent --remove-port=8080/tcp重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload参数解释
1、firwall-cmd:是Linux提供的操作firewall的一个工具;
2、–permanent:表示设置为持久;
3、–add-port:标识添加的端口;
- 另一种
- 停止firewall
systemctl stop firewalld.service - 禁止firewall开机启动
systemctl disable firewalld.service
- 停止firewall
检查数据库账号密码是否正确
边栏推荐
- 项目debug|no String-argument constructor/factory method to deserialize from String val
- 原子引用解决ABA问题
- Wechat official account development access, using wechat public platform to apply for test number for local development
- Single project - Ruiji takeout
- Pychart creates SQLite database
- Lst list deletion and modification
- MySQL之DQL(数据查询语言)-常见关键字
- Jd.com's popular architect growth manual is launched, and you deserve the architect aura
- 对象拷贝工具类(fastjson)
- CentOS 8中Docker安装MySQL8
猜你喜欢
2022DASCTF MAY web
FL Studio 20.9水果编曲软件中文汉化补丁包
Real time tracking of user management operations
One of the project optimization: the installation and use of redis cache database in the project, and strengthen the project reading operation
In fastjason data type, there is a problem of $ref: "$.list[0]" when parsing jsonobject
汇编语言大作业
Linux redis-6.2.6 stand alone deployment
Solutions: connections could not be acquired from the underlying database!
基于GeoServer开发的地理场景可视化系统
From March to June, after summary, more than 200 pages of true question notes and detailed explanations (including core test sites and 6 major factories)
随机推荐
How to successfully get offers from ant, jd.com, Xiaomi, Tencent and other major manufacturers
转换String三种方式比较:(String)、toString()、String.valueOf()
aws的postgreSQL是去掉了hba吗?
14. 你能说说进程与线程的区别吗
Jd.com's popular architect growth manual is launched, and you deserve the architect aura
图表即代码:以代码化的方式构建新一代图形库 —— Feakin
Error in pulling project POM file, Jai_ core-1.1.3. Jar, solve the problem of introducing jar
Linux redis-6.2.6 stand alone deployment
One of the problems to solve the sorting order error of Oracle database query single table
整合ssm框架的項目
解决:Connections could not be acquired from the underlying database!
如何成功拿到蚂蚁,京东,小米,腾讯等大厂的offer
Flutter obtains longitude and latitude through geolocator positioning plug-in and calls Gaode peripheral information interface
项目debug|no String-argument constructor/factory method to deserialize from String val
Corn表达式用法
How to choose sentinel vs. hystrix current limiting?
Lst list deletion and modification
Address Book Implementation
大厂面经分享,速来
UML模型和类的六大关系