crystal-lang / crystal-mysql

MySQL connector for Crystal
MIT License
107 stars 36 forks source link

connection failure to mysql 8 #62

Open rdp opened 6 years ago

rdp commented 6 years ago

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...

clarkyi commented 5 years ago

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

fernandes commented 5 years ago

@rdp @clarkyi if you could, please, test my branch, the one I opened the PR and give some feedback if works for you

imdrasil commented 5 years ago

I use mysql 8 with --default-authentication-plugin=mysql_native_password and everything seems good

bararchy commented 5 years ago

Still a thing :( can we fix this?

iambudi commented 5 years ago

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';

iambudi commented 4 years ago

Any update about this? Thank you.

bcardiff commented 4 years ago

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:

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.

dansbits commented 3 years ago

Any solution for this yet? I'm seeing this error even after updating the plugin to mysql_native_password.

rdp commented 3 years ago

You may need to reset the password as well

On Friday, October 30, 2020, Dan Carpenter notifications@github.com 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>

matthewmcgarvey commented 1 year ago

Bump, 4 years and counting

matthewmcgarvey commented 1 year ago

If you run mysql through homebrew on macos like I do, these are the steps I took to get it working:

  1. Open the plist that is used by homebrew start mysql (/usr/local/Cellar/mysql/8.0.31/homebrew.mxcl.mysql.plist was mine)
  2. Add <string>--default-authentication-plugin=mysql_native_password</string> to the ProgramArguments array
  3. Run brew services restart mysql
  4. Start your mysql client mysql -u root -p
  5. 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.