iceCode代码高亮

python:

//连接
db1 = MySQLdb.connect(host=dbhost, user=dbuser, passwd=dbpass, db=dbname, port=dbport)
db2 = MySQLdb.connect(host=slavehost, user=slaveuser, passwd=slavepass, db=slavedb, port=dbport)
//获取cursor对象
cursor = db1.cursor()
cursor_build = db2.cursor()
//操作数据库
cursor.execute(sql1)
cursor_build.execute(sql2)
//结果
db1操作成功,db2操作无响应
mysql:

/**
 +------------------------------------------------------------------------------------+
 + 需要安装的sql文件
 +------------------------------------------------------------------------------------+
 + 作者:ice
 + 官方:www.iceui.net
 + 时间:2018-04-25
 +------------------------------------------------------------------------------------+
 */

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for ice_album
-- ----------------------------

DROP TABLE IF EXISTS `ice_album`;
CREATE TABLE `ice_album`  (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '产品相册ID',
  `cid` int(11) NOT NULL COMMENT '产品id',
  `url` char(42) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '图片地址',
  `orders` tinyint(2) NOT NULL DEFAULT 0 COMMENT '排序',
  `cover` tinyint(1) NOT NULL DEFAULT 0 COMMENT '缩略图',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Fixed;

-- ----------------------------
-- Table structure for ice_article
-- ----------------------------

DROP TABLE IF EXISTS `ice_article`;
CREATE TABLE `ice_article`  (
  `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '页面ID',
  `cid` int(6) UNSIGNED NOT NULL DEFAULT 5 COMMENT '分类ID',
  `uid` int(9) NOT NULL COMMENT '作者ID',
  `top` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '置顶',
  `rec` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '推荐',
  `hot` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 COMMENT '热门',
  `album` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '相册',
  `thumb` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '缩略图',
  `title` char(80) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '标题',
  `intro` char(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '描述',
  `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容',
  `views` int(11) NOT NULL DEFAULT 0 COMMENT '浏览量',
  `comments` int(11) NOT NULL DEFAULT 0 COMMENT '评论数量',
  `keywords` char(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '关键字SEO',
  `description` char(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '描述SEO',
  `time` int(10) UNSIGNED NOT NULL COMMENT '创建时间',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; 

« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。