Hi @tombh and welcome to the forums!
Thanks for your question. It's a corner I have managed to overlook since it was raised in the forums previously here.
Overall there are two primary options for connecting to your Indigo mysql service from the command line:
option A) connect to the mysqld service by specifying the user, password and port (much like GUI apps do). This is described here in the above-linked forum post, and is certainly a viable solution for many situations.
The command looks something like this: mysql -u root -p -h 127.0.0.1 -P 50001
where 50001 is the mysql port configured inside Indigo.
option B) tell the command line mysql tools to use Indigo's custom my.cnf
Background: Indigo achieves the ability to run multiple different services of the same type (eg multiple MySQL's) by pointing each instance at its own conf files. In digging deeper today I discovered that this is set up correctly for Indigo's mysqld
(daemon) but not for the mysql
command line client (nor other mysql command line tools such as mysqldump
).
Essentially there are two parts that need to be resolved:
1) Indigo's custom my.cnf
needs to configure client tools to use the correct socket path
2) all such tools need to be told to use Indigo's custom my.cnf
Part 1 has now been fixed and will arrive in the next Indigo release. For now, you would have to override the conf/my.cnf
file like this which is a lot of messing around.
You'd add:
[client]
socket = "{{sock_file}}"
Part 2) will be achieved like so:
indigo.set.my.stack.name.default
mysql --defaults-file=~/.indigo/stacks/XYZ123/mysql_ZG73/conf/my.cnf -uroot
tldr;
Sorry for the hassle at this point! I'll have this whole thing much improved in the next release and will add a document describing how to use it then.
For now, I would recommend the TCP connection method described in option A) above ie
indigo.set.my.stack.name.default
mysql -u root -p -h 127.0.0.1 -P 50001