简体   繁体   中英

MariaDB Connection Issue (Digital Ocean)

I am getting the much-discussed ER_NOT_SUPPORTED_AUTH_MODE from the latest MariaDB version 10.4.14, installed on Ubuntu 20.04 running on Digital Ocean droplet. The context:

  1. I can connect to Ubuntu instance of MariaDB both remotely (from MySQL Workbench on my dev PC), and locally (from running the Ubuntu MariaDB client from SSH).
  2. My Vue app (with Express back end) receives the ER_NOT_SUPPORTED_AUTH_MODE error when my app first tries to query the database.
  errno: 1251,
  sqlMessage:
   'Client does not support authentication protocol requested by server; consider upgrading MariaDB client',
  sqlState: '08004',
  fatal: true }
  1. My app (same code) has no problem running against my local dev PC's MariaDB instance, which is version: 10.4.13. That has been solid for months.

I upgraded the MariaDB server and client. I scoured the web and found a lot of activity on this issue, and have tried the most common fix, ie altering the MariaDB user to use the mysql_native_password authentication: ALTER USER 'admin'@'localhost' IDENTIFIED WITH mysql_native_password BY PASSWORD('password')

I tried a few other longshots that seemed possibly related. None of this has made any difference. I've done the FLUSH PRIVILEGES, restarted the server, everything I can think of. Tried everything at least 2 or 3 times to make sure I'm doing it right. Although I've been using MariaDB for years (including on Linux) I am not enough of an expert in MariaDB to know other tricks.

Before I give up on MariaDB and fall back to MySQL (which I got working in an earlier version on Ubuntu), what else can I try? I need to deploy via Ubuntu, not Windows or Raspbian Linux!

Not an answer, but maybe too long for a comment (I didn't count the characters in advance :-)

ER_NOT_SUPPORTED_AUTH_MODE is a server error and occurs under the following circumstances:

  • client sends a pre 4.1 authentication, and server doesn't support 3.23 protocol anymore

  • client changes from old to new scramble length between authentication

  • client side authentication is not known/supported by the server.

To find the exact reason for it, there are several ways:

  1. The probably easiest: Capture your traffic with wireshark or tcpdump, visualize via wireshark and check the server and client hello packets. Very likely there will be more than two hello packets, since authentication will be renegotiated.

  2. Start a debug session of your MariaDB server (probably not possible on DO?!) and set some breakpoints in sql/sql_acl.cc, this file is responsible for user authentication.

I'm not familiar with vue app, but afaik it's using node.js - did you configure it using MariaDB Nodejs?

Good Luck!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM