MySQL Database Connection Faulted

After a couple days of working just fine, our database connection faulted with the error below. Any help is greatly appreciated.

** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection refused STACKTRACE: java.net.ConnectException: Connection refused at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at java.net.Socket.connect(Socket.java:478) at java.net.Socket.<init>(Socket.java:375) at java.net.Socket.<init>(Socket.java:218) at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:173) at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:268) at com.mysql.jdbc.Connection.createNewIO(Connection.java:2745) at com.mysql.jdbc.Connection.<init>(Connection.java:1553) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285) at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294) at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1247) at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1221) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.getConnectionInternal(DatasourceImpl.java:189) at com.inductiveautomation.ignition.gateway.datasource.DatasourceImpl.runTest(DatasourceImpl.java:145) at com.inductiveautomation.ignition.gateway.datasource.DatasourceManagerImpl$FaultedDatasourceRetryer.run(DatasourceManagerImpl.java:1117) at java.lang.Thread.run(Thread.java:662) ** END NESTED EXCEPTION **

In the database connections, I changed “localhost” to the IP address of the server and the connection works again. We would prefer to use “localhost”. Any suggestions?

Ignition: 7.3.1
MySQL: 5.1
OS: Ubuntu 10.04

We needed to allow external connections to the MySQL database, so we changed changed bind-address in my.conf from 127.0.0.1 to the IP address of the server. Is there a way to allow external connections AND to use ‘localhost’ in the Ignition database connection configuration?

My hazy recollection of MySql security was that you could tie down users to specific ip addresses. I would think that if you add localhost as an address in your security list, Ignition would be able to use that.

Sorry I don’t have details, maybe one of the MySQL gurus can help out.

Try commenting out the bind-address line in my.cnf and then restart the MySQL server. It will then bind to localhost automatically, yet external connections can still be used. You can then also use localhost in the MySQL connection parameters within Ignition.

That fixed it. Thanks!