[CONC-376] missing prefix for searching mysql_clear_password.so Created: 2018-11-27  Updated: 2019-09-17

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.4, 3.0.5
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Laszlo Soos Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

docker with alpine 3.8


Issue Links:
Relates
relates to CONC-383 Plugin auth_gssapi_client could not ... Closed
relates to MDEV-19807 MariaDB client plugin path is wrong Closed
relates to MDEV-20569 Plugin dialog could not be loaded (wr... Closed

 Description   

hi developers,

I was sent here from https://github.com/PyMySQL/mysqlclient-python/issues/289

When try to connect to a db with shared plugins like mysql_clear_password.so I get
_mysql_exceptions.OperationalError: (2006, 'Plugin mysql_clear_password could not be loaded: Error loading shared library lib/mariadb/plugin/mysql_clear_password.so: No such file or directory')

My believe is that somehow the prefix (/usr/) is missing from the path, thought I don't know how to debug it further.

STEPS TO REPRODUCE:

docker run -it python:alpine3.8 /bin/sh
apk update
apk add alpine-sdk mariadb-connector-c mariadb-connector-c-dev
pip install mysqlclient

vi /x
------ PASTE THE BELOW ----
#!/usr/bin/env python

import _mysql

db=_mysql.connect(db="mydb", host="remote.example.com", user="user", passwd="password")

------END PASTE ----
chmod 755 /x
/x

If all goes well you get empty output. If it fails (like for me) you get:

Traceback (most recent call last):
File "./x", line 5, in <module>
db=_mysql.connect(db="mydb", host="remote.example.com", user="user", passwd="password") _mysql_exceptions.OperationalError: (2059, 'Plugin mysql_clear_password could not be loaded: Error loading shared library lib/mariadb/plugin/mysql_clear_password.so: No such file or directory')

As it seems from the error message it tries to load from lib/mariadb/plugin/mysql_clear_password.so
This looked a relative path for me so the interesting finding is that if you cd to /usr before run the script it works.

cd /usr
@a63e69f065a7:/usr$ /x
@a63e69f065a7:/usr$

(empty output means it's ok)

Do you have any idea what could set the path wrong and how to fix it?

Thanks for the help in advance


Generated at Thu Feb 08 03:04:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.