Python连接单机版数据库(Postgresql数据库)并实现数据提取
2017-08-18 16:00
459 查看
import pandas as pd
import psycopg2
conn=psycopg2.connect(database="****", user="postgres", password="***", port="5432")
with conn:
cur=conn.cursor()
cur.execute("select * from public.20160407_1")
rows = cur.fetchall()
t=pd.DataFrame(rows)
import psycopg2
conn=psycopg2.connect(database="****", user="postgres", password="***", port="5432")
with conn:
cur=conn.cursor()
cur.execute("select * from public.20160407_1")
rows = cur.fetchall()
t=pd.DataFrame(rows)
相关文章推荐
- Python实现连接postgresql数据库的方法分析
- Python数据库的连接实现方法与注意事项
- Python实现的连接mssql数据库操作示例
- Python连接PostgreSQL数据库的方法
- 【转】PostgreSQL 数据库C语言代码实现【数据库连接,创建表, 以及增删改查】
- python实现简单数据库连接及操作
- PHP实现基于PDO扩展连接PostgreSQL对象关系数据库示例
- Python数据库的连接实现方法与注意事项
- python语言实现postgresql数据库自动备份
- Python连接PostgreSQL数据库
- python实现简易数据库之三——join多表连接和group by分组
- Python3.6中安装psycopg2实现对PostgreSQL数据库的操作
- python利用MySQLdb模块进行数据库的连接实现增查操作
- python访问PostgreSQL数据库之连接库Psycopg2
- 使用Python连接postgresql数据库
- python访问PostgreSQL数据库之连接库Psycopg2
- python连接postgresql数据库
- Python连接PostgreSQL数据库的方法
- Python 数据库连接(sqlite, mysql, oracle, postgresql, sql server)
- 用python连接数据库,实现用户注册和用户登录