# How can I see if MySQL is running?



## Matsaki (Oct 24, 2010)

It seems like I have some MySQL problems. First I have to ask how I can see in the terminal if any MySQL process is running?

I think maybe I have two different installations of MySQL on my system.

Thanks!


----------



## tfurp (Oct 24, 2010)

Type this:
mysqladmin version

If that command brings up version info about mysql, then it is running.


----------



## Matsaki (Oct 25, 2010)

So strange my MySQL mess?!? I have MySQL start/stop in prefpane and I start it with no problem (MySQL is running). When typing anything with MySQL in the terminal like 
sudo -u passw -p
 I get "-bash: mysqladmin: command not found"
or like you suggested 
mysqladmin version 
I get "sudo: mysql: command not found"


----------



## ElDiabloConCaca (Oct 25, 2010)

Probably because those binaries are not located in locations that exist in your PATH environment variable.

In that case, you must type the full location of the binary in order to use it, like "/usr/bin/mysql" or "/usr/bin/mysqladmin" if those were located in "/usr/bin" (I don't know, just using that as an example).


----------



## Matsaki (Oct 25, 2010)

Thanks,
But maybe I should change the PATH. But where do I do that?


----------



## ElDiabloConCaca (Oct 25, 2010)

http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/

Be careful with that.  You can really hose yourself if you don't know what you're doing.


----------



## Matsaki (Oct 25, 2010)

Now it's becoming really interesting. As I was playing around with a MySQL installation tutorial before (don't remember the site) I vaguely remember that I did some configuration in a MySQL or php.ini file or something and then create a new .profile in my home directory. Now when I open the terminal I get a message saying:

Last login: Mon Oct 25 18:34:06 on ttys000
-bash: Add: command not found

I think the new .profile was named .bash_profile or .bash_login So maybe I will find that problem as well now. Somewhere in some file it's pointing to one of this wrongly .bash files. But from where does it point to that file?


----------



## webbyron (Sep 30, 2011)

Matsaki, thanks for asking. I was having the same trouble. But it didn't help to change the path. It didn't matter what I did. But tfurp's suggestion showed me it was running. On stackoverflow someone said set up an alias so you don't need to enter the path, but that didn't work either. I'm about a year later than your question - on Snow Leopard 10.6.8 on an iMac. Did you figure out why you got "command not found?"


----------

