List:MySQL and Java« Previous MessageNext Message »
From:Stas Ostapenko Date:February 24 2006 9:32pm
Subject:--skip-networking and JDBC connection
View as plain text  
Hello !
Is it possible to connect to mysql through jdbc driver
when mysqld started with --skip-networking option ?. For example as here:
"C:\Program Files\MySQL\mysql-4.1.13-win32\bin\mysqld-max-nt.exe"
--console --port=8888 --skip-networking --enable-named-pipe.

Connecting via url jdbc:mysql://127.0.0.1:8888/local_storage bring exception :

 [java] com.mysql.jdbc.CommunicationsException: Communications link
failure due to underlying exception:

 [java] ** BEGIN NESTED EXCEPTION **

 [java] java.net.SocketException
 [java] MESSAGE: java.net.ConnectException: Connection refused: connect

 [java] STACKTRACE:

 [java] java.net.SocketException: java.net.ConnectException:
Connection refused: connect
 [java]     at
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)
 [java]     at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:284)
 [java]     at com.mysql.jdbc.Connection.createNewIO(Connection.java:2541)
 [java]     at com.mysql.jdbc.Connection.<init>(Connection.java:1474)
 [java]     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
 [java]     at java.sql.DriverManager.getConnection(DriverManager.java:525)
 [java]     at java.sql.DriverManager.getConnection(DriverManager.java:171)
 [java]     at MySQLSkipNetworking.main(Unknown Source)


 [java] ** END NESTED EXCEPTION **



 [java] Last packet sent to the server was 50 ms ago.
 [java]     at com.mysql.jdbc.Connection.createNewIO(Connection.java:2607)
 [java]     at com.mysql.jdbc.Connection.<init>(Connection.java:1474)
 [java]     at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
 [java]     at java.sql.DriverManager.getConnection(DriverManager.java:525)
 [java]     at java.sql.DriverManager.getConnection(DriverManager.java:171)
 [java]     at MySQLSkipNetworking.main(Unknown Source)

I'm not sure that it's possible to do the trick. But such
functionality will be very useful for me.
According to docs :
"All interaction with mysqld must be made via named pipes or shared memory
(on Windows) or Unix socket files (on Unix).
This option is highly recommended for systems where only local clients
are allowed."
Thread
--skip-networking and JDBC connectionStas Ostapenko24 Feb
  • Re: --skip-networking and JDBC connectionMark Matthews24 Feb
Re: --skip-networking and JDBC connectionStas Ostapenko2 Mar