Skip to content

Instantly share code, notes, and snippets.

@joparara
Last active September 17, 2024 01:40
Show Gist options
  • Save joparara/3c36347ecb336f66ff28c969517e31e3 to your computer and use it in GitHub Desktop.
Save joparara/3c36347ecb336f66ff28c969517e31e3 to your computer and use it in GitHub Desktop.
fixing issues with homebrew mac mysql

add tmp directory in my.cnf

tmpdir          = /tmp

Note: Mariadb does not need this.

Grant permissions

sudo chmod 0777 /tmp
sudo chmod 0777 /opt/homebrew/var/mysql/{your_mac_profile}..err
sudo chmod 0777 /opt/homebrew/var/mysql/{your_mac_profile}..pid
chmod 0777 /opt/homebrew/var/{your_mac_profile}..err
@joparara
Copy link
Author

lsof /tmp/mysql.sock;
then LOOK for pid, ps -e | grep pid
sudo kill -9 after pid

mysqld login with skip-tables or edit and add to /opt/homebrew/etc/my.cnf [mysqld] \n skip-grant-tables

FLUSH PRIVILEGES;
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password
USING PASSWORD('my secret password');
FLUSH PRIVILEGES;

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