当前位置:网站首页>Jar package startup failed -mysql modify the default port number / set password free enter
Jar package startup failed -mysql modify the default port number / set password free enter
2022-07-02 21:34:00 【yaoyaozaiye】
【 Issues an error 】
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
Start the site jar The package reported an error ,Mysql Can't connect .
【 Cause analysis 】
There may be two reasons for thinking :
The first is Mysql Password set , This leads to the need for password connection , The connection fails ;
The second is Mysql The default port number is 3306,jar Configured in the package mysql The port number configured on the server is 3307.
【 resolvent 】
Solution ①: Set up Mysql Secret free entry
- modify Mysql Configuration file for :
vi /etc/my.cnf
- Add
skip-grant-tables
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid - Restart after saving Mysql service :
systemctl restart mysqld
- restart jar package , Still not connected Mysql.
Solution ②: modify Mysql Default port number
- modify Mysql Configuration file for :
vi /etc/my.cnf
- Add... After the document
port=3307
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock - Restart after saving Mysql service
systemctl restart mysqld
- Alibaba cloud server , Security group policy is open 3307 port
- restart jar package , success !
边栏推荐
- Welfare | Pu Aries | liv heart co branded Plush surrounding new products are on the market!
- Research Report on market supply and demand and strategy of China's plastic trunking industry
- Common routines of compressed packets in CTF
- 1007 maximum subsequence sum (25 points) "PTA class a exercise"
- mysql
- Research Report on market supply and demand and strategy of Chinese garden equipment industry
- [shutter] shutter layout component (opacity component | clipprect component | padding component)
- MySQL learning record (3)
- MySQL learning notes (Advanced)
- Micro SD Card Industry Research Report - market status analysis and development prospect forecast
猜你喜欢
[shutter] shutter layout component (opacity component | clipprect component | padding component)
MySQL learning record (8)
MySQL learning notes (Advanced)
Research Report on ranking analysis and investment strategic planning of RFID market competitiveness of China's industrial manufacturing 2022-2028 Edition
[fluent] dart technique (independent main function entry | nullable type determination | default value setting)
The web version of xshell supports FTP connection and SFTP connection [detailed tutorial] continued from the previous article
Capacity expansion mechanism of ArrayList
Volvo's first MPV is exposed! Comfortable and safe, equipped with 2.0T plug-in mixing system, it is worth first-class
D4:非成对图像去雾,基于密度与深度分解的自增强方法(CVPR 2022)
How is LinkedList added?
随机推荐
How is LinkedList added?
Add two numbers of leetcode
China plastic bottle market trend report, technological innovation and market forecast
Research Report on the overall scale, major manufacturers, major regions, products and applications of metal oxide arresters in the global market in 2022
Chinese Indian seasoning market trend report, technical dynamic innovation and market forecast
AES encryption CBC mode pkcs7padding filling Base64 encoding key 32byte iv16byte
BitSet complement
6 pyspark Library
Research Report on right-hand front door industry - market status analysis and development prospect forecast
MySQL learning record (7)
Research Report on the overall scale, major manufacturers, major regions, products and application segmentation of precoated metallic coatings in the global market in 2022
Makefile: usage of control functions (error, warning, info)
Common routines of compressed packets in CTF
26 FPS video super-resolution model DAP! Output 720p Video Online
暑期第一周总结
Welfare | Pu Aries | liv heart co branded Plush surrounding new products are on the market!
Select function
kernel tty_ struct
The web version of xshell supports FTP connection and SFTP connection [detailed tutorial] continued from the previous article
MySQL learning record (4)