sqlite3.OperationalError: unable to open database file
来源:互联网 发布:数据精灵后台授权 编辑:程序博客网 时间:2024/04/29 01:25
# -*- coding:utf-8 -*- '''Created on 2016年1月12日@author: Lux'''import sqlite3chromeHistoryDbPath = 'C:\Users\Lux\Desktop\History'class GetDbContent(): def __init__(self,path): self.dbpath = path def ReadTable(self): con = sqlite3.connect(self.dbpath) cur = con.cursor() tableList = cur.execute("select name from sqlite_master where type = 'table' order by name").fetchall() for table in tableList: print table[0] cur.close()if __name__ == '__main__': a = GetDbContent(chromeHistoryDbPath) a.ReadTable()
使用python连接sqlite数据库的文件的时候,不小心出现了错误
sqlite3.OperationalError: unable to open database file
百度了一下,错误有许多种,这里稍微列举一些
- 数据库路径最好写成绝对路径,并且目录要存在,而且 对目录要有读写的权限, 因为打开数据库的时候,会产生临时数据;
- 在Win 7 enterprise 和 Win Xp Pro上面写python v2.7时,
'C:\Users\Lux\Desktop\History'
路径 有时候要写成'C:\\Users\\Lux\\Desktop\\History'
; - 有种情况我也是无法解释的,某些时候你的数据库文件后缀名不是
db
也不行,需要改名为xxx.db
; - 对数据库文件要有读写的权限;
0 0
- sqlite3.OperationalError: unable to open database file
- sqlite3.OperationalError: unable to open database file 解决办法
- bitbake错误:sqlite3.OperationalError: unable to open database file
- Flask sqlite3.OperationalError: unable to open database file解决方法
- [Django1.5] sqlite3.OperationalError: unable to open database file错误
- sqlite3.OperationalError: unable to open database file 解决办法
- [windows] flask - sqlite3.OperationalError: unable to open database file
- sqlite3: unable to open database file
- PHP Warning: SQLite3::query(): unable to open database file in
- 记sqlite3遇到的unable to open database file
- 手把手教你:Ubuntu+django+apache下配置网页错误OperationalError: Unable to Open Database File 的解决方法
- 【解决】unable to open database file
- SQLiteCantOpenDatabaseException: unable to open database file
- android.database.sqlite.SQLiteException: unable to open database file
- Error: unable to open database "BookStore.db": unable to open database file
- 解决sqllite的'unable to open database file'错误
- SQLiteCantOpenDatabaseException: unable to open database file (code 14)
- asp.net sqlite unable to open database file的解决方案
- 如何一次退出多个Activity
- 获取当前系统时间作为文件名
- 两个链表的交叉——值得注意的错误
- Heritrix3.3.0源码阅读 允许重复下载
- Redis源码分析二、Redis简单动态字符串
- sqlite3.OperationalError: unable to open database file
- 使用FMS 4.5(Flash Media Server 4.5) 搭建视频直播(HLS)
- 各类demo链接
- PostgreSQL学习手册(函数和操作符<三>)
- Spring事务配置的五种方式
- Java集合:树
- Spark API 详解/大白话解释 之 map、mapPartitions、mapValues、mapWith、flatMap、flatMapWith、flatMapValues
- jenkins安装插件后,页面找不到效果
- MYSQLDB