I’m working on a blog project using Python and Flask, and I’m using the MySQL database from XAMPP for user registration. The project worked perfectly on my Windows machine, but after switching to macOS, I’ve been encountering various issues with the registration process. I’ve managed to resolve most of the issues, but I’m still struggling with one particular error. I’ve been working on this for a week now and could use some help.
Error Details:
MySQLdb.OperationalError: (2059, "Authentication plugin ‘mysql_native_password’ cannot be loaded: dlopen(/opt/homebrew/Cellar/mysql/9.0.1/lib/plugin/mysql_native_password.so, 0x0002): tried: ‘/opt/homebrew/Cellar/mysql/9.0.1/lib/plugin/mysql_native_password.so’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/mysql/9.0.1/lib/plugin/mysql_native_password.so’ (no such file), ‘/opt/homebrew/Cellar/mysql/9.0.1/lib/plugin/mysql_native_password.so’ (no such file)")
Context:
• The application is running on macOS using XAMPP.
• The database is configured correctly, and I can connect to it using other tools.
• I’ve tried various solutions like asking chatgpt or searching on google
Has anyone encountered this issue or have any suggestions on how to resolve it?
Thanks in advance for your help!
2
Answers
Mysql’s native authentication plugin was removed from mysql 9.0. You need to change the authentication plugin used for the users to one of the supported ones or downgrade mysql from the experimental 9.0 to a production 8.4 or 8.0 version.
You need to install [email protected] or [email protected] on MacOS.
Run the command line below to uninstall [email protected]
brew uninstall mysql
Run the command lines below to install [email protected]
brew install [email protected]
ln -s /opt/homebrew/opt/[email protected] /opt/homebrew/opt/mysql
echo 'export PATH="/opt/homebrew/opt/mysql/bin:$PATH"' >> ~/.zshrc