I am using MySQL using the --skip-networking option on Linux.
I am trying to connect my J2EE based application (using servlets) to the MySQL database using JDBC.
Earlier when I was using MySQL with the --skip-networking option disabled, I was connecting to the database as:
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/mydatabase","myuser","mypassword");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/mydatabase","myuser","mypassword");
You simply cannot do this: the MySQL JDBC driver only supports TCP/IP and - on Windows - named pipes to connect to the database. Therefor specifying
--skip-networking will not allow you to use JDBC MySQL Connector/J at all.
See also http://lists.mysql.com/java/8749:
Java itself doesn't support unix domain sockets, but since you're on windows, you can use named pipes, [..]
The dead-link in the above post is now http://dev.mysql.com/doc/connector-j/en/connector-j-reference-configuration-properties.html