Skip to content
mengfung.com
til

wp db export fails on hosts that disable proc_open, but mysqldump with the credentials from wp-config.php works

 ·  1 min read

Some shared hosts disable proc_open(), which breaks WP-CLI commands that shell out: wp db export, wp db query, wp plugin delete. Calling mysqldump directly works, and WP-CLI can still read the credentials:

MYSQL_PWD="$(wp config get DB_PASSWORD)" mysqldump --no-tablespaces \
  -h "$(wp config get DB_HOST)" -u "$(wp config get DB_USER)" "$(wp config get DB_NAME)" > backup.sql