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)")
enter image description here
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!
You need to install [email protected] or [email protected] on MacOS. Because native authentication plugin was removed from mysql 9.0
Run the command line below to uninstall [email protected]
brew uninstall mysqlRun the command lines below to install [email protected]
brew install [email protected]
ln -s /opt/homebrew/opt/[email protected] /opt/homebrew/opt/mysql
If you need to have mysql first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/mysql/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With