How to create mysql login-path

In MySQL by Aurimas MikalauskasLeave a Comment

This is just a note to myself. I don’t do this often enough to remember the command, but whenever I’m searching for this, it takes half a minute to find it in MySQL manual, so hopefully this gets indexed better (in my memory as well as in Google).

Here’s the simple command to create a login path:

Obviously you can remove just about anything and only leave the essentials.

Once that’s done, accessing different MySQL instances is as simple as mysql --login-path=mysql1, which is especially useful if you’re accessing different servers from one machine, or if you’re running several MySQL instances on the same machine.

More information on login paths here.