4

I upgraded to debian stretch from jessie.

My mysql database migrated and I can read it. I have a django project that relies on libmysqlclient.so.18 to access mysql.

i have mariadb-server and libmariadbclient18 packages installed.

what should i do to make sure django can access my database?

this is the error i get:

    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient.so.18: cannot open shared object file: No such file or directory

i tried ln -s /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18 to /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 which changes the error to the following:

    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18: version `libmysqlclient_18' not found (required by /usr/local/lib/python2.7/dist-packages/_mysql.so)
4

as a temporary fix, I installed the deb for libmysqlclient18 directly from here: https://launchpad.net/ubuntu/xenial/amd64/libmysqlclient18/5.6.25-0ubuntu1

a more official answer would be welcome.

| improve this answer | |
4

I fixed this error with ln -s /usr/lib/x86_64-linux-gnu/libmariadb.so.2 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18

The libmariadb.so.2 comes with the libmariadb2 package.

| improve this answer | |
  • For me it worked with ln -s /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 – jinowolski Aug 20 '19 at 14:11
1

I wanted to say thank you for creating this thread, it helped immensely. My issue was near identical and it occurred after a distribution upgrade to Debian Buster - I elected to upgrade all mariaDB packages from version 10.1 to 10.3 while opting to keep original config files.

Here is an alternate (hotfix) solution that worked for me:

ln -s libmariadb.so.3 /usr/lib/x86_64-linux-gnu/libmariadbclient.so.18

This solution is documented by mariaDB below: https://jira.mariadb.org/browse/MDEV-13934

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.