Is it possible to install only mysqldump on macOS

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.


See Eriks answer for the new mysql-client package: brew install mysql-client


The latest mysql 5.7 can be installed via brew.

brew install [email protected]

It takes up about 253MB + 19MB for openssl.

You can remove the server components and cruft manually to get the size down to 127MB

cd /usr/local/Cellar/mysql/5.7.20/
rm -f bin/mysqld bin/mysqld_* lib/libmysqld.a bin/*_embedded

Brew doesn't allow arbitrary package versions to be installed. Some packages do offer MINOR version installs like [email protected] but you will get the latest from that series.

If you have previously installed a version though (and haven't run brew cleanup) it can be switched back to with brew switch.

brew info mysql
brew switch mysql 5.7.20

Brew now also has package mysql-client, so you don't need to install the full mysql package just in order to get tools like mysqldump; It's sufficient to run brew install mysql-client.

You should pay attention on the post-installation notice:

mysql-client is keg-only, which means it was not symlinked into /usr/local, because conflicts with mysql.

If you need to have mysql-client first in your PATH run:

echo 'export PATH="/usr/local/opt/mysql-client/bin:$PATH"' >> ~/.bash_profile

Otherwise, you would need to use binary directly located at /usr/local/opt/mysql-client/bin/mysqldump.