crystal-mysql
crystal-mysql copied to clipboard
connection failure to mysql 8
Exception: packet 254 not implemented (Exception) from lib/mysql/src/mysql/connection.cr:29:9 in 'initialize' from lib/mysql/src/mysql/connection.cr:4:3 in 'new'
connecting to mysql 8 instance...
I have same question
when run
amber db create
output 'packet 254 not implemented'
my amber version 0.11.3
mysql Ver 8.0.12 for osx10.13 on x86_64
Crystal 0.27.2 (2019-02-05)
LLVM: 6.0.1
Default target: x86_64-apple-macosx
crystal-mysql version 0.5.1
@rdp @clarkyi if you could, please, test my branch, the one I opened the PR and give some feedback if works for you
I use mysql 8 with --default-authentication-plugin=mysql_native_password
and everything seems good
Still a thing :( can we fix this?
default_authentication_plugin
with mysql_native_password
will be deprecated. sha256_password
will be default in the future.
Temporary solution:
CREATE USER 'test'@'localhost' IDENTIFIED WITH mysql_native_password BY 'mypassword';
Any update about this? Thank you.
No that I am aware of.
You need to change the authentication plugin to mysql_native_password
which is the old default.
The required steps is to implement the handshake of the password according to the caching_sha2_password
auth plugin.
References:
- https://github.com/go-sql-driver/mysql/pull/794/files
- https://dev.mysql.com/doc/internals/en/connection-phase-packets.html
- https://dev.mysql.com/doc/dev/mysql-server/latest/page_caching_sha2_authentication_exchanges.html
- https://mariadb.com/kb/en/authentication-plugin-sha-256/
- https://mariadb.org/history-of-mysql-mariadb-authentication-protocols/
Ideally, there should be a way to specify before hand the public key of the server. And not only the on-demand key exchange.
The branch https://github.com/bcardiff/crystal-mysql/tree/sha2_password can help as a starting point.
Any solution for this yet? I'm seeing this error even after updating the plugin to mysql_native_password
.
You may need to reset the password as well
On Friday, October 30, 2020, Dan Carpenter [email protected] wrote:
Any solution for this yet? I'm seeing this error even after updating the plugin to mysql_native_password.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.< https://ci4.googleusercontent.com/proxy/fwlQlLLl8MFHGEOQaDaB0pSPzIF30Xoz2OHsmfquRS-Zr-UdpSXJ_kD_-dAkLhSJPB6Z-O-rkjFYeFT_UT3ULJxai3RiSL7tV92T9ledc0DaCG8zt1cIYv7jFarZL3oJCZaeM_6Si7OHlESelWz-9uiyaQHbgQdNHhDlB7-Sk8k9sQ7a3K2E6UtHhR7OzMzKlCHDeuaM7vjyhQdtZ0bwVN1juy8wGX84HfJjr-Go5Q=s0-d-e1-ft#https://github.com/notifications/beacon/AAADBUDCDSYJAE6FJSO5EM3SNNV6XA5CNFSM4FJRHDG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFLUFFJA.gif>
Bump, 4 years and counting
If you run mysql through homebrew on macos like I do, these are the steps I took to get it working:
- Open the plist that is used by homebrew start mysql (
/usr/local/Cellar/mysql/8.0.31/homebrew.mxcl.mysql.plist
was mine) - Add
<string>--default-authentication-plugin=mysql_native_password</string>
to the ProgramArguments array - Run
brew services restart mysql
- Start your mysql client
mysql -u root -p
- Change your password
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
(You can change it back after if you'd like)
After all that, it should work as expected.