6

I want to connect to mysql over socket.

This is what I'm trying to do: not working

and it's not working.

This is how it works in mysql workbench: working

Bruno Gelb
  • 163
  • 6

2 Answers2

5

Your host is wrong, to use the socket it must be "localhost", not the socket address.

The url for JDBC to use a socket for connection is:

jdbc:mysql://localhost:3307/my database name?socket=/home/aspect_mkn8rd/tmp/mysql.sock

(leaving out here the definition of a user and password, as your software seems to require it apart, it would be &user=my user&password=my password)

jynus
  • 13,932
  • 1
  • 29
  • 42
  • 1
    What's the bonus in using the socket as opposed to a normal JDBC connection? – Vérace Aug 25 '14 at 16:19
  • 1
    @Vérace Unix socket should be faster than TCP, but not significatively for all kinds of load. I am just answering the original question: "0xDBE how to connect over local socket?" – jynus Aug 25 '14 at 16:23
1

OxDBE is currently at an EAP stage (Early Access Programme) - it could still be (quite) buggy.

Why are you using the socket for Java? All you need to specify is the host, the database name and the port, plus you appear to be specifying a basedir (or related) location - just use a normal JDBC URL. AIUI, the tool is written in Java. Check out this link on the 0xDBE site - and search for socket in the comments and the reply by a JetBrains employee.

Vérace
  • 26,808
  • 7
  • 61
  • 75