caching_sha2_password не может быть загружен - PullRequest
0 голосов
/ 12 октября 2019

Я пытался подключиться к серверу mysql из кода C.

#include <mysql.h>
#include <stdio.h>
#include <stdlib.h>
main(){
    MYSQL *conn;
    MYSQL_RES *res;
    MYSQL_ROW row;

    char *server = "localhost";
    char *user = "root";
    char *password = "12345"; /* set me first */
    char *database = "mydatabase";

    conn = mysql_init(NULL);
    printf("done 1\n");
    if (!mysql_real_connect(conn, server,
         user, password, database, 3306, "/tmp/mysql.sock", 0)) {
      fprintf(stderr, "%s\n", mysql_error(conn));
      exit(1);
   }
    printf("done 2\n");
   if (mysql_query(conn, "show tables")) {
      fprintf(stderr, "%s\n", mysql_error(conn));
      exit(1);
   }
    printf("done 3\n");
   res = mysql_use_result(conn);
    printf("done 4\n");
    printf("MySQL Tables in mysql database:\n");
    while ((row = mysql_fetch_row(res)) != NULL)
    printf("%s \n", row[0]);
    printf("done 5\n");
    mysql_free_result(res);
    mysql_close(conn);
}

Но у меня есть странная проблема:

done 1
Plugin caching_sha2_password could not be loaded: /usr//usr/lib/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory

Я не знаю, почему он пытается загрузить libот / usr // usr /

Пожалуйста, помогите, если у вас уже есть сделка!

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...