Question: what is the easiest way to run the MySQL app from the terminal

What I have tried: Using some stackOverFlow suggestions I have used the following commands

  • echo $PATH, produces /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/:/usr/local/:/usr/local/mysql/bin

  • cd /usr/local/bin/usr/bin/bin/usr/sbin/sbin/usr/local/usr/local/usr/local/mysql/bin

error file or directory not found

Problem: I cannot follow that path to actually get into mysql/bin folder

I would appreciate any help I can get.

Note that your PATH is build of several "paths" all separated by ":".

If you want to go to your mysql/bin directory, try the following command:

cd /usr/local/mysql/bin

The MySQL application binary files should be located in its bin directories. When you run the command mysql in terminal, essentially you are launching the executable located in the bin directory. As long as the proper bin directory is in your PATH, the mysql command should be recognized everywhere.

Ensure you have the proper bin directory path, this means finding the actual location of your MySQL installation. It is possible that you did not install it to /usr/local/mysql/bin.

If you would like to add the bin directory to your PATH, run the following command:

export PATH=/path_to_bin/:$PATH

You can even add that to your ~/.bashrc file so that you do not need to run the export command every time you open a new terminal.

Good luck!

  • I tried running the export command – Megha Sharma Jul 27 '15 at 18:33
  • export PATH=/usr/path_to_mysql_bin/:$PATH to actually get mysql on the path before the echo $PATH did not have mysql in it. Once I did get it in the path could not get to the bin for mysql using the same path. – Megha Sharma Jul 27 '15 at 18:35

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.