I am building a django app and for which i need to configure mysql.I am trying to install mysqlclient module for sql connection and this is what i am trying
I'm having same issue, and I would like to contribute with my answer. I've just installed in my 2 servers running CentOS 7 with MariaDB (10.2.14-MariaDB MariaDB Server) .
$ cat /etc/centos-release
CentOS Linux release 7.4.1708 (Core)
$ mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is XXXX
Server version: 10.2.14-MariaDB MariaDB Server
I've installed MariaDB, this packages:
$ yum list installed | grep mariadb
MariaDB-client.x86_64 10.3.13-1.el7.centos @mariadb
MariaDB-common.x86_64 10.3.13-1.el7.centos @mariadb
MariaDB-compat.x86_64 10.3.13-1.el7.centos @mariadb
MariaDB-server.x86_64 10.3.13-1.el7.centos @mariadb
galera.x86_64 25.3.25-1.rhel7.el7.centos @mariadb
I found that the problem is that mysqlclient requires mysql-devel packages, which is different from mariadb-devel. Don't install mariadb-devel!
So, to install only mysql-devel, you need to:
$ sudo yum erase MariaDB-devel.x86_64
$ wget link-to-rpm-you-choose
$ sudo rpm -Uvh your-rpm-downloaded
$ sudo yum install mysql-community-devel.x86_64
$ sudo pip install mysqlclient
Collecting mysqlclient
Cache entry deserialization failed, entry ignored
Cache entry deserialization failed, entry ignored
Downloading https://files.pythonhosted.org/packages/f4/f1/3bb6f64ca7a429729413e6556b7ba5976df06019a5245a43d36032f1061e/mysqlclient-1.4.2.post1.tar.gz (85kB)
100% |████████████████████████████████| 92kB 758kB/s
Installing collected packages: mysqlclient
Running setup.py install for mysqlclient ... done
Successfully installed mysqlclient-1.4.2.post1
You are using pip version 8.1.2, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Oh, and mysqlclient is the connector recommended by Django. See: https://docs.djangoproject.com/en/2.1/ref/databases/#mysql-db-api-drivers
Good luck and see ya! :-)