#!/usr/bin/env python
# encoding: utf-8
#
import MySQLdb
import sys
import datetime
# 中文输出;
reload(sys)
sys.setdefaultencoding('utf8')
# 连接数据库;
try:
connS = MySQLdb.connect(
host='10.10.0.1',
port=3306,
user='root',
passwd='123456',
db='information_schema',
charset='utf8',
compress=1,
connect_timeout=1
)
except BaseException:
print "Could not connect to MySQL server."
exit(1)
# 查询结果为Json;
cursorS = connS.cursor(cursorclass=MySQLdb.cursors.DictCursor)
# 定义执行函数;
def CreateTableInfo(TableName):
sqlS = "select \
TABLE_SCHEMA, \
TABLE_NAME, \
TABLE_TYPE, \
ENGINE, \</