Reputation: 416
I had mysql version 8 earlier, due to some dependency i had to downgrade to 5.7 so installed [email protected] via brew.
Steps
brew uninstall mysql
brew install [email protected]
mysql.server start
brew link [email protected] --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.
Upvotes: 1
Views: 3297
Reputation: 11
I had the same situation. What helped me is:
First uninstall mysql using brew
brew uninstall mysql
brew uninstall [email protected]
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 [email protected]
brew services start [email protected]
Upvotes: 1