I've compiled and installed Python 3.10.9 (from .tar) and mariadb-c-connector (from official Github repo) on my Debian 11 (bullseye) machine. I also installed: ufw, fail2ban, mariadb-server, mariadb-client.
Now if i install mariadb in my Python pipenv and run i got the error: mariadb.OperationalError: This feature is not implemented or disabled
.
On my Manjaro it works fine. This is how i create a connection to the database.
def connect(self):
if self.conn:
return
# Connect to MariaDB Platform
try:
self.conn = mariadb.connect(
user=self.user,
password=self.password,
host=self.host,
port=self.port,
database=self.database,
reconnect=True,
)
except mariadb.Error as e:
log.exception(f"Error connecting to MariaDB Platform: {e}")
self.conn = None
return
What i do wrong or what is missing?
Thank you in advance.
Edit:
Output of mariadb_config --cc_version --libs
3.3.4
-L/usr/lib/mariadb/ -lmariadb
Output of ldd /home/USER/.local/share/virtualenvs/PROJEKT/lib/python3.10/site-packages/mariadb/_mariadb.cpython-310-x86_64-linux-gnu.so
linux-vdso.so.1 (0x00007fffa2eec000)
libmariadb.so.3 => /lib/x86_64-linux-gnu/libmariadb.so.3 (0x00007f6911918000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6911743000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f691173d000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f691171b000)
libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f6911688000)
libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f6911394000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6911375000)
/lib64/ld-linux-x86-64.so.2 (0x00007f6911988000)
This is the check in source code:
It fails, since mysql_optionsv doesn't support the option
MARIADB_OPT_STATUS_CALLBACK
and returns errorCR_NOT_IMPLEMENTED
.Update (after more details were added to the original question):
So it looks like you built (installed) the mariadb module with the correct required Connector/C version (> 3.3.1) , however there is an older Connector/C version in your default library path
libmariadb.so.3 => /lib/x86_64-linux-gnu/libmariadb.so.3
(which was likely installed with package libmariadb-dev)