Skip to content
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

connection failure to mysql 8 #62

Open
rdp opened this issue Jul 12, 2018 · 11 comments
Open

connection failure to mysql 8 #62

rdp opened this issue Jul 12, 2018 · 11 comments

Comments

@rdp
Copy link

rdp commented Jul 12, 2018

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
Copy link

clarkyi commented Feb 18, 2019

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
Copy link
Contributor

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

@imdrasil
Copy link

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

@bararchy
Copy link

bararchy commented Aug 5, 2019

Still a thing :( can we fix this?

@iambudi
Copy link

iambudi commented Sep 23, 2019

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
Copy link

iambudi commented Jan 8, 2020

Any update about this? Thank you.

@bcardiff
Copy link
Member

bcardiff commented Jan 8, 2020

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
Copy link

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

@rdp
Copy link
Author

rdp commented Oct 31, 2020 via email

@matthewmcgarvey
Copy link

Bump, 4 years and counting

@matthewmcgarvey
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants