Category Archives: Mysql

Python mysql

python统计MYSQL常用的一些性能参数指标

#!/usr/bin/env python
# -*- encoding: utf8 -*-
# Author: iamacnhero@gmail.cn
# Created: 2009-12-14

from __future__ import division
import MySQLdb, ra[......]

继续阅读

Posted in Mysql, Python 代码, Python 数据库 | Tagged , | Leave a comment  

在snow-leopard上安装mysqldb和lxml

这里假设已经按照前面的文章建设好了单独的Python环境,不过其实和在系统Python上加装模块也差不多。
系统的Python Setuptool(/usr/bin/easy_install)选择的默认Library路径是/Library/Python/2.6/site-packages。
自己建的[......]

继续阅读

Posted in Mysql, Python 数据库 | Tagged , , | Leave a comment  

python MySQLdb 字符串插入mysql前的转义

有时插入的字符串中可能包括引号或双引号,这时插入数据库就会出现错误。
这时可以使用MySQLdb的escape_string函数转义。
如:

from MySQLdb import escape_string
s = """ china’s future &quot[......]

继续阅读

Posted in Mysql, Python 数据库 | Tagged , | Leave a comment  

apache,python,django在linux下的安装

[转自:]http://jiangwb.blog.chinabyte.com/2010/07/14/153/
apache2-2-15
python-2.6.5
Django-1.2.1
1、apache安装
./configure –prefix=/home/apache2-2-15 –with-[......]

继续阅读

Posted in Django, Mysql, Python 数据库, Python 框架 | Leave a comment