views:

40

answers:

3

How to figure out the mysql location on a server (windows or linux)?

I would like to run

mysql -u USER -p PASS DATABASE < filename.sql

but I need the absolute path to mysql, how do I find out?

+2  A: 

Unix/Linux: which mysql returns the path to the mysql executable

I don't know about windows.

jigfox
+2  A: 

which mysql wont return anything if its not already in the path.

on linux you can use

updatedb locate mysql

or `find / -name "mysql" -print

Windows just use their crappy search tool

bonez
With this advice you *need* to discuss the running length of both `updatedb` and the `find` and you need o explain when and why the `updatedb` might be a good idea. Finally, there is never any need to be derogatory about platforms other than your favorite. Indeed, as I believe the windows does incremental search database update one could argue that is it some sophisticated than `locate`.
dmckee
A: 
echo $_SERVER["MYSQL_HOME"];
btrandom