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 😎
@saurabhghatnekar
Copy link

I'm using Mac M1, macOS 13.0.1
for me the logfile was in /Users//data/mariadb folder

@ingageco
Copy link

ingageco commented Dec 23, 2022

Had to delete ibdata1 as well

This worked for me as well. Just move it to the desktop, restart mariadb, then put it back. Seems to get the job done!

@rizkyhello
Copy link

Thank's solution not running mysl database mac

@jcouturier
Copy link

jcouturier commented Feb 11, 2023

None of the suggested solutions worked because I installed mariadb with homebrew. So, using brew services to start/stop actually works. brew services start mariadb
See here for more details.

@abhinav7sinha
Copy link

/opt/homebrew/etc/my.cnf

Thanks, after spending a whole day - finally found it here - /opt/homebrew/var/mysql

@adel-ezz
Copy link

thanks a lot, you save my day

@arwinvdv
Copy link

After updating to macOS Sonoma 14 the connection with 127.0.0.1 was not working anymore (localhost was working correct).

I added this:

[mysqld]
bind-address = 127.0.0.1
skip-name-resolve = 1

at the bottom of /opt/homebrew/etc/my.cnf and ran the command brew services restart mariadb to fix it.

@Tensae-abita
Copy link

Thank you!! You are a lifesaver. this worked for me

@Darmolar
Copy link

/Applications/XAMPP/xamppfiles/var/mysql

Thank you. not been able to do anything for 3days

@DiegoMartinUY
Copy link

Excelent!! That fixed the problem for me. Thanks

@mohamedElshamy00000
Copy link

⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐

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