I am a professional DevOps Engineer with a demonstrated history of working in the internet industry. I am an avid Linux lover and supporter of the open-source movement philosophy.
Location
Sofia, Bulgaria
Work
Developer Advocate at Materialize | Community Manager at DigitalOcean | Co-Founder at DevDojo
Note the client + db1 suffix, then to specify which SQL server you would like to connect to you need to use the --defaults-group-suffix= flag, for the above example it will look like this:
mysql --defaults-group-suffix=db1
To make things easier, you could also add a Bash alias for that command so that you don't have to type the whole thing each time.
Hi there 👋,
Very good question.
Yes, this is doable, you can specify a host and then have a suffix for each host in your config file.
Example:
Note the
client
+db1
suffix, then to specify which SQL server you would like to connect to you need to use the--defaults-group-suffix=
flag, for the above example it will look like this:To make things easier, you could also add a Bash alias for that command so that you don't have to type the whole thing each time.
Hope that this helps!
Thanks for the reply! I will try this out