I am trying to install MySQL 5.7 with Homebrew on macOS Mojave, however I am getting the following error:
[ERROR] Could not open file '/var/log/mysql/error.log' for error logging: Operation not permitted [ERROR] Aborting
I have tried to create the file myself so Homebrew doesn't need to create it, but it still complains. /var/log
has this in it
drwxrwxrwx 3 _mysql _mysql 96 20 Aug 21:25 mysql
and inside /var/log/mysql
I have this:
-rwxrwxrwx 1 _mysql _mysql 0 20 Aug 21:25 error.log
(I manually set them to 777 and owned by mysql:mysql
)
This is the full output:
$ brew install mysql@5.7
==> Installing dependencies for mysql@5.7: openssl
==> Installing mysql@5.7 dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2s.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/c4/c4a762d719c2be74ac686f1aafabb32f3c5d5ff3a98935c4925a1ddb9c750ee1?__gda__=exp=1566309208~hmac=eddcaa
######################################################################## 100.0%
==> Pouring openssl-1.0.2s.mojave.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
==> Summary
/usr/local/Cellar/openssl/1.0.2s: 1,795 files, 12.0MB
==> Installing mysql@5.7
==> Downloading https://homebrew.bintray.com/bottles/mysql@5.7-5.7.27.mojave.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/e2/e232cc9150f4f8d65ce5e24e010fa09ea3da90029bfd98036258d4370f75e798?__gda__=exp=1566309224~hmac=f2bf1a
######################################################################## 100.0%
==> Pouring mysql@5.7-5.7.27.mojave.bottle.tar.gz
==> /usr/local/Cellar/mysql@5.7/5.7.27/bin/mysqld --initialize-insecure --user=crmpicco --basedir=/usr/local/Cellar/mysql@5.7/5.7.27 --datadir=/usr/lo
Last 15 lines from /Users/crmpicco/Library/Logs/Homebrew/mysql@5.7/post_install.01.mysqld:
2019-08-20 21:43:07 +0800
/usr/local/Cellar/mysql@5.7/5.7.27/bin/mysqld
--initialize-insecure
--user=crmpicco
--basedir=/usr/local/Cellar/mysql@5.7/5.7.27
--datadir=/usr/local/var/mysql
--tmpdir=/tmp
2019-08-20T13:43:07.725766Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-08-20T13:43:07.730312Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2019-08-20T13:43:07.735699Z 0 [ERROR] Could not open file '/var/log/mysql/error.log' for error logging: Operation not permitted
2019-08-20T13:43:07.735780Z 0 [ERROR] Aborting
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mysql@5.7`
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
mysql@5.7 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have mysql@5.7 first in your PATH run:
echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.bash_profile
For compilers to find mysql@5.7 you may need to set:
export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib"
export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include"
To have launchd start mysql@5.7 now and restart at login:
brew services start mysql@5.7
Or, if you don't want/need a background service you can just run:
/usr/local/opt/mysql@5.7/bin/mysql.server start
==> Summary
/usr/local/Cellar/mysql@5.7/5.7.27: 320 files, 232.3MB
==> Caveats
==> openssl
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
openssl is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.
If you need to have openssl first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
==> mysql@5.7
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
MySQL is configured to only allow connections from localhost by default
To connect run:
mysql -uroot
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.
mysql@5.7 is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.
If you need to have mysql@5.7 first in your PATH run:
echo 'export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"' >> ~/.bash_profile
For compilers to find mysql@5.7 you may need to set:
export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib"
export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include"
To have launchd start mysql@5.7 now and restart at login:
brew services start mysql@5.7
Or, if you don't want/need a background service you can just run:
/usr/local/opt/mysql@5.7/bin/mysql.server start