MariaDB Fix

launchctl unload /Users/dmitry/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

 

brew services restart mariadb

 

sudo nano /opt/homebrew/etc/my.cnf

 

launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mariadb.plist

-w: This flag stands for "write" and modifies the configuration file of the service to prevent it from starting automatically in the future. In other words, it disables the service persistently, even after a reboot.

 

mariadb-secure-installation

 

don't forget to do brew pin mariadb otherwise it'll update to 11.4.2 on the next brew upgrade.

  • sudo chown -R dmitry:staff /opt/homebrew/var/mysql
  • sudo chown -R dmitry:staff /opt/homebrew/var/mysql && sudo chmod -R 755 /opt/homebrew/var/mysql
  • Modify the MariaDB configuration file to run as the dmitry user. Edit the configuration file /opt/homebrew/etc/my.cnf:

    [mysqld]

    user = dmitry

     

pkill -9 mariadb
sudo pkill -9 mariadb
sudo mariadbd-safe --skip-grant-tables &
mysql -uroot
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
flush privileges;
exit;