【问题标题】:brew mysql installation, error in posinstall stepbrew mysql安装,posinstall步骤出错
【发布时间】:2016-02-16 12:29:14
【问题描述】:

我一直在尝试安装 mysql。我从系统中删除了所有 mysql 安装。遵循以下步骤

  • brew 删除 mysql
  • 酿造清理
  • 关注this link卸载所有mysql。
  • 完整搜索了所有 mysql 相关文件
  • 重新启动计算机

现在全新安装 brew install mysql,我在 hte postinstall 步骤中遇到错误。终端输出:

sahilgandhi:~ Sahil$ brew install mysql

==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.9.el_capitan.bott
Already downloaded: /Library/Caches/Homebrew/mysql-5.7.9.el_capitan.bottle.tar.gz
==> Pouring mysql-5.7.9.el_capitan.bottle.tar.gz
==> /usr/local/Cellar/mysql/5.7.9/bin/mysqld --initialize --user=Sahil --basedir
Last 15 lines from /Users/Sahil/Library/Logs/Homebrew/mysql/01.mysqld:
--initialize
--user=Sahil
--basedir=/usr/local/Cellar/mysql/5.7.9
--datadir=/usr/local/var/mysql
--tmpdir=/tmp

2015-11-15T08:04:05.376664Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-15T08:04:05.387829Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2015-11-15T08:04:05.387847Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2015-11-15T08:04:05.551157Z 0 [Warning] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2015-11-15T08:04:08.618316Z 0 [Warning] InnoDB: New log files created, LSN=45790
2015-11-15T08:04:09.125841Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2015-11-15T08:04:09.403537Z 0 [ERROR] unknown variable 'thread_concurrency=4'
2015-11-15T08:04:09.403591Z 0 [ERROR] Aborting

Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mysql`
==> Caveats
A "/etc/my.cnf" from another install may interfere with a Homebrew-built
server starting up correctly.

To connect:
mysql -uroot

To have launchd start mysql at login:
  ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
  mysql.server start
==> Summary
????  /usr/local/Cellar/mysql/5.7.9: 12629 files, 464M

我尝试运行brew postinstall mysql,但这也无济于事。输出:

sahilgandhi:~ Sahil$ brew postinstall mysql
==> /usr/local/Cellar/mysql/5.7.9/bin/mysqld --initialize --user=Sahil --basedir
Last 15 lines from /Users/Sahil/Library/Logs/Homebrew/mysql/01.mysqld:
2015-11-15 14:01:55 +0530

/usr/local/Cellar/mysql/5.7.9/bin/mysqld
--initialize
--user=Sahil
--basedir=/usr/local/Cellar/mysql/5.7.9
--datadir=/usr/local/var/mysql
--tmpdir=/tmp

2015-11-15T08:31:55.974794Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-11-15T08:31:55.974968Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2015-11-15T08:31:55.974974Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2015-11-15T08:31:56.054515Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2015-11-15T08:31:56.054569Z 0 [ERROR] Aborting


READ THIS: https://git.io/brew-troubleshooting

These open issues may also help:
groonga-normalizer-mysql: avoid sandbox problem https://github.com/Homebrew/homebrew/pull/45889
mysql: Add patches for memcached build failure https://github.com/Homebrew/homebrew/pull/44650
percona-toolkit does not depend on MySQL https://github.com/Homebrew/homebrew/pull/41595
no memcached support in most recent MySQL brew port https://github.com/Homebrew/homebrew/issues/42935
MySQL not woking with --datadir option https://github.com/Homebrew/homebrew/issues/41160
mysql-proxy 0.8.5 failed to build with mysql-connector-c 6.1.6 https://github.com/Homebrew/homebrew/issues/41263
mysql-connector-c++ cannot build with mariadb  https://github.com/Homebrew/homebrew/issues/34578
mysql failed to build on 10.10 https://github.com/Homebrew/homebrew/issues/33448
Packages with --with-mysql option not satisfied by mariadb https://github.com/Homebrew/homebrew/issues/32973

【问题讨论】:

  • 你之前跑过brew update吗?
  • 是的,我做到了。几次
  • brew 更新不会更正此问题。这是因为 my.cnf 文件正在设置已删除的变量 thread_concurrency。
  • @Brendan 我删除了所有现有的安装和所有剩余的 my.cnf 文件
  • my.cnf文件可以散落一地。错误很明显:thread_concurrency 是一个未知变量。对它的任何引用都会导致 MySQL 无法启动。针对 MySQL 提交了一个错误(请参阅bugs.mysql.com/bug.php?id=73117),以考虑将错误减少为警告——似乎他们没有接受更改。

标签: mysql homebrew post-install


【解决方案1】:

我自己也遇到过这个。在 MySQL 5.7.x 中,thread_concurrency 变量被删除。 (它已被弃用,这会导致警告,但是,除非您查看日志,否则您不会看到。)发生错误是因为存在设置 thread_concurrency 的 my.cnf 文件。

遗憾的是,my.cnf 可能存在于多个地方。我建议首先查看/usr/local/etc(这是我找到我的地方)。也可以写成~/.my.cnf。如果在这些位置没有找到,请考虑执行

find . -name my.cnf -print

来自/usr

【讨论】:

  • 我没有找到任何 my.cnf。虽然一般的 cnf 搜索会返回一个 openssl cnf 文件。虽然我怀疑这将是一个问题。 sahilgandhi:usr Sahil$ sudo find . -name *.cnf -print ./local/etc/openssl/openssl.cnf
  • my.cnf文件可以散落一地。错误很明显:thread_concurrency 是一个未知变量。对它的任何引用都会导致 MySQL 无法启动。针对 MySQL 提交了一个错误(请参阅bugs.mysql.com/bug.php?id=73117),以考虑将错误减少为警告 - 似乎他们没有接受更改。
  • 我在/usr/local/var/mysql文件夹中找到了一些mysql文件。是否建议删除它们?
  • 我会检查 MySQL 文档以找到搜索路径,但我怀疑这些文件如果引用 thread_concurrency 会让你感到悲痛。
猜你喜欢
  • 2014-11-27
  • 1970-01-01
  • 1970-01-01
  • 2014-01-23
  • 2012-10-31
  • 2020-02-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多