Sometimes, MySQL start-up errors aren’t accurate. If its driving you crazy, just run sudo mysqld on the command line to find out what’s really the problem.
In my case, I had updated some settings in my development server’s /etc/my.cnf. After a long while, I rebooted and lo and behold, MySQL refused to start.
/var/log/mysql/error.log said mysqld couldn’t bind to TCP port 3306, its default port. I went though the usual troubleshooting, and it seemed that the log message was pretty misleading.
I finally tried to run sudo mysqld and it finally told me the real problem: I had misspelled a collation value: “utf_general_ci” instead of “utf8_general_ci”.
So, the lesson is that if MySQL complains about not being able to bind to the address you set, it could be because of something else that’s wrong in /etc/my.cnf.
Leave a comment