Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

brew initialization mysql 5.7.11 failed #91

Closed
Gilbertat opened this issue Apr 6, 2016 · 15 comments
Closed

brew initialization mysql 5.7.11 failed #91

Gilbertat opened this issue Apr 6, 2016 · 15 comments

Comments

@Gilbertat
Copy link

I used brew to install mysql 5.7.11 but there are something wrong,console log it's

2016-04-06T02:09:32.966982Z 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. 2016-04-06T02:09:32.968752Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting. 2016-04-06T02:09:32.968771Z 0 [ERROR] Aborting Warning: The post-install step did not complete successfully,You can try again usingbrew postinstall mysql`

How can I fix it? Thank you!

@MikeMcQuaid
Copy link
Member

rm -rf /usr/local/var/mysql which will delete all your local MySQL data so ensure you don't need it or that it is backed up.

@bmichotte
Copy link

I also have a problem.

/usr/local/var > rm -rf /usr/local/var/mysql
/usr/local/var >  brew postinstall mysql
==> /usr/local/Cellar/mysql/5.7.11/bin/mysqld --initialize-insecure --user=benjamin --basedir=/usr/local/Cellar/mysql/5.7.11 --datadir=/usr/
Last 15 lines from /Users/benjamin/Library/Logs/Homebrew/mysql/01.mysqld:
2016-04-06 11:42:10 +0200

/usr/local/Cellar/mysql/5.7.11/bin/mysqld
--initialize-insecure
--user=benjamin
--basedir=/usr/local/Cellar/mysql/5.7.11
--datadir=/usr/local/var/mysql
--tmpdir=/tmp


READ THIS: https://git.io/brew-troubleshooting
If reporting this issue please do so at (not Homebrew/brew):
  https://github.com/Homebrew/homebrew-core/issues

These open issues may also help:
brew initialization mysql 5.7.11 failed https://github.com/Homebrew/homebrew-core/issues/91

Gist : https://gist.github.com/bmichotte/3620cd84060cf00b77a104064a40feee

@MikeMcQuaid
Copy link
Member

@bmichotte Run brew postinstall mysql -v and see what it says.

@bmichotte
Copy link

@MikeMcQuaid I updated the gist with the result of brew postinstall mysql -v

What's the Error: mysql 5.7.11 did not build ?

@MikeMcQuaid
Copy link
Member

@bmichotte What's the output of running /usr/local/Cellar/mysql/5.7.11/bin/mysqld --initialize-insecure --user=benjamin --basedir=/usr/local/Cellar/mysql/5.7.11 --datadir=/usr/local/var/mysql --tmpdir=/tmp manually?

@littlethoughts
Copy link

I also had this error, I did rm -rf /usr/local/var/mysql and then it worked, but now my databases are gone. I have a backup, do you know how I can restore it @MikeMcQuaid ?

@MikeMcQuaid
Copy link
Member

@littlethoughts That's beyond Homebrew's scope, I'm afraid.

@bmichotte
Copy link

@MikeMcQuaid nothing... not a single character

~ /usr/local/Cellar/mysql/5.7.11/bin/mysqld --initialize-insecure --user=benjamin --basedir=/usr/local/Cellar/mysql/5.7.11 --datadir=/usr/local/var/mysql --tmpdir=/tmp
~

(already rmed /usr/local/var/mysql)

@MikeMcQuaid
Copy link
Member

@bmichotte I'm not sure what to do then, I'm afraid. I think you'll need to take this to the MySQL developers.

@Andrew-liu
Copy link

@MikeMcQuaid I have the same question.

when I exec brew postinstall mysql -v. I get some error below.

==> /usr/local/Cellar/mysql/5.7.12/bin/mysqld --initialize-insecure --user=andrew_liu --basedir=/usr/local/Cellar/mysql/5.7.12 --datadir=/usr/local/var/mysql --tmpdir=/tmp
2016-04-14T14:51:57.278084Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-04-14T14:51:57.280086Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2016-04-14T14:51:57.280105Z 0 [ERROR] Aborting

but I have solved it using some command below

sudo rm -rf /usr/local/var/mysql
sudo rm /etc/my.cnf

@jemagee
Copy link

jemagee commented Apr 15, 2016

So just so we're clear, no one has accurately figured out why this doesn't work? I ask this because installing directly from the MySQL web page doesn't work either - the preference pane won't start - you can't start it at all. I don't suppose Postgres conflicts with it?

@Andrew-liu
Copy link

@jemagee For my case, I find some error log in /usr/local/var/mysql/XXXX.err. In this file, some my.cnf config make the mysqld start error.

so when I delete /usr/local/var/mysql and /etc/my.cnf, the mysql server work well.

@MikeMcQuaid
Copy link
Member

I'm afraid this isn't Homebrew specific and is about how to make MySQL work so I'm closing this out. I'd advise you read the MySQL documentation and talk to other MySQL users.

@bmichotte
Copy link

Just FI, in my case, the culprit was a my.cnf file in /usr/local/etc

Once removed, mysql restart

@yunwe
Copy link

yunwe commented Jul 2, 2016

@bmichotte thank u. You helped me a lot.

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants