I wanted to do something similar and found this SQL statement: SHOW VARIABLES LIKE 'basedir'
$result = mysql_query("SHOW VARIABLES LIKE 'basedir'"); $row = mysql_fetch_assoc($result); echo $row['Variable_name']." = ".$row['Value'];
It will tell you the base directory of the MySQL server. Add "/ bin /" and then your command.
Enjoy it!
source share