Skip to content

Authentication plugin not supported: caching_sha2_password #23

Open
@thosakwe

Description

@thosakwe

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.

Activity

disburden

disburden commented on Feb 15, 2019

@disburden

Same question,should only appear in mysql8.0.

tejainece

tejainece commented on Feb 15, 2019

@tejainece
Contributor

@thosakwe @disburden PRs are welcome!

self-assigned this
on Feb 15, 2019
tejainece

tejainece commented on Feb 19, 2019

@tejainece
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

disburden commented on Feb 22, 2019

@disburden

It seem still doesn't to work

Error 1043 (08S01): Bad handshake

BasedMusa

BasedMusa commented on Dec 22, 2020

@BasedMusa

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

4stern commented on Dec 22, 2020

@4stern

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

BasedMusa

BasedMusa commented on Dec 27, 2020

@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!

relf108

relf108 commented on May 4, 2021

@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 worked a charm for me. Found my.cnf under /etc/mysql

iammohsinar

iammohsinar commented on Oct 2, 2021

@iammohsinar

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Authentication plugin not supported: caching_sha2_password · Issue #23 · dart-db/sqljocky5