Comments - Could you suggest a connector which can work for Django and mariaDB?

7 years, 10 months ago Bryan Alsdorf

Internally we are using mysql-python but any of the three should work.

Have you added our repositories to your system? With those added I was able to install libmariadbclient-dev with no problem.

sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
sudo add-apt-repository 'deb [arch=amd64,i386] http://mirror.jmu.edu/pub/mariadb/repo/10.0/ubuntu wily main'

sudo apt-get update
sudo apt-get install libmariadbclient-dev

sudo apt-get install python-pip build-essential python-dev libssl-dev

# you only need to install one of these, not both. However they both worked for me
sudo pip install MySQL-python 
sudo pip install mysqlclient

Unfortunately I am not running on python 3 or Django 1.9 so I can't confirm that microseconds work with those but according to the documentation they do. If they do not, please provide the exact error you are getting and I will try to help.

 
7 years, 10 months ago CP Wen

I removed mariadb-server first. Then I followed your steps. It works. Yes.

I followed the installation in your web site before. Could you tell me that why it doesn't have "sudo apt-get install mariadb-server" in your steps? Your web site has the installation step.

And I had removed the mariadb-server. I wonder why it can still work?

 
7 years, 10 months ago Bryan Alsdorf

My steps didn't have mariadb-server as my test environment was connecting to an instance of MariaDB on another machine.

If you are running MariaDB on the same machine you will need to install mariadb-server, otherwise you do not need it.

 
7 years, 10 months ago CP Wen

I have some summaries for the question.

1. Re-install MariaDB to solve the problem that can't install the package "libmariadbclient-dev". "libmariadbclient-dev" is prerequisite for mysqlclient package. 2. PyMySQL can work well in the "fractional seconds" function with MySQL, not MariaDB. 3. I use mysqlclient in place of PyMySQL. Because mysqlclient can work well with MariaDB, and I think it is easier to use.

Thanks a lot for all your help, Bryan.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.