Django learning notes -- environment configuration -- mysql configuration Django
1. install and configure mysql
1. fedroa19 -- Install myusql using yum;
Mysql database (select the matching ferora version ):
Mysql-community-server-5.6.19-1.fc19.x86_64, dependency packages are automatically installed;
Automatic installation includes:
A. download and install the mysql package and its dependent packages;
B. create a mysql user and a mysql group;
C. initialize mysql databases and create basic tables;
In the end, install the following five related packages:
Mysql-community-libs-5.6.19-1.fc19.x86_64
Mysql-community-server-5.6.19-1.fc19.x86_64
Mysql-community-release-fc19-5.noarch
Mysql-community-client-5.6.19-1.fc19.x86_64
Mysql-community-common-5.6.19-1.fc19.x86_64
2. start mysql:
Service mysql restart;
3. by default, no password is configured for the mysql service installed through yum. after the first connection, you need to change the password;
Update user set password = password ("test") where user = 'root ';
Flush privileges;
4. create the relevant database --------- statement.
5. install python connector
Python is used to connect to mysql, and other language connectors are directly installed to facilitate learning and use;
MySQL-python-1.2.3-7.fc19.x86_64 ------------------------ Special connection library for django, import MySQLdb
Mysql-connector-java-5.1.28-1.fc19.noarch
Mysql-community-libs-5.6.19-1.fc19.x86_64
Mysql-connector-python-1.2.2-1.fc19.noarch
Mysql-community-server-5.6.19-1.fc19.x86_64
Mysql-community-release-fc19-5.noarch
Mysql-connector-c ++-1.1.2-1. fc19.x86 _ 64
Mysql-connector-odbc-5.3.2-1.fc19.x86_64
Mysql-community-client-5.6.19-1.fc19.x86_64
Mysql-community-common-5.6.19-1.fc19.x86_64
Python verification:
Import MySQLdb ---------- django needs to use
Import mysql ---- general call