How can I access to database via socket connection? (w/ DataGrip)

2.5k views Asked by At

please help me to solve this!

I'm using Sequel Pro at Mac(using MySQL), and now introduced DataGrip by JetBrains. and wanna connect to localhost:3000 n' databases, as Sequel's "socket connection"(name: localhost, username: root, others are void) researched so much but can't resolved...anyone know how to do?

I'm entirely noob for programming, and sorry for poor english also :(

1

There are 1 answers

1
MMacD On

I am not a Mac owner, but the process is the same in general regardless of platform:

  • you write an utility program that listens to the socket for requests.
  • when your program gets a request, it translates it into MySQL's dialect of SQL.
  • it sends that request to the MySQL daemon/service and waits for a response.
  • when it gets the response, it reads it record by record and sends the content back to the requester by means of the socket interface.
  • then it sits and waits for the next request.

The socket is merely the pipe through which data passes. It does not know how to do anything except accept data to be sent to the other end of the connection or deliver data to you, sent from the other end.

You must write, or find, a program to do any other work that you want to do. In this case, that other work is to move data between the MySQL (or MariaDB) database and the socket.