Skip to content

Authentication plugin not supported: caching_sha2_password #23

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

Open
thosakwe opened this issue Feb 13, 2019 · 10 comments
Open

Authentication plugin not supported: caching_sha2_password #23

thosakwe opened this issue Feb 13, 2019 · 10 comments
Assignees

Comments

@thosakwe
Copy link

Hey! Thanks for all the great work on this package. I'm currently running into an error when I try to connect to database. I just installed MySQL, with a fresh new database named angel_orm_test.

I'm connecting like this:

var settings = ConnectionSettings(db: 'angel_orm_test');
var connection = await MySqlConnection.connect(settings);

Which gives the following error:

Unhandled exception:
MySQL Client Error: Authentication plugin not supported: caching_sha2_password
#0      HandshakeHandler.processResponse (package:sqljocky5/auth/handshake_handler.dart:117:7)
#1      Comm._processReceived (package:sqljocky5/comm/comm.dart:58:43)
<asynchronous suspension>
#2      Comm.readPacket (package:sqljocky5/comm/comm.dart:52:7)
<asynchronous suspension>
#3      Comm.connect.<anonymous closure> (package:sqljocky5/comm/comm.dart:175:34)
#4      BufferedSocket._onData (package:sqljocky5/comm/buffered_socket.dart:85:11)
#5      _RootZone.runUnaryGuarded (dart:async/zone.dart:1314:10)
#6      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:336:11)
#7      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:263:7)
#8      _SyncStreamController._sendData (dart:async/stream_controller.dart:763:19)
#9      _StreamController._add (dart:async/stream_controller.dart:639:7)
#10     _StreamController.add (dart:async/stream_controller.dart:585:5)
#11     new _RawSocket.<anonymous closure> (dart:io/runtime/binsocket_patch.dart:1283:33)
#12     _NativeSocket.issueReadEvent.issue (dart:io/runtime/binsocket_patch.dart:826:14)
#13     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#14     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#15     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#16     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

I haven't used MySQL in years, so I'm not 100% sure what the cause might be.

@disburden
Copy link

Same question,should only appear in mysql8.0.

@tejainece
Copy link
Contributor

@thosakwe @disburden PRs are welcome!

@tejainece tejainece self-assigned this Feb 15, 2019
@tejainece
Copy link
Contributor

@tejainece
Copy link
Contributor

Support for "caching_sha2_password" has landed: 8dbfe0d

I haven't tested it. I will do it soon. If you have time, please test it and let me know.

@disburden
Copy link

It seem still doesn't to work

Error 1043 (08S01): Bad handshake

@BasedMusa
Copy link

BasedMusa commented Dec 22, 2020

Still getting this.

I have installed MySQL 8.0 for Ubuntu x64 on my DigitalOcean cloud server.

Using Dart as a backend with Angel & SQLJocky5.

Dart Version

Dart SDK version: 2.10.4 (stable) (Unknown timestamp) on "linux_x64"

StackTrace

MySQL Client Error: Authentication plugin not supported: caching_sha2_password: 
#0      HandshakeHandler.processResponse (package:sqljocky5/auth/handshake_handler.dart:114:7)
#1      Comm._processReceived (package:sqljocky5/comm/comm.dart:56:43)
#2      Comm.readPacket (package:sqljocky5/comm/comm.dart:50:7)
<asynchronous suspension>
#3      Comm.connect.<anonymous closure> (package:sqljocky5/comm/comm.dart:164:34)
#4      BufferedSocket._onData (package:sqljocky5/comm/buffered_socket.dart:85:22)
#5      _RootZone.runUnaryGuarded (dart:async/zone.dart:1384:10)
#6      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:357:11)
#7      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:285:7)
#8      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:808:19)
#9      _StreamController._add (dart:async/stream_controller.dart:682:7)
#10     _StreamController.add (dart:async/stream_controller.dart:624:5)
#11     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1580:33)
#12     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1076:14)
#13     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#14     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#15     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#16     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

@4stern
Copy link

4stern commented Dec 22, 2020

my solution: moving to postgres-server and use https://pub.dev/packages/postgres

@BasedMusa
Copy link

My solution was to configure the MySQL server to use mysql_native_password as the default authentication plugin. I had to find my my.cnf file (Ubuntu 20) and add this at the bottom.

Add this to my.cnf

[mysqld]
default_authentication_plugin=mysql_native_password

Then I restarted the MySQL Server and then created a new user, so that it would be using mysql_native_password as it's authentication plugin.

After this my dart server was finally able to connect!

@relf108
Copy link

relf108 commented May 4, 2021

My solution was to configure the MySQL server to use mysql_native_password as the default authentication plugin. I had to find my my.cnf file (Ubuntu 20) and add this at the bottom.

Add this to my.cnf

[mysqld]
default_authentication_plugin=mysql_native_password

Then I restarted the MySQL Server and then created a new user, so that it would be using mysql_native_password as it's authentication plugin.

After this my dart server was finally able to connect!

This worked a charm for me. Found my.cnf under /etc/mysql

@iammohsinar
Copy link

iammohsinar commented Oct 2, 2021

My solution was to configure the MySQL server to use mysql_native_password as the default authentication plugin. I had to find my my.cnf file (Ubuntu 20) and add this at the bottom.

Add this to my.cnf

[mysqld]
default_authentication_plugin=mysql_native_password

Then I restarted the MySQL Server and then created a new user, so that it would be using mysql_native_password as it's authentication plugin.

After this my dart server was finally able to connect!

This work for me Found homebrew(mysql) my.cnf under /usr/local/etc/

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

7 participants