I did the steps below with Python 3.5.1 and it works:

  • Download driver from here
  • Driver installation in cmd, in this folder Python\Python35\PyMySQL-0.7.4\pymysql

    python setup.py build
    python setup.py install
  • Copy folder Python\Python35\PyMySQL-0.7.4\pymysql to Python\Python35\pymysql

  • Sample code in python IDE

    import pymysql
    import pymysql.cursor
    conn= pymysql.connect(host='localhost',user='user',password='user',db='testdb',charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor)
    a=conn.cursor()
    sql='CREATE TABLE `users` (`id` int(11) NOT NULL AUTO_INCREMENT,`email` varchar(255) NOT NULL,`password` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'
    a.execute(sql)
  • Enjoy It!

python3.5 连接mysql的更多相关文章

  1. python3.4连接mysql数据库的方法

    python3.4连接mysql数据库的方法 发布时间:2014-08-04编辑:www.jbxue.com 本文介绍了python3.4连接mysql数据库的方法,在python3.4中不能用mys ...

  2. python3.6 连接mysql数据库问题

    最近有个项目欲安装MySQL-python/1.2.5一直失败. 环境: win7 python3.6.2 报错信息如下: Creating library build\temp.win32-3.6\ ...

  3. Python3.6连接mysql(一)

    初次学习python,因为python连接mysql的时候,需要安装mysql驱动模块 之前按照廖雪峰网站上的方法安装mysql驱动的方法: MySQL官方提供了mysql-connector-pyt ...

  4. python3.6 连接mysql数据库

    ==================pymysql=================== 由于 MySQLdb 模块还不支持 Python3.x,所以 Python3.x 如果想连接MySQL需要安装 ...

  5. Python3.5连接Mysql

    由于mysqldb目前仅支持到python3.4,所以这里选择pymysql. pymysql下载地址: https://pypi.python.org/packages/source/P/PyMyS ...

  6. python3 django连接mysql,同步表结构

    第一步:安装PyMySQ代替MySQLdb pip3 install PyMySQL 然后在工程目录的__init__.py中填写下面两句话   import pymysql pymysql.inst ...

  7. python3.4连接mysql

    参考:http://www.blogjava.net/huyi2006/articles/247966.html 开发环境:win7_x64 + python3.4.3 + mysql5.6.23 准 ...

  8. python3.6连接mysql或者mariadb

    python3.6版本的安装查看上一篇文章 mysql或mariadb数据库的安装查看以前的文章,这里不再赘述 首先在mariadb数据库中创建相应的库和表: MariaDB [(none)]> ...

  9. python2和python3 分别连接MySQL的代码

    python2中的写法如下: #coding=utf-8 import MySQLdb try: conn = MySQLdb.connect(host='localhost', port=3306, ...

  10. 如何使用Python3.4连接MySQL

    http://www.tuicool.com/articles/yqayEv import pymysql conn = pymysql.connect(host='localhost', port= ...

随机推荐

  1. suricate学习笔记1--初步认识(转)

    最近在研究关于dpi网卡采集的代码重组这块,公司一个同事,简单的用CPP讲解了suricata内部的一些处理逻辑,,,其中大部分代码是用C语言写的,对于用C重构代码有很好的借鉴作用,,,如果有相关工作 ...

  2. HDU 1896 Stones (优先队列)

    Stones Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Subm ...

  3. Converting REF CURSOR to PIPE for Performance in PHP OCI8 and PDO_OCI

    原文地址:https://blogs.oracle.com/opal/entry/converting_ref_cursor_to_pipe REF CURSORs are common in Ora ...

  4. Web压力架构

    原文地址:https://www.cnblogs.com/lori/archive/2015/03/27/4370827.html Web压力架构... 1 一 系统性能测试概述... 1 1.1 性 ...

  5. 新建MVC3 编译出现 System.Web.Mvc.ModelClientValidationRule

    我在vs2010 新建一个Mvc3项目,编译报一下错误: 错误 1 'c:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\A ...

  6. windows Server 2012安装GUI

    1.进入PowerShell 在命令行提示输入符处,直接输入: PowerShell 2.安装GUI 在命令行提示输入符处,直接输入: Install-WindowsFeature Server-Gu ...

  7. PNG怎么转换成32位的BMP保持透明

    32位BMP位图的格式是XRGB,就是X8位 R8位 G8位 B8位,当中的X8可以作为Alpha值用于透明, 只需要搜索一下PNG转32位BMP位图的软件就可以了,另外用PhotoShop下载插件打 ...

  8. 《TCP/IP详解卷1:协议》读书笔记

    <TCP/IP详解卷1:协议>读书笔记 - QingLiXueShi - 博客园https://www.cnblogs.com/mengwang024/p/4425834.html < ...

  9. adb 切换android输入法

    自动化测试执行时,使用了appium输入法,再手动使用时,需要进入设置里面进行切换.adb 也提供了一条命令使用命令切换 1.找出android里面有多少输入法:adb shell ime list ...

  10. pip安装包时遇到的Bug

    [背景] 今天打包人生中的第一个package到PyPi,在linux上执行pip3 install mysqltools-python安装一点问题都没有,打脸的是在自己的MAC上 居然安装不上 pi ...