HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

0xDBE how to connect over local socket?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
local0xdbeconnecthowsocketover

Problem

I want to connect to mysql over socket.

This is what I'm trying to do:

and it's not working.

This is how it works in mysql workbench:

Solution

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)

Context

StackExchange Database Administrators Q#74843, answer score: 5

Revisions (0)

No revisions yet.