"Cannot load from mysql.procs_priv. The table is probably corrupted" on Osx / homebrew

I think it will be better to use this:

mysql_upgrade -u root -p

Enter your password and wait a few seconds.


Completely removing mysql and reinstalling it worked (less than 15 mins).

1. UNINSTALL AND PURGE MYSQL FROM SYSTEM

  1. Back up databases.
  2. Stop and kill any MySQL processes. Check for processes with ps -ax | grep mysql
  3. Uninstall mysql

    brew remove mysql
    brew cleanup
    
  4. Remove all the residual files

    sudo rm /usr/local/mysql
    sudo rm -rf /usr/local/var/mysql
    sudo rm -rf /usr/local/mysql*
    sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    sudo rm -rf /Library/StartupItems/MySQLCOM
    sudo rm -rf /Library/PreferencePanes/My*
    
  5. Unload previous auto login

    launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist 
    
  6. Remove previous config. Delete the line MYSQLCOM=-YES- from /etc/hostconfig

  7. Remove previous preferences

    sudo rm -rf ~/Library/PreferencePanes/My*
    sudo rm -rf /Library/Receipts/mysql*
    sudo rm -rf /Library/Receipts/MySQL*
    sudo rm -rf /private/var/db/receipts/*mysql*
    sudo rm -rf /private/var/db/receipts/*mysql*
    sudo rm -rf /private/var/mysql
    
  8. Optional, restart computer. I didn't.

2. INSTALL MYSQL

  1. Install Mysql

    brew install mysql
    
  2. Set to run on startup

    brew services start mysql
    
  3. Secure the installation

    mysql_secure_installation
    

Tags:

Mysql

Corrupt