From the answers above, it looks like running MySQL on Mac has not been a smooth task. As I am attempting to learn SQL and MySQL, I too faced the error of it quitting unexpectedly.
I have found two practical ways of solving it:
- Downgrade to an earlier version of MySQL
- Install it using HomeBrew
I have verified both of the methods and both seem to solve the problem.
Downgrade to an earlier version of MySQL
To downgrade or install and earlier version of MySQL, you'll simply have to uninstall it from the System Preferences Tab,
Then go to the downloads section on the website at https://dev.mysql.com/downloads/mysql/
And, select the earlier version from the drop-down menu or you can look for a specific version from the archives tab.
And then simply install it, and it should fix the problem.
Installing using HomeBrew
The next option would be installing it with HomeBrew.
Although it worked, but I wouldn't recommend this method because of a few reasons.
You won't have a GUI access to MySQL from the System Preferences like you did with the earlier method and you will have to go an extra step to configure the password and other preferences.
NOTE:
One thing that I'd like to point out is that, if you have Anaconda Distribution installed, but can also be the reason of the problem because of version conflicts and all, but it is just my assumption.
If none of these work, one last option would be a system reset and even that does not work, you can try downgrading your macOS version as I read somewhere that I also maybe causing some issues, but I hope you won't have to encounter this situation.
Good Luck!
mysql.server stop; mysql.server start
– Salubrious