gpt4 book ai didi

mysql - 无法使用 Homebrew 在 MacOS Mojave 上安装 MySQL 5.7

转载 作者:行者123 更新时间:2023-11-30 21:28:30 29 4
gpt4 key购买 nike

我正在尝试在 macOS Mojave 上使用 Homebrew 安装 MySQL 5.7,但是我收到以下错误:

[ERROR] Could not open file '/var/log/mysql/error.log' for error logging: Operation not permitted [ERROR] Aborting

我已经尝试自己创建文件,因此 Homebrew 不需要创建它,但它仍然会报错。 /var/log 里面有这个

drwxrwxrwx 3 _mysql _mysql 96 8 月 20 日 21:25 mysql

/var/log/mysql里面我有这个:

-rwxrwxrwx 1 _mysql _mysql 0 8 月 20 日 21:25 error.log

(我手动将它们设置为 777 并归 mysql:mysql 所有)

这是完整的输出:

$ 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

最佳答案

从 brew install 的输出来看,它看起来已经安装好了。这似乎是/var/log/mysql/error.log 上的权限问题

尝试更改/var/文件夹的权限

关于mysql - 无法使用 Homebrew 在 MacOS Mojave 上安装 MySQL 5.7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57575274/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com