6

I've been trying to install mysql. I removed all installations of mysql from my system. Followed the following steps

  • brew remove mysql
  • brew cleanup
  • Followed this link to uninstall all of mysql.
  • Did a complete search for any mysql related files
  • restarted the computer

Now fresh install brew install mysql and I get an error in hte postinstall step. The terminal output:

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

I try running brew postinstall mysql but that doesnt help too. The output:

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
leo
  • 1,423
  • 2
  • 14
  • 23
  • Did you run `brew update` before? – bfontaine Nov 16 '15 at 11:27
  • Yes, I did. Several times – leo Nov 16 '15 at 18:24
  • brew update will not correct this. It occurs because a my.cnf file is setting the removed variable thread_concurrency. – Brendan Nov 22 '15 at 04:12
  • @Brendan I removed all existing installations and any leftover my.cnf files – leo Nov 22 '15 at 12:15
  • The my.cnf files can be scattered about. The error is quite clear: thread_concurrency is an unknown variable. Any reference to it will cause MySQL to not start. A bug was filed against MySQL (see http://bugs.mysql.com/bug.php?id=73117) to consider reducing the Error to a Warning -- it does not appear they took the change. – Brendan Nov 22 '15 at 20:21

1 Answers1

7

I ran into this myself. In MySQL 5.7.x the thread_concurrency variable is removed. (It had been deprecated, which caused warnings, but, unless you looked at the logs, you would not have seen that.) The error occurs because a my.cnf file exists that is setting thread_concurrency.

Sadly, my.cnf may exist in multiple places. I suggest first looking in /usr/local/etc (which is where I found mine). It may be also be written as ~/.my.cnf. If you do not find it at these locations, consider executing

find . -name my.cnf -print

from /usr.

Brendan
  • 1,034
  • 9
  • 12
  • I didnt find any my.cnf. Though a general cnf search returns an openssl cnf file. Though I doubt that'll be an issue. `sahilgandhi:usr Sahil$ sudo find . -name *.cnf -print ./local/etc/openssl/openssl.cnf ` – leo Nov 22 '15 at 12:13
  • The my.cnf files can be scattered about. The error is quite clear: thread_concurrency is an unknown variable. Any reference to it will cause MySQL to not start. A bug was filed against MySQL (see http://bugs.mysql.com/bug.php?id=73117) to consider reducing the Error to a Warning -- it does not appear they took the change. – Brendan Nov 22 '15 at 20:21
  • I found some mysql files in `/usr/local/var/mysql` folder. Is it advisable to delete them? – leo Nov 24 '15 at 16:53
  • I would check the MySQL documentation to find the search paths, but I suspect those files will give you grief if they reference thread_concurrency. – Brendan Nov 24 '15 at 21:19