## 安装 Mariadb
```
yum -y install mariadb mariadb-server
```
## 安装 MySQLdb 模块
```
yum -y install MySQL-python
```
## 基础 CRUD
```
#!/usr/bin/env python
#-*-coding:utf-8-*-
import MySQLdb
# 连接数据库
db = MySQLdb.connect("localhost", "root", "root", charset='utf8' )
# 获取操作游标
cursor = db.cursor()
# 目标数据库存在则将其删除
cursor.execute("DROP DATABASE IF EXISTS py_con")
# 创建新数据库
cursor.execute("CREATE DATABASE py_con;")
# 连接数据库
cursor.execute("use py_con;")
# 创建数据表
sql_ctb="""CREATE TABLE stu_info(
FIRST_NAME CHAR(20) NOT NULL,
LAST_NAME CHAR(20),
AGE INT,
SEX CHAR(1))"""
cursor.execute(sql_ctb)
# 插入语句
sql_ins = """INSERT INTO stu_info(FIRST_NAME,
LAST_NAME, AGE, SEX)
VALUES ('Moli', 'Sam', 20, 'M')"""
cursor.execute(sql_ins)
# 关闭连接
db.close()
```
via:[python操作mysql数据库](http://www.runoob.com/python/python-mysql.html)
- Linux Server
- 实用命令
- services
- Samba
- /etc/samba/smb.conf
- NFS
- Http
- httpd.conf
- lamp
- FTP
- /etc/vsftpd/vsftpd.conf
- ftp实例
- iSCSI
- SElinux
- DNS
- master
- slave
- subdomain
- 相关配置文件
- /etc/hosts
- /etc/resolv.conf
- /etc/named.conf
- /var/named/named.ca
- /var/named/named.localhost&named.loopback
- DHCP
- /etc/dhcp/dhcpd.conf
- mysql
- Redis
- Git
- HAProxy
- haproxy
- openssl
- nodejs