Skip to content

Making mysqldump work on a zimbra installation

Zimbra installs its own mysql and there is no workable mysqldump command. There is a mysql command wrapper script (/opt/zimbra/bin/mysql) that loads an environment to set password and such, but there is no such thing for mysqldump. I copied that wrapper script to /usr/local/bin/mysqldump so that user zimbra can no run mysqldump. This is it:

#!/bin/bash
# I, halfgaar, copied this script from /opt/zimbra/bin/mysql and adjusted to so that I can do mysqldump.
 
source /opt/zimbra/bin/zmshutil || exit 1
zmsetvars mysql_directory mysql_socket zimbra_mysql_user zimbra_mysql_password
 
exec ${mysql_directory}/bin/mysqldump -S ${mysql_socket} \
    -u ${zimbra_mysql_user} --password=${zimbra_mysql_password} "$@"

    No Comments ( Add comment / trackback )

    Post a comment

    (required)
    (required)

    Your email is never published nor shared.

    (optional)
    Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>