1

In an attempt to fix another issue I had, I ran the commands below (as per https://dev.mysql.com/doc/refman/5.6/en/old-client.html)

mysql> UPDATE mysql.user SET plugin = 'mysql_old_password'
mysql> WHERE User = 'root' AND Host = 'localhost';
mysql> FLUSH PRIVILEGES;
mysql> SET PASSWORD FOR
    -> 'root'@'localhost' = OLD_PASSWORD('new_password');

And now I'm unable to even get access to mysql through mysql -u root because it gives me the error ERROR 1524 (HY000): Plugin 'mysql_old_password' is not loaded. I can't run mysqladmin and sudo mysqld_safe --skip-grant-tables gives me the error

[1] 51759
my-username@Macbook-Pro ~ % 
[1]  + suspended (tty output)  sudo mysqld_safe --skip-grant-tables

When I tried to run mysqld --old-password=1 I got a whole lot of 2022-08-17T11:10:18.149573Z 1 [ERROR] [MY-012574] [InnoDB] Unable to lock ./ibdata1 error: 35

I have tried uninstalling and reinstalling using homebrew for macOS, when that didn't work I also tried manually installing mysql from the website but that didn't work either.

(I use mysql version 8.0.30 for macOS 12.4)

1 Answer 1

2

Was given the following post on GitHub to properly uninstall MySQL so that I could reinstall it again and have it work correctly:

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew: brew remove mysql brew cleanup

  6. Remove 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*
    
  7. Unload previous MySQL Auto-Login:

     launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
    
  8. Remove previous MySQL Configuration:

     # Edit this file: /etc/hostconfig
     # Remove the line MYSQLCOM=-YES-
    
  9. Remove previous MySQL Preferences:

     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*
    
  10. Restart your computer just to ensure any MySQL processes are killed

  11. Try to run mysql, it shouldn't work.

A comment on that post to properly uninstall MySQL on Apple Silicon devices:

  • brew remove mysql
  • rm -rf /opt/homebrew/var/mysql
  • brew install mysql
  • mysql.server start
  • mysql -uroot

Not the answer you're looking for? Browse other questions tagged or ask your own question.