JChao
JChao

Reputation: 2319

I have multiple MySql installed on my machine, how do I choose which one to use?

Title is a little confusing, but I installed mysql using brew, and somehow there's another one when I which mysql

which shows /usr/local/bin/mysql. I assume that's another installment

I'm trying to use the brew one when I just type in mysql with more commands followed. How do I do it?

Upvotes: 1

Views: 351

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 521437

You can add the path for the MySQL instance you want to run to your PATH variable. If your shell is bash then you can add the MySQL path to your .bashrc file:

PATH=${PATH}:/path/to/your/mysql

You should also remove any other MySQL instances you see in the PATH. Now next time when you use mysql from the command line Linux should pick up on the one you added to the PATH.

Read the MySQL documentation for more information.

Upvotes: 1

Related Questions