-2

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.

1 Answer 1

0

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!

2
  • I tried running the export command Jul 27, 2015 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. Jul 27, 2015 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .