Troubleshooting MySQL Connection Failure in Sequel Pro
When attempting to connect to a MySQL database using Sequel Pro on macOS, you may encounter the following error:
Unable to connect to host 127.0.0.1, or the request timed out.
This issue arises because Sequel Pro has yet to adapt to a recent change in MySQL user authentication. The error message specifically indicates that the authentication plugin caching_sha2_password is not found.
Solution: Modifying Authentication Settings
To resolve this issue, you will need to manually update the authentication settings for MySQL. Here are the steps to follow:
Update MySQL Configuration:
In the [mysqld] section, add the following line:
default-authentication-plugin=mysql_native_password
Change Root Password:
Once connected, execute the following command to change the root password to one compatible with the mysql_native_password plugin:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '[new password]';
Restart MySQL Service:
Exit the MySQL shell and restart the MySQL service using the following command:
brew services restart mysql
After completing these steps, Sequel Pro should be able to connect to the MySQL database without issue.
Note: For non-homebrew MySQL installations, a destructive quick fix is available by initializing the database through System Preferences and selecting "Use legacy password." However, this method will delete existing tables.
The above is the detailed content of Here are a few title options that are question-based, fit the article\'s content, and are in English: * MySQL Connection Failure in Sequel Pro: Why Can\'t I Connect? * Sequel Pro and MySQL Authentica. For more information, please follow other related articles on the PHP Chinese website!