sqljocky5 icon indicating copy to clipboard operation
sqljocky5 copied to clipboard

Authentication plugin not supported: caching_sha2_password

Open thosakwe opened this issue 6 years ago • 10 comments
trafficstars

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.

thosakwe avatar Feb 13 '19 05:02 thosakwe

Same question,should only appear in mysql8.0.

disburden avatar Feb 15 '19 03:02 disburden

@thosakwe @disburden PRs are welcome!

tejainece avatar Feb 15 '19 09:02 tejainece

FYI

https://stackoverflow.com/questions/50557234/authentication-plugin-caching-sha2-password-is-not-supported

tejainece avatar Feb 15 '19 09:02 tejainece

Support for "caching_sha2_password" has landed: https://github.com/dart-db/sqljocky5/commit/8dbfe0d45ef4a104d6ee5d382df3363a61fd3759

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

tejainece avatar Feb 19 '19 13:02 tejainece

It seem still doesn't to work

Error 1043 (08S01): Bad handshake

disburden avatar Feb 22 '19 02:02 disburden

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)

BasedMusa avatar Dec 22 '20 13:12 BasedMusa

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

4stern avatar Dec 22 '20 15:12 4stern

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!

BasedMusa avatar Dec 27 '20 17:12 BasedMusa

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

relf108 avatar May 04 '21 05:05 relf108

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/

iammohsinar avatar Oct 02 '21 19:10 iammohsinar