Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Practice of mysql under debian

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Question:

The original java program running ok, the architecture is client- > soap- > server- > mysql.

After reinstalling debian and tomcat,mysql, run the java program, server

Unexpectedly, a sql state null exception was thrown.

Resolution steps:

-ssh login server

-restart mysql

Bs~#:cd / etc/init.d

Bs~#:./mysql restart

-check whether mysql logs in properly.

Bs~#:mysql-uroot-pxxx

Found to enter mysql normally.

-check sock

Bs~#:mysqladmin variables looked at the sock file used and found it to be / var/run/mysqld/mysqld.sock

Bs~#:mysqladmin-- sock=xxx version found normal

-check whether mysql tcpip access is normal, because java accesses mysql through tcpip

Bs~#:mysql-h myip-uroot-p

Both 127.0.0.1 and actual ip get can't connect to mysql server on xxx.

-check the port number that server is listening to:

Bs~#:netstat-an | grep LISTEN

Found that port 3306 was not listening.

-check the my.cnf file

Bs~#:vi / etc/mysql/my.cnf

It is found that the settings of bind-address and port are correct.

-I can't help it. Google finds out why.

Found. It turns out that in debian, mysql defaults to skip-network for security reasons.

Bs~#:vi / etc/mysql/my.cnf

Sure enough, I found the skip-network business. I blamed myself for not looking at the my.cnf file carefully at the beginning.

Cancel this line of restart mysql

It is ok now.if you run into this problem,just try my solution.

[@ more@]

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report