最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Authentication plugins for accessing MariaDB on XAMPP with C++ - Stack Overflow

programmeradmin1浏览0评论

I have installed XAMPP and created a MariaDB database and PHP files to access that database, and everything works fine. Now I am writing a C++ program to access the same database, but I get the error message: "Authentication plugin 'mysql_native_password' cannot be loaded. The specified module cannot be found." I created a new user with authentication 'mysql_old_password' and get a similar error message. It seems that the current version of XAMPP doesn't ship with any plugins. Creating an empty folder for the plugins doesn't help. If I try to change the authentication method to 'caching_sha2_password', the operation fails, as 'mysql_native_password' and 'mysql_shared_password' are the only two authentication methods permitted, and the plugins are no longer supported. So is it possible to do this with C++?

I have installed XAMPP and created a MariaDB database and PHP files to access that database, and everything works fine. Now I am writing a C++ program to access the same database, but I get the error message: "Authentication plugin 'mysql_native_password' cannot be loaded. The specified module cannot be found." I created a new user with authentication 'mysql_old_password' and get a similar error message. It seems that the current version of XAMPP doesn't ship with any plugins. Creating an empty folder for the plugins doesn't help. If I try to change the authentication method to 'caching_sha2_password', the operation fails, as 'mysql_native_password' and 'mysql_shared_password' are the only two authentication methods permitted, and the plugins are no longer supported. So is it possible to do this with C++?

Share Improve this question edited Mar 13 at 12:35 Botje 31.5k4 gold badges34 silver badges47 bronze badges asked Mar 12 at 22:42 Eric KEric K 311 silver badge6 bronze badges 1
  • 1 I would check whatever database connector you have on the client side for the plugins. It nay be too new and not have legacy plugins. You may also want to check if you use a mariadb driver or a mysql one. If the latter, then you may want to swap to the former... – Shadow Commented Mar 12 at 23:07
Add a comment  | 

1 Answer 1

Reset to default 1

Not really an answer, but too long for a comment....

Some clarifications:

XAMPP package contains a MariaDB Database, which doesn't support authentication via caching_sha2_password - this authentication method is supported by MySQL only.

mysql_old_password authentication is used to connect to a MySQL Server < 4.1 and shouldn't be used at all unless you want to connect to a server which was released mostly 20 years ago.

mysql_native_password is the default authentication method in MariaDB - when using/linking against MariaDB Connector/C it is statically linked (and not a dynamically loaded via .so/.dll). mysql_native_password is disabled in MySQL since version 8.0.34

m̀ysql_shared_password doesn't exist at all - neither in MySQL nor MariaDB.

Since your C++ application connects to the server but fails to authenticate, my guess (as Shadow mentioned in his comment) is that your C++ application was linked with libmysql (>= 8.0.34) but not with libmariadb (MariaDB Connector/C).

发布评论

评论列表(0)

  1. 暂无评论