jdbc4.CommunicationsException
-
I have some problems. i add sql Datasource and set
driver class name : com.mysql.jdbc.Driver
Connection string : jdbc:mysql://localhost:3306/mt4
*mt4 is database name
and fill Username and passwordi try to Statement test. mango show masage :
- class com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
please Help me?
-
solved
point: For the solutions that you need to change the MySQL settings, you can refer to the following not:Linux: /etc/my.cnf
Windows: D:\Program Files\mysql\bin\my.inicommenting out "skip-networking"
If there is a "skip-networking" line in your MySQL config file, make it comment by adding "#" sign at the beginning of that line. -
Hi te36051,
Interesting! Thanks for sharing the solution. I wasn't familiar with that mysql option. The same problem may be solvable by modifying the connection string to use whatever pipe that configuration was creating. Some relevant information here: https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-reference-configuration-properties.html
But, I would think binding the loopback address (127.0.0.1) would be adequate for most situations.