Search code examples
mysqlmacosdocker

Is it possible to install only mysqldump on macOS


Is it possible to install only mysqldump on macOS without MySQL itself.

I'm using MySQL db via Docker, but can't dump the DB from my local machine via MySQL Workbench.

/Applications/MySQLWorkbench.app/Contents/MacOS/mysqldump is version 5.7.17, but the MySQL Server to be dumped has version 5.7.20.

Do you have any suggestions on how to fix that and be able to make dumps from my local machine.


Solution

  • On Linux, you should be able to install the mysql-client package (which includes mysqldump, mysql, mysqladmin, etc.) without the mysql-server. You'd have to install the mysql-shared package too.

    But I don't know of a package for MacOS that has these packages split up. The binary distribution for MacOS has everything.

    You could install the MySQL package for MacOS and just ignore the fact that you have a mysqld instance. Or you could stop the instance and configure it not to start automatically at bootup (the MacOS distribution includes a System Preferences applet for MySQL, where you can configure it).

    If you want just the client on MacOS, you'd probably have to download the source and build it yourself. I think that's more trouble than it's worth. It would require installing Xcode, and figuring out how to build the client only, etc. This work would likely take hours.

    I'd just install the MacOS distribution and be done with the task.