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 内容如下. 然 ...
随机推荐
- Java中MVC详解以及优缺点总结
概念: MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业务数据.逻辑.界面显示分离的 ...
- HTML学习入门
HTML(元素.属性) HTML: 超文本标记语言 1. 超文本即为带有链接属性的文本 2.标记即为标签 一.body属性: bgcolor:页面背景颜色 text:文字颜色 backgroun ...
- MSP是什么?
本人在项目管理圈儿也算是摸爬滚打了几载,近几年真是各种压力大,看同行们各种参加培训.认证......我也不能懈怠啊,赶紧上网搜搜相关的培训和认证信息,不搜不知道一搜吓一跳.原本只知道PMP和PRINC ...
- CentOS6.5下安装JDK
之前一直没有完全的总结出一篇关于Linux下安装Java的过程,今天正好就整理下. 下载jdk 如果在官网下载比较慢,那么可以到我的云盘分享上,下载jdk 1.8.0的版本: 下载地址参考链接 解压缩 ...
- 我所了解的chrome
Chrome的隐身模式 先来说说隐身模式的启用方法吧 1.键盘快捷:Ctrl + Shift + N. 2.在Windows7下的任务栏处,右击“Chrome”图标,会出一个下拉菜单,点击“新建隐身窗 ...
- redis常用操作总结
在项目中时常会用到redis,redis看起来好像很难的样子,而且我也确认反复学习了很久,但是,总结下来,自己使用到的东西并不太多,如下作一些总结工作. 1.安装(单机) 1.1 windows, 直 ...
- Java 集合 — HashMap
HashMap 无序(每次resize的时候都会变) 非线程安全 key和value都看可以为null 使用数组和链表实现 查找元素的时候速度快 几个重要属性: loadFactor:用来计算thre ...
- HTML学习目录
前面的话 HTML被认为是前端知识体系里面最简单的知识,几年前,很多人都推荐在W3C上学习个几天就能够基本掌握.但随着HTML5和移动端的强势发展,HTML的技能点也越来越难.世上无难事,好学好总结. ...
- CSS弹性盒模型flex在布局中的应用
× 目录 [1]元素居中 [2]两端对齐 [3]底端对齐[4]输入框按钮[5]等分布局[6]自适应布局[7]悬挂布局[8]全屏布局 前面的话 前面已经详细介绍过flex弹性盒模型的基本语法和兼容写法, ...
- js实现图片加载特效(从左到右,百叶窗,从中间到两边)
/* 网上百度的,感觉”从中间到两边“的效果写的不是很好,改了一下,感觉可以了!*/<html> <head> <title></title> < ...
