onepub-dev / onepub-dev/simple_mysql_orm

MySQL Client Error: Authentication plugin not supported: caching_sha2_password

Open
#2 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
8
Forks
0
PR merge metrics
No merged PRs in 30d

Description

MySQL Client Error: Authentication plugin not supported: caching_sha2_password

simple_mysql_orm:
dependency: "direct main"
description:
name: simple_mysql_orm
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"

```

Future<ConnectionWrapper> _validConnection(
ConnectionWrapper? conn) async {
var _conn = conn;
var retries = 30;
var success = false;

String? lastError;
while (!success && retries > 0) {
  try {
    if (_conn != null && await _conn.wrapped.test()) {
      success = true;
      break;
    } else {
      if (_conn != null) {
        _removeBadConnection(_conn);
        _conn = null;
      }
      retries--;
      _conn = await _createNew();
      success = true;
      break;
    }
    // ignore: avoid_catches_without_on_clauses
  } catch (e) {
    // remove the bad connection
    _removeBadConnection(_conn);
    _conn = null;
    lastError = e.toString();
    if (e is MySqlException) {
      /// no point retrying if its access denied.
      if (e.message.contains('Access denied for user')) {
        break;
      } else {
        await _logAndWait(lastError);
      }
    }
    if (e is StateError || e is MySqlException || e is SocketException) {
      await _logAndWait(lastError);
    } else {
      rethrow; //////
    }
  }
}
if (!success) {
  logger.severe('Unable to connect to db. $lastError');
  throw MySqlORMException('Unable to connect to db. $lastError');
}

return _conn!;


Rethrow; ////// An exception is thrown when this line of code is executed


MySQL Client Error: Authentication plugin not supported: caching_sha2_password

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the _validConnection method shown in the issue, then trace _createNew and the wrapped.test call to locate the MySQL authentication setup. Reproduce the caching_sha2_password failure and verify that the resulting behavior or error handling matches the project's intended MySQL support.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, mysql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.