Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importerror: libmariadbclient.so.18: cannot open shared object file: No such file or directory

I get this error message, when I want to run my python script on Debian 9.1. I am using MariaDB 10.1.

What is the problem here? How can I fix it?

My relevant sql code is here :

connection = MySQLdb.connect(host='localhost',
    user='root',
    passwd='1234',
    db='database')
cursor = connection.cursor()
query = """ load data local infile 'MYOUTPUTLOCATION' 
into table DEPARTURES
character set latin1
fields terminated by ';'
enclosed by '"'
lines terminated by '\r\n'
ignore 1 lines;
"""
cursor.execute(query)
connection.commit()
cursor.close()
like image 875
Mr.D Avatar asked Nov 18 '22 10:11

Mr.D


1 Answers

As mentioned in the comments, The python client requires the native libraries. Resolve it by installing libmariadbclient18 on Debian 9.*.

On Debian 10 (Buster), the package is still available only as libmariadbclient-dev.

like image 191
jeffry copps Avatar answered Dec 06 '22 09:12

jeffry copps