cd I ran into a big pain in the butt today with mysql server giving up on me, so I’ve decided to remove it and install MariaDB instead on my Mac machine, however after installed successfully via Homebrew brew install mariadb, I couldn’t get the server to start.


MySQL/MariaDB server doesn’t start when running command mysql.server start (trust me, even brew services start mariadb says it’s started successfully — it’s not…)

Error log

The error log is sitting at /usr/local/var/mysql/xxxx.gateway.err 


In my case, the error log has this 2 lines:

[ERROR] Can’t start server : Bind on unix socket: Permission denied

[ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock

and this is what I had to do to solve the problem:

  1. Make sure you don’t have any other mysql server installed or running. If you do, then this is not an issue, use the other one.
  2. cd /usr/local/Cellar/mariadb/10.1.23
  3. Run the post install script ./scripts/mysql_install_db --rpm
  4. Change the owner of /tmp to your user sudo chown -R $(whoami) /tmp

Then when I run mysql.server start, there is no more error in the log and the server starts successfully.

Hope this is helpful to you

Follow me

Sean Wu

I love coding, and I believe I can make your life easier with my coding skills. I also love making cool websites and innovative apps. Oh, did I mention I'm a coffee junkie too?
Follow me

Latest posts by Sean Wu (see all)

Mac OS MariaDB 10.1.23 start ERROR (Homebrew)