MySQL error: command ‘clang’ failed with exit status 1 macOS Mojave homebrew

_mysql.c:1894:3: error: use of undeclared identifier 'my_bool'
my_bool recon = reconnect;
^
_mysql.c:1895:58: error: use of undeclared identifier 'recon'
mysql_options(&self->connection, MYSQL_OPT_RECONNECT, &recon);
^
2 errors generated.
error: command 'clang' failed with exit status 1

Problem is caused by the newer mysql client on your machine.

mysql -V
mysql Ver 8.0.12 for osx10.13 on x86_64 (Homebrew)

Find lower version:
brew search mysql
...
[email protected] [email protected] [email protected]
...

and install:
brew install [email protected]

Preview installed versions:
brew list --versions
...
mysql 8.0.12
mysql-client 5.7.23
[email protected] 5.7.23
...

Now replace symlinks:
brew link --overwrite [email protected] --force

Check version again.
mysql -V
mysql Ver 14.14 Distrib 5.7.23, for osx10.14 (x86_64) using EditLine wrapper

To revert:

brew unlink [email protected]
brew link --overwrite mysql
mysql -V
mysql Ver 8.0.12 for osx10.13 on x86_64 (Homebrew)

One thought on “MySQL error: command ‘clang’ failed with exit status 1 macOS Mojave homebrew

Leave a Reply

Your email address will not be published.