I am Hack Sparrow
Captain of the Internets.

WP-DBManager Error: MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options.

The Problem
You get these errors while using the WP-DBManager WordPress plugin by Lester Chan.

MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator.

MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options.If uncertain, contact your server administrator.

You have given the mysqldump and mysql paths correctly, still you are getting the errors.

The Cause
The directory containing mysqldump and mysql are not included in the open_basedir directive (commonly called setting). The open_basedir directive restricts the directories in which PHP can run executables. Do a phpinfo() and see the value of open_basedir. You are unlikely to see the directory containing mysqldump and mysql (probably /usr/bin).

The Solution

The most obvious thing you might do to try to fix the problem might be to edit the /etc/php.ini file: uncommenting open_basedir and giving it a value of /usr/bin or whatever is the path to mysqldump and mysql. Restart Apache and see if it fixes the problem. If it fixes, cool, else, continue below.

The problem still persists. Doing a phpinfo() shows that /usr/bin is now set in the Global open_basedir setting, but the problem won't go away.

The problem is, the Local value of open_basedir overrides the Global value. How do you change the Local value of open_basedir?

Look for httpd.include or httpd.conf or something similar in /var/www/vhosts/yourwebsite.com/conf. Open the file and add the mysqldump and mysql paths to the open_basedir directive as shown in the example below.

<IfModule sapi_apache2.c>
    php_admin_flag engine on
    php_admin_flag safe_mode on
    php_admin_value open_basedir "/usr/bin:/var/www/vhosts/yourwebsite.com/httpdocs:/tmp"
</IfModule>
<IfModule mod_php5.c>
    php_admin_flag engine on
    php_admin_flag safe_mode on
    php_admin_value open_basedir "/usr/bin:/var/www/vhosts/yourwebsite.com/httpdocs:/tmp"
</IfModule>

Restart you server, and you should be ready to rock!

Notes

  1. The WP-DBManager WordPress plugin will fail if the mysqldump and mysql paths are not included in the open_basedir directive.
  2. The Local value of open_basedir overrides the Global value.
  3. open_basedir restricts the directories in which PHP can run executables.

Exercise
  1. How is open_basedir related to PHP's safe mode?
  2. What are the implications of including /usr/bin to the open_basedir directive?
  3. What are some common security practices in PHP programming?

References
  1. php.ini Documentation: open-basedir
  2. PHP Documentation: Security
  3. PHP Security Guide

2 Responses to “WP-DBManager Error: MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options.”

  1. Rodrigo says:

    I have this error and since I am no expert I contacted the server administrator (shared hosting).

    He replied that I couldnt use db manager plugins which uses mysql command line utilities on shared hosting.

    Do the solutions suggested here should be implemented from the mysql command line or should be done somewhere else (how actually…no expert sorry)?

    regards,

  2. petrich says:

    Thanks, that was useful for me (I adapted it on IIS) and it worked like a charm

Make a Comment