This repository has been archived by the owner. It is now read-only.

can't connect to new install of mysql 5.7.9 on El Capitan #46174

Closed
existentialmutt opened this Issue Nov 19, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@existentialmutt

existentialmutt commented Nov 19, 2015

I'm setting up a new machine that came with El Capitan, and trying to install mysql via homebrew. It installs via the pre-built binary "bottle" just fine. The server is running and accepting connections, but when I go to run mysql -u root I get ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO), effectively locking me out of the server.

I've tried resetting the mysql root user password a couple different methods (starting with --skip-grant-tables and via an init file) and neither work. When I reload the server I'm still unable to connect.

I've also tried running sudo chown -R $(whoami) /usr/local Postgres installs and is working just fine.

here's a link to the gist-logs https://gist.github.com/anonymous/e72a1d5d6b1061097ecd

@existentialmutt

This comment has been minimized.

existentialmutt commented Nov 19, 2015

I get the same issue with mariadb 10.1.8

@MikeMcQuaid

This comment has been minimized.

Member

MikeMcQuaid commented Nov 19, 2015

Do you have data you need in that database? If not, rm -rf /usr/local/var/mysql, brew postinstall mysql and restart the launchctl agent and you should be good again.

@jhubscher

This comment has been minimized.

jhubscher commented Nov 20, 2015

oh this took me forever!
just solved it last night, i tried resetting root password, reinstalling, i tried any reasonable solution.
what i really needed to do was unload the daemon process (if you had set it, but run the command anyways):

$ launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

or, if you installed home-brew services (i.e. homebrew tap)
$ brew services stop mysql

or, simply
$ mysql.server stop

then run
$ mysql_secure_installation

and it should be alright, let me know :D

@existentialmutt

This comment has been minimized.

existentialmutt commented Nov 20, 2015

Thanks for the advice. We got it working somehow, but we're not exactly sure what did it.

We renamed /usr/local/var/mysql and then ran mysql_secure_installation

It's possible that the mysql data directory that wasn't working was copied over by Migration Assistant from my old computer. In any case, thanks for taking the time to help me get unstuck!

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.