Django
一、mysql安装配置
1、fedroa19 -- yum安装myusql;
mysql database(选择匹配的ferora版本):
mysql-community-server-5.6.19-1.fc19.x86_64,依赖包会自动安装;
自动安装的内容大致包括:
a、下载mysql包及其依赖包,并安装;
b、创建mysql用户和mysql组;
c、初始化mysql的DB,建立基本的表;
最终应该是安装下列5个相关包:
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、启动mysql:
service mysql restart;
3、通过yum安装的mysql服务默认未配置密码,首次连接后,需要更改密码;
update user set password=password("test") where user='root';
flush privileges;
4、创建相关DB --------- 语句不再赘述
5、安装python的连接器
python连接mysql时用,同时直接安装了其他语言连接器,方便学习使用;
MySQL-python-1.2.3-7.fc19.x86_64 ------------------------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验证:
import MySQLdb ----------django需要使用
import mysql ---- 一般调用