django学习笔记--环境配置--mysql配置
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 ---- 一般调用

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses using MySQL's ALTER TABLE statement to modify tables, including adding/dropping columns, renaming tables/columns, and changing column data types.

Article discusses configuring SSL/TLS encryption for MySQL, including certificate generation and verification. Main issue is using self-signed certificates' security implications.[Character count: 159]

Article discusses strategies for handling large datasets in MySQL, including partitioning, sharding, indexing, and query optimization.

Article discusses popular MySQL GUI tools like MySQL Workbench and phpMyAdmin, comparing their features and suitability for beginners and advanced users.[159 characters]

The article discusses dropping tables in MySQL using the DROP TABLE statement, emphasizing precautions and risks. It highlights that the action is irreversible without backups, detailing recovery methods and potential production environment hazards.

Article discusses using foreign keys to represent relationships in databases, focusing on best practices, data integrity, and common pitfalls to avoid.

The article discusses creating indexes on JSON columns in various databases like PostgreSQL, MySQL, and MongoDB to enhance query performance. It explains the syntax and benefits of indexing specific JSON paths, and lists supported database systems.

Article discusses securing MySQL against SQL injection and brute-force attacks using prepared statements, input validation, and strong password policies.(159 characters)
