Skip to content

Fixes for Encountered Errors

Saron Solomon Gebre edited this page Jul 3, 2024 · 33 revisions

Fixes for Encountered Errors

MYSQL/MariaDB

Error

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

Fix

If brew was used to install mariadb, run

  • brew uninstall mariadb
  • sudo rm -rf /opt/homebrew/etc/mecabrc
  • brew services restart httpd
  • check the homebrew folder under opt to see if MariaDB folder has been completely removed
  • find and delete etc/my.cnf, my.cnf.d, my.cnf.default, var/mysql/ under homebrew folder
  • brew services restart httpd
  • brew install mariadb
  • brew services start mariadb
  • sudo mysql_secure_installation

Fix 2

If issue reappears the next day after a device restart, there seems to be an issue with the latest mariadb version and MAC OS so we will go ahead and use a different version

  • brew uninstall mariadb
  • sudo rm -rf /opt/homebrew/etc/mecabrc
  • Check the homebrew folder under opt to see if MariaDB folder has been completely removed
  • Find and delete etc/my.cnf, my.cnf.d, my.cnf.default, var/mysql/ under homebrew folder or run the commands below to delete the files
    • rm -rf /opt/homebrew/var/mysql
    • rm -rf /opt/homebrew/etc/my.cnf
    • rm -rf /opt/homebrew/etc/my.cnf.d
    • rm -rf /opt/homebrew/etc/my.cnf.default
  • Restart your computer device(important step!)
  • Check the homebrew folder under opt to see if the MariaDB folder has been completely removed. This is an important step.
  • brew install [email protected]
  • Make sure to add the MariaDB location to your bash/zsh path. It should give you the command to run for adding it to your path after you run the MariaDB installation
  • brew services start [email protected] (if brew deosn't have 10.6.18 try using just 10.6)
  • Open a new terminal and run sudo mysql
  • ALTER USER 'root'@'localhost' IDENTIFIED BY 'newrootpassword';
  • exit

To test if this is working after a system shutdown, restart your computer device and run

  • brew services start [email protected]

  • sudo mysql (Use your computer login password. If it's asking you to set up a password after that, you may need to go through that process)

  • If it's not giving you the tmp socket error again, then the issue seems like it's resolved. Otherwise, repeat fix 2 again but use mysql.server start instead of brew services start

  • If the issue persists again, increase your server memory and other execution timeframes just for testing purposes in your php.ini file and repeat fix 2 steps. Analyze/modify/troubleshoot/google based on error messages you may receive.

    • memory_limit = 512M #or try -1
    • max_input_time = 300
    • max_input_vars = 3000
    • max_execution_time = 300