TablePlus / DBngin

DB Engine
https://dbngin.com
995 stars 19 forks source link

Add ability to edit path to mysqld socket #78

Closed saulbaizman closed 2 years ago

saulbaizman commented 2 years ago

Please fill out the detail below, it helps me investigate the bug:

  1. Driver (Ex: PostgreSQL 10.0): MySQL 8.0.27 Intel | ARM

  2. DBngin build number: 4.0 (42)

  3. macOS version: 10.15.7

  4. The steps to reproduce this issue: n/a


This is a request to be able to change the path to the mysqld socket. It's set to /tmp/mysql_3306.sock. This cannot be over-ridden in a supplementary configuration file because it is passed as an argument on the command line when mysqld is started from the DBngin GUI.

Why am I making this request? Because the mysql CLI looks to connect via a socket located at /tmp/mysql.sock by default. I'm aware that I can create a ~/.my.cnf file and specify the socket there, but that only works on a per-user basis.


Here's the command the GUI issues:

/Users/Shared/DBngin/mysql/8.0.27/bin/mysqld --user=_mysql --port=3306 --socket=/tmp/mysql_3306.sock --basedir=/Users/Shared/DBngin/mysql/8.0.27 --datadir=/Users/saul/Library/Application Support/com.tinyapp.DBngin/Engines/mysql/48272036-C612-4380-A0D9-C845DA1F451D --plugin-dir=/Users/Shared/DBngin/mysql/8.0.27/lib/plugin --log-error=/Users/saul/Library/Application Support/com.tinyapp.DBngin/Engines/mysql/48272036-C612-4380-A0D9-C845DA1F451D/mysqld.local.err --pid-file=/Users/saul/Library/Application Support/com.tinyapp.DBngin/Engines/mysql/48272036-C612-4380-A0D9-C845DA1F451D/mysql.pid

colonelclick commented 2 years ago

I have two other ideas for you.

saulbaizman commented 2 years ago

@colonelclick Thanks for your response, but it isn't relevant. As my original post said, I can't specify the socket name for the mysqld server to use via an external configuration file. Any such directive would be over-ridden by the --socket argument on the command line (which takes precedence over configuration file directives).

In other words, I know I can change the socket the mysql CLI connects to, but I want to change the socket mysqld instantiates. Is that distinction clear?

colonelclick commented 2 years ago

I'm aware that I can create a ~/.my.cnf file and specify the socket there, but that only works on a per-user basis.

Your own words seem to indicate you might have used a configuration file, had you known it was possible to do so beyond a per user basis, and on that nuance I shared my information.

But, yes, now that you mention it, I wonder if your original statement is misleading, because even if you did override it per user, am I correct in thinking it would still be ignored in favor of the command line argument?

Good luck on your quest, I'm sorry I could not be more helpful.

saulbaizman commented 2 years ago

@colonelclick I appreciate your response. The real issue here is that any my.cnf configuration file directive will be ignored as long as the --socket parameter is passed to mysqld via the command line.

I hope future readers will understand this subtle distinction!

huyphams commented 2 years ago

We've added custom socket path, it will be available in the next update!

Screen Shot 2022-01-04 at 6 59 49 PM
huyphams commented 2 years ago

If you don't want to wait for the release, please download the hotpatch here: https://www.dropbox.com/s/sz5xmnakr27n52o/DBngin.dmg?dl=0

saulbaizman commented 2 years ago

@huyphams Wonderful news, thank you!