1 mysql补充 cur = conn.cursor(cursor=pymysql.cursors.DictCursor) #直接获取的数据转换为字典格式的 cur.description #直接获取的描述信息 fileds = [filed[0] for filed in cur.descrip ...
分类:
数据库 时间:
2018-07-21 22:52:35
阅读次数:
334
helper.py import pymysql from settings import Config def connect(): conn = Config.POOL.connection() cursor = conn.cursor(cursor=pymysql.cursors.DictCu ...
分类:
数据库 时间:
2018-06-19 21:34:32
阅读次数:
244
1、操作mysql 知识点1: cur = coon.cursor(cursor=pymysql.cursors.DictCursor) 建立游标的时候指定了游标类型,返回的就是一个字典了。 fetchall() #获取到这个sql执行的全部结果,它把数据库表里面的每一行数据放到一个list里面 [ ...
分类:
数据库 时间:
2018-05-12 02:59:50
阅读次数:
431
mysql中游标的使用案例详解(学习笔记)这篇讲得相当直白好懂了。 索引: cursor 基础讲解 cursor 有点类似于 JDBC 中的 ResultSet ,允许我们在执行 SELECT 之后,一行一行地 FETCH 数据。 它只能被用在存储过程中!如果把存储过程比作函数,cursor 只能在 ...
分类:
数据库 时间:
2018-04-23 16:34:40
阅读次数:
188
MySQL 4.1/5.0/5.1/5.5/5.6各版本的主要区别 一、5.0 增加了Stored procedures、Views、Cursors、Triggers、XA transactions的支持,增加了INFORATION_SCHEMA系统数据库。 二、5.1 增加了Event sched ...
分类:
数据库 时间:
2017-11-15 23:46:32
阅读次数:
242
报错信息:"File"/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 151, inexecute query = query % db.literal(args)TypeError: %d format: a number is req ...
分类:
数据库 时间:
2017-10-27 18:05:07
阅读次数:
639
ElementUI的表格要求的数据类型为字典数组。我使用了python3写后端,那么从数据库取数据时添加一行cursorclass=pymysql.cursors.DictCursor即可。取出后我将其存入redis数据库方便之后取用。取用时使用eval()函数再传到前端即可。 前端放置Pagina ...
分类:
其他好文 时间:
2017-10-22 00:33:41
阅读次数:
178
#coding=utf-8 import csv import pymysql.cursors #建立数据库连接,注意中文编码方式utf8 conn=pymysql.connect( host='localhost', port=13306, user='root', password='root'... ...
分类:
数据库 时间:
2017-10-11 19:09:31
阅读次数:
154
[20170904]11Gr2 查询光标为什么不共享脚本.txt--//参考链接下面的注解脚本:https://carlos-sierra.net/2017/09/01/poors-man-script-to-summarize-reasons-why-cursors-are-not-shared/ ...
分类:
其他好文 时间:
2017-09-04 10:52:20
阅读次数:
180
今天測试环境下应用慢。发现数据库出了问题,直接上AWR报告。因为是虚拟机。所以不用贴cpu的个数,能够发现负载高。 Snap Id Snap Time Sessions Cursors/Session Begin Snap: 15257 30-Jun-15 09:30:57 558 5.3 End ...
分类:
其他好文 时间:
2017-08-20 18:28:07
阅读次数:
442