Skip to content

Instantly share code, notes, and snippets.

@irazasyed
Created October 7, 2020 00:05
Show Gist options
  • Save irazasyed/a74766108b4630fc5c7c822df23526e8 to your computer and use it in GitHub Desktop.
Save irazasyed/a74766108b4630fc5c7c822df23526e8 to your computer and use it in GitHub Desktop.
Solution for MySQL / MariaDB Start Issue on MacOS

Solution for MySQL / MariaDB Start Issue on MacOS

Errors

On trying to start mysql.server start

./usr/local/bin/mysql.server: line 264: kill: (12262) - No such process ERROR!

On trying to connect mysql -uroot

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Solution

  • Stop MySQL / MariaDB.
  • Go to /usr/local/var/mysql
  • Delete ib_logfile0 & ib_logfile1 files.
  • Try to start now, It should work 😎
@sheriffmarley
Copy link

sheriffmarley commented Oct 9, 2024

Had the same issue and reinstalling didn't solved it. (M3 Pro, MacOS 14.7)

I stumbled upon this and it helped in my case:

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

@Mistralys
Copy link

Deleting the data files (ib_logfile0 and others) works, but the important question is WHY.

In my case the error occurred after upgrading MariaDB. Looking at the error log, INNODB was complaining that the logfiles had been created by a previous version:

The redo log was created with MariaDB 10.5.12. You must start up and shut down MariaDB 10.7 or earlier.

Installing the earlier version instead made it work again. I have not researched how to do the upgrade safely.

@timothy-kodes
Copy link

@musa11971 Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment