-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql-client
9.0 does not include mysql_native_password
plugin
#180498
Comments
My temporary solution was downgrading to version 8.4:
|
Hello, MySQL 9 no longer supports the mysql_native_password authentication method, which may affect users upgrading from MySQL 8.x to MySQL 9. To resolve this issue, you need to update the MySQL user tables to use the new authentication method. Follow these steps: 1.- Disable the Grant Tables: Edit the MySQL configuration file, typically located at /opt/homebrew/etc/my.cnf.
2.- Restart MySQL:
3.- Connect to MySQL as the root user:
4.- Update User Authentication Method: Refresh the privileges:
5.- Check for users using the mysql_native_password plugin:
6.- Update the root user to use the caching_sha2_password plugin:
7.- Re-enable Grant Tables: After updating, remove or comment out the skip-grant-tables line from the MySQL configuration file. 8.- Restart MySQL to apply the changes:
By following these steps, you should resolve the authentication method issue after upgrading to MySQL 9. |
Well that's an interesting detail for why it doesn't work, but I think this still needs to be fixed somehow. I'm not actually running MySQL locally, but I'm using the mysql-client package to connect to a remove service. In fact it's not even MySQL I'm connecting to, it's actually MariaDB. So a couple things here:
|
Despite upstream's release notes, they didn't actually flip the default value for This could be argued to be an upstream bug (or at least: confusing documentation). Though we could also override that default in the formula. I'd be OK with a PR that does that, though we should compare the install directory before and after to make sure it has the intended effect. |
Exactly our case. We are connecting to remote MySQL-compatible servers. |
As mentioned already, MySQL 9 is not fully backwards compatible without this plugin. Remember to link after installing the older, more stable and potentially less secure version. brew install [email protected]
brew unlink mysql
brew link [email protected] |
This is how I solved this problem, on MySQL 9 and it doesn't use a password for the root user.
and now you can access as before. |
In case it helps anyone, I did this but also remember to refresh the install of whatever tool might be employing it. In my case, since I'm using Python, I was only missing to reinstall the client with pip after the brew reinstall (it's a dumb thing, but quite forgettable)
|
Linking the old version of Is there some reason that |
This adds the `-DWITH_AUTHENTICATION_CLIENT_PLUGINS=yes` flag to add support for older MySQL authentication methods. This support was in the default build prior to MySQL 9.0, but were dropped with that release. Closes Homebrew#180498
do you have any step for this? |
See https://docs.brew.sh/FAQ#can-i-edit-formulae-myself EDIT: Additional arguments are listed at StackOverflow |
Uninstall, deleting everything and reinstall everything fresh with MySQL 9 is also an option.
|
If you're using SQLAlchemy and Python, use PyMySQL. # NOTE: Do not use native MySQL to connect. Use PyMySQL instead.
# CONNECTION_URI = f"mysql+mysqldb://{USER}:{PASSWORD}@{HOST}:{PORT}/{DATABASE}"
CONNECTION_URI = f"mysql+pymysql://{USER}:{PASSWORD}@{HOST}:{PORT}/{DATABASE}"
db = SQLDatabase.from_uri(CONNECTION_URI) |
any estimate to merge this ? |
How are we going to merge an issue? If you meant to comment that on the pull request, there are still unresolved tasks. |
Yes, sorry. I meant to comment in the PR more specifically 0dc3ffd |
For the poor souls out there there's another workaround when reverting to the previous mysql-client is not enough (I didn't work for me) |
The Homebrew MySQL 9.0 client doesn't ship the plugin mysql_native_password anymore, yet our embedded server still uses it: https://github.com/killbill/testing-mysql-server/blob/c977a5cc0faf6b92fc5a71e69e4540d34632c799/src/main/java/org/killbill/testing/mysql/TestingMySqlServer.java#L42 Until we globally update our MySQL test setup, change the user to use the caching_sha2_password plugin as a post startup script. See Homebrew/homebrew-core#180498. Signed-off-by: Pierre-Alexandre Meyer <[email protected]>
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Hi. Commenting to remove state label. I use mysql-client with SingleStore database. Also there are many running older MySQL databases where the old login format may be needed. It is strange that this login option was removed from the client rather than restrict it on server. |
Closing this since there have been no actionable comments since August. |
This is disappointing it is closed without a fix. This bug has broken the packages innotop and percona-toolkit (and maybe others). |
The fix is in: #180498 (comment) |
How did you run your commands with this version? because when I run mysql--version, it says command not found |
@princedavid-0 That means MySQL isn't on your PATH, which you can fix by modifying your .zshrc file: export PATH="$HOMEBREW_PREFIX/opt/mysql/bin:$PATH" |
brew config
Verification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Use MySQL command line client to connect old version MySQL servers using mysql_native_password auth method.
What happened (include all command output)?
What did you expect to happen?
9.0 version client should connect successfully with mysql_native_password auth method. From MySQL 9.0, mysql_native_password is removed from built-in auth methods. But for backward compatibility, client should still include it but now it's not built-in but a dynamically loadable plugin. https://dev.mysql.com/doc/relnotes/mysql/9.0/en/news-9-0-0.html
I think mysql-client should still include it. Otherwise, the new version client might not connect to old version servers.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: