1

I had mysql version 8 earlier, due to some dependency i had to downgrade to 5.7 so installed mysql@5.7 via brew.

Steps

brew uninstall mysql
brew install mysql@5.7
mysql.server start
brew link mysql@5.7 --force

Now once i have stopped the server and now i want to restart it but i am getting

ERROR! The server quit without updating PID file (/usr/local/var/mysql/dev_box.local.pid).

When i do

mysqld --initialize

I am getting

[ERROR] --initialize specified but the data directory has files in it. Aborting.
[ERROR] Aborting

But when i try to start the server using services it's starting but i am not getting anything in the grep but when i do "brew services list" it's showing that server is started. but i am not able to login

mysqladmin -u root password 'password'

This gives the error

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

I have tried almost everything from

MySql server startup error 'The server quit without updating PID file '

After MySQL install via Brew, I get the error - The server quit without updating PID file

With no luck, hoping for some quick help.

whishky
  • 396
  • 3
  • 13
  • Was there a mysql error log? That's the place I'd go to -- but since one of the answers to the questions you linked to suggested that, I'm assuming you tried. – Geoffrey Wiseman Dec 04 '19 at 18:52
  • @GeoffreyWiseman if you are talking about dev_box.err logs then yes, and tried with deleting that as well. – whishky Dec 05 '19 at 07:50
  • Did you find a solution to this? As im having similar problems now and exhausting all potential solutions – JamWill May 14 '20 at 11:03

1 Answers1

1

I had the same situation. What helped me is:

First uninstall mysql using brew

brew uninstall mysql
brew uninstall mysql@5.7

Then manually go through all folders in /usr/local/ and delete everything related to mysql.

For example, I had /usr/local/etc/my.cnf and my.cnf.default, so had to run rm -f /usr/local/etc/my*; also /usr/local/mysql-5.7.21-macos10.13-x86_64 and mysql-8.0.16-macos10.14-x86_64, so rm -rf /usr/local/mysql* and so on.

After this is done install using brew

brew install mysql@5.7
brew services start mysql@5.7
Ana
  • 11
  • 1