`

compile mysqldb 1.2.3 for mysql 5.5 on windows

阅读更多

unlike postgres where tons of third party drivers are waiting for being chosen, for mysql, there are only a few choices and mysqldb is the best at the moment (yep, there are many pure python drivers for mysql, unfortunately, there are all in beta status).



mysql-python doesn't have an offical binary for python 2.6 & mysql 5.5 so i have to build one for myself.


1: get a copy of mysql-python and uncompress it.


2: open setup_windows.py and commet two sentences:


#serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
    #mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')


now assign a new value for mysql_root...


here my root is mysql_root = r"D:\MySQL\MySQL Server 5.5"


3: find out library_dirs = [ os.path.join(mysql_root, r'lib\opt') ] and change it to


library_dirs = [ os.path.join(mysql_root, r'lib') ]


after step two and three, save setup_windows.py


4: open _mysql.c comment  find the following part:


#if defined(MS_WINDOWS)
#include <winsock2.h>
#include <windows.h>
#include <config-win.h>
#else
#include "my_config.h"
#endif


wipe #include <config-win.h> and #else out. use #include "my_config.h" directly, like:

#if defined(MS_WINDOWS)
#include <winsock2.h>
#include <windows.h>

#endif

#include "my_config.h"


save _mysql.c


5: python setup.py install... after that we may run some tests...all tests are passed on my machine...


tested envrionment:


windows 7 64 bit...


vs2008, python 2.6.6

 

Note: occasionally, when doing python setup.py install we may see generate _mysql.pyd.manifest error,  use

python setup.py clean, python setup.py bdist instead.



分享到:
评论

相关推荐

    dbforge studio for mysql 7.2.63带补丁

    对于某些存储过程很多且复杂的SQL的应用,在短时间内要使得所有MySQL存储过程和函数正常运行,那么如果能找到一个比较好的调试工具,就可以事半功倍, 这里介绍的是dbForge Studio for MySQL。 1. 首先说明dbForge ...

    Compile-ARM-MySQL.zip_qt mysql arm

    **文件"Compile ARM MySQL.docx"**: 这个文档很可能详细介绍了上述步骤,包括可能遇到的问题、解决方法以及特定于某些ARM开发板的注意事项。它可能还包含了配置脚本示例、编译选项以及移植过程中的一些最佳实践。 ...

    CCS5.5 C2000v15.12 compile ti_cgt_c2000_15.12.7.LTS_windows_installer

    CCS5.5导入工程时出现See details below. Error: Import failed for project 'can_external_transmit_cpu01' because its compiler definition is not available. Please install the C2000v15.12 compiler before ...

    cross_compile.rar_ffplay_ffplay for windows_ffplay windows

    在本教程中,我们将详细探讨如何在Windows环境下编译ffplay,以便在该平台上使用这个功能丰富的播放器。 首先,我们需要了解交叉编译的概念。交叉编译是指在一个平台上生成可在另一个平台上运行的代码。由于ffplay...

    compile DCMTK for Windows with CMake

    OpenSSL support: set "DCMTK_WITH_OPENSSL" to "ON" and "WITH_OPENSSLINC" as well as "WITH_OPENSSLLIB" to the respective paths for OpenSSL include files and libraries. TIFF support: set "DCMTK_WITH_...

    Compile ARPACK to x64dll_lib on Windows 7 for VS2005 by Using MinGW64

    根据提供的文件信息,我们可以了解到关于在Windows 7系统下使用MinGW64和MSYS工具将ARPACK库编译成适用于Microsoft Visual Studio 2005 x64平台的dll和lib文件的详细过程。以下详细说明标题和描述中提到的知识点: ...

    mysql与java连接的适配包(mysql-connector-java-5.1.47)

    MySQL是世界上最受欢迎的关系型数据库管理系统之一,而Java作为一种广泛应用的编程语言,经常被用来与MySQL进行数据交互。在Java中,我们使用Java Database Connectivity (JDBC) API来连接和操作数据库。MySQL与Java...

    PURE-FTPD for WINDOWS 源码

    Before all : Pure-FTPd was designed on Unix and for Unix. The Windows port has been done because some people are forced to work on Win32 by their pointy hairy boss. For these people, Apache is a...

    Online-Compile

    Online_Compile

    How to compile SQLCipher on Windows.mp4

    (跑通sqlcipher-4.4.0)https://www.youtube.com/watch?v=SFHGeetZ0po

    mysql-connector-java-5.1.25, mysql 5.7.31亲测有效

    MySQL是世界上最受欢迎的关系型数据库管理系统之一,而MySQL Connector/J则是MySQL与Java应用程序之间的桥梁,它是一个JDBC(Java Database Connectivity)驱动程序,使得Java开发者能够方便地在Java应用中访问和...

    fastReport连接mysql插件

    标题中的“fastReport连接mysql插件”指的是FastReport这一报表工具与MySQL数据库之间的连接解决方案。FastReport是一款功能强大的报表设计和生成工具,广泛应用于.NET框架下的C#等编程语言。而MySQL则是一种流行的...

    zlib-1.2.3.rar

    zlib-1.2.3 绝对好用 zlib-1.2.3 ..........\adler32.c ..........\algorithm.txt ..........\amiga ..........\.....\Makefile.pup ..........\.....\Makefile.sas ..........\as400 ..........\.....\...

    mysql-connector-java-5.1.46下载

    compile 'mysql:mysql-connector-java:5.1.46' } ``` 然后,开发者可以使用 JDBC API 创建数据库连接、执行 SQL 语句、处理结果集等。例如: ```java import java.sql.*; public class MySQLJDBCExample { public...

    compile_compile

    compile

    Eric6 & PyQT5.5 &Python 3.4安装

    本篇将重点介绍如何在Python 3.4环境下安装和配置Eric6集成开发环境(IDE)以及PyQT5.5库。 首先,确保你已经正确地下载了对应版本的Python、PyQT5和Eric6。对于Python,这里推荐的是3.4.4版本,可以从官方网址下载...

    Webservice接口,Cxf写的客户端

    Webservice接口,Cxf写的客户端, 是java项目,直接main方法运行. 开发环境:32位jdk1.7+Cxf3.1.4+tomcat7, 开发工具:myeclipse8.5. 成功访问服务端,并传送参数。测试通过。

    iperf3 static compile for arm-linux

    "iperf3 static compile for arm-linux"这个标题表明我们将讨论如何在基于ARM架构的Linux系统上对iperf3进行静态编译。 静态编译是将所有依赖的库文件都编译进可执行文件中,使得最终生成的程序不依赖系统环境,...

    vlc compile for android

    This page is an introduction to the compilation of VLC for Android on Linux

Global site tag (gtag.js) - Google Analytics