How to Access MySQL with Python Version 3.4
http://askubuntu.com/questions/630728/how-to-access-mysql-with-python-version-3-4

Python comes in two versions: Python 2.7.6 which has now been superseded by Python 3.4.0. The critical line in Python to access MySQL is "import MySQLdb" Thanks to a response from StackOverFlow, I realized that I was unintentionally accessing MySQL through Python version 2.7.6. Apparently, "MySQLdb" is not compatible with Python version 3.4.0. Searching the internet has disclosed alternatives for connecting Python to MySql, however, many of the suggestions do not disclose whether the offered solutions would actually work with Python version 3.4.0. This StackOverFlow Post listed some possible solutions. Python 3.4.0 with MySQL database. I installed mysqlclient 1.3.6, I also ran "sudo pip install PyMySQL" with out error. However, upon entering python with "python3"; I still received the error message "ImportError: No module named 'MySQLdb'" after typing in: "import MySQLdb". So something was still wrong. As an FYI MySQL evidently has its own connector, but I don't know whether it works or does not work with Python 3.4. Connecting to MySQL Using Connector/Python I will have to look into this more. Any advice on how to connect Python 3.4 with MySQL? |
||||
The documentation for MySQL Connector/Python says Version 2.0 should work with MySQL Server 5.5-5.7 and Python 3.3 and later. So I would say it's a good bet. If it doesn't work, follow up with what error you encounter and I'll see if I can help. |
|||||||||||||||||||||
|
How to Access MySQL with Python Version 3.4的更多相关文章
- linux查看是否安装Apache,mysql,python等
1.Apache httpd -v service httpd start 启动 service httpd restart 重新启动 service httpd stop 停止服务 2.mysql ...
- mysql及python交互
mysql在之前写过一次,那时是我刚刚进入博客,今天介绍一下mysql的python交互,当然前面会把mysql基本概述一下. 目录: 一.命令脚本(mysql) 1.基本命令 2.数据库操作命令 3 ...
- 安装 pywin32-218.win32-py2.7.exe 报错python version 2.7 required,which was not found in the registry解决方案
随便在一个盘下 新建register.py的文件,内容如下: # # script to register Python 2.0 or later for use with win32all ...
- 【转】安装第三方库出现 Python version 2.7 required, which was not found in the registry
安装第三方库出现 Python version 2.7 required, which was not found in the registry 建立一个文件 register.py 内容如下. 然 ...
- Python 安装Twisted 提示python version 2.7 required,which was not found in the registry
由于我安装Python64位的,下载后没注册,安装Twisted时老提示“python version 2.7 required,which was not found in the registry ...
- 在Ubuntu上安装Mysql For Python
安装: 首先安装pip,并且把pip更新到最小版本 apt-get install python-pip pip install -U pip 安装mysql开发包 apt-get install p ...
- 未能加载文件或程序集“MySql.Web.v20, Version=6.9.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d”或它的某一个依赖项。系统找不到指定的文件
未能加载文件或程序集“MySql.Web.v20, Version=6.9.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d”或它的某一个依赖 ...
- Snippet: Fetching results after calling stored procedures using MySQL Connector/Python
https://geert.vanderkelen.org/2014/results-after-procedure-call/ Problem Using MySQL Connector/Pytho ...
- 安装第三方库出现 Python version 2.7 required, which was not found in the registry
安装第三方库出现 Python version 2.7 required, which was not found in the registry 建立一个文件 register.py 内容如下. 然 ...
随机推荐
- 爱上MVC~在Views的多级文件夹~续~分部页的支持
回到目录 之前写的一篇文章,主要针对View视图,它可以放在N级目录下,不必须非要在views/controller/action这种关系了,而在程序运行过程中,发现分页视图对本功能并不支持,原因很简 ...
- atitit agt sys 设置下级代理功能设计.docx
atitit agt sys 设置下级代理功能设计.docx 显示界面1 先查询显示 set_sub.js1 设置代理2 /atiplat_cms/src/com/attilax/user/Agent ...
- Linux运维之道(大量经典案例、问题分析,运维案头书,红帽推荐)
Linux运维之道(大量经典案例.问题分析,运维案头书,红帽推荐) 丁明一 编 ISBN 978-7-121-21877-4 2014年1月出版 定价:69.00元 448页 16开 编辑推荐 1 ...
- iOS中的预编译指令的初步探究
目录 文件包含 #include #include_next #import 宏定义 #define #undef 条件编译 #if #else #endif #if define #ifdef #i ...
- PL/SQL Developer中文版下载以及使用图解(绿色版)
下载地址:http://pan.baidu.com/s/1eQCTmkM 1.运行plsqldev.exe程序: 2.设置Oracle主目录名/OCI库地址,如图: 重新启动程序. 3.配置登陆信息, ...
- 转载--How to Install VMware Tools on CentOS 6.3
源地址:http://www.ehowstuff.com/how-to-install-vmware-tools-on-centos-6-3/ VMware Tools is a group of u ...
- Sybase 数据库新增用户,赋权
Sybase数据库, 需求:新增用户user1,赋予对原数据库中表t_jingyu的查询权限 数据库原用户登陆 isql -U用户 -P密码 -S服务名 sp_addlogin 'user1','us ...
- Linux - 终端语言设置
查看当前终端用户的语言设置 locale - get locale-specific information : locale |grep LANG 改变当前终端用户的语言设置(临时生效) 中文UTF ...
- 对于placeholder浏览器兼容性(包括密码输入框)解决办法
将以下脚本和样式引入你的页面(对于密码输入框,要设置ID属性值): <script type="text/javascript"> $(function () { // ...
- 材价看板(1)- 如何建立你的第一个kanban,看看这些暴露的问题你们有没有?
今年负责一个老产品新团队,和几年前的指标组一样,现在的团队没有采用什么研发方法,于是我开始了团队的看板之旅. 12月22日给材价整个部门的产品研发相关人员做了一次kanban工作坊培训, 以及敏 ...