Build Django + MySQL (MariaDB) on CentOS 7.x)

Source: Internet
Author: User
Tags centos

I tried to use the CentOS 7.0 virtual machine on Alibaba Cloud, deployed the Django application, and used MySQL to record some problems, many of these problems may be caused by CenOS 7 (previously adapted to CentOS 6.x ).

1. MySQL is gone and replaced by MariaDB (of course, MySQL is still configured in Django and is fully compatible with MariaDB). Install the MariaDB command:

Yum install mariadb-server mariadb-devel

2. service configuration change: use systemctl instead of the previous service. Take MariaDB and Nginx as an example:

Systemctl start mariadb. service # start MariaDB
Systemctl is-active mariadb. service # Check the running status of MariaDB
Systemctl enable mariadb. service # configure it to start automatically upon startup
 
Systemctl reload nginx. service # reload the nginx configuration file

3. When installing MySQL-python (because Django uses this), you also encounter problems:

The pip install MySQL-python command reports the error "# error MUST be supported first !".
By: https://bazaar.launchpad.net /~ The solution provided by maria-captains/maria/5.5/revision/4355 is to modify the/usr/include/mysql/my_config_x86_64.h file.
Then re-install it. This is a compatibility issue.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.