`
Billy_Ao
  • 浏览: 12750 次
  • 性别: Icon_minigender_1
最近访客 更多访客>>
社区版块
存档分类
最新评论

Install Mysql-Python on Windows

阅读更多
收入两个安装关于安装MySQLdb的URL

http://stackoverflow.com/questions/645943/mysql-for-python-in-windows

As Python newbie learning the Python ecosystem I've just completed this.

Install setuptools instructions

Install MySQL 5.1. Download the 97.6MB MSI from here You can't use the essentials version because it doesnt contain the C libraries.
Be sure to select a custom install, and mark the development tools / libraries for installation as that is not done by default. This is needed to get the C header files.
You can verify you have done this correctly by looking in your install directory for a folder named "include". E.G C:\Program Files\MySQL\MySQL Server 5.1\include. It should have a whole bunch of .h files.

Install Microsoft Visual Studio C++ Express 2008 from here This is needed to get a C compiler.

Open up a command line as administrator (right click on the Cmd shortcut and then "run as administrator". Be sure to open a fresh window after you have installed those things or your path won't be updated and the install will still fail.

From the command prompt:

easy_install -b C:\temp\sometempdir mysql-python

That will fail - which is OK.

Now open site.cfg in your temp directory C:\temp\sometempdir and edit the "registry_key" setting to:

registry_key = SOFTWARE\MySQL AB\MySQL Server 5.1

now CD into your temp dir and:

python setup.py clean

python setup.py install

You should be ready to rock!

Here is a super simple script to start off learning the Python DB API for you - if you need it.

http://hi.baidu.com/koflance/blog/item/78ae37f90f66c615a9d311f3.html

Now try to build it again. I got this :

error: build\temp.win32-2.6\Release\_mysql.pyd.manifest : general error c1010070: Failed to load and parse the manifest.

The system cannot find the file specified. error: command ‘mt.exe’ failed with exit status 31 To fix this problem, go to C:\Python26\Lib\distutils, edit msvc9compiler.py, search for ‘MANIFESTFILE’, you will find the following line ld_args.append(’/MANIFESTFILE:’ + temp_manifest) Then append the following line after the above line, ld_args.append(’/MANIFEST’) Then go back to run “setup.py build”, it will succeed.

Finally, run setup.py install Test it in python >>> import MySQLdb >>>
分享到:
评论

相关推荐

    MySQL-python-1.2.5-cp27-none-win32.whl

    python MySQL-python模块 django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb. Did you install mysqlclient or MySQL-python?

    Python链接MySQL驱动包 mysqlclient-python-1.3.12.rar

    On Windows, there are binary wheel you can install without MySQLConnector/C or MSVC. #### Note on Python 3 : if you are using python3 then you need to install python3-dev using the following command...

    python2.7.5 安装python-mysqldb出错问题my_config.h: No such file or directory.

    2)下载附件中的文件,放至/usr/include目录下,重新执行python seup.py install MySQL-python-1.2.5.zip 下载链接:https://files.pythonhosted.org/packages/a5/e9/51b544da85a36a68debe7a7091f068

    在Ubuntu14.04上离线安装mysql5.7.19时需要的两个依赖包

    mysql-community-client depends on libaio1 (>= 0.3.93); however: Package libaio1 is not installed. dpkg: error processing package mysql-community-client (--install): dependency problems - leaving ...

    centos7 安装mysql和mysqlclient遇到的坑总结

    安装MySQL服务器可使用`yum install`命令,例如`yum install mysql-community-server`。安装完成后,启动MySQL服务,CentOS7中使用`systemctl start mysqld.service`。如果在较低版本的系统中,可以使用`service ...

    Python3连接mysql

    ### Python3连接MySQL知识点概述 在使用Python进行Web开发、数据分析以及其他涉及数据库操作的应用场景时,连接并操作MySQL数据库是一项非常基础且重要的技能。本文将详细介绍如何使用Python3连接MySQL数据库,并...

    mysql-5.6.35.tar.gz

    9. **配置开机启动**:`sudo systemctl enable mysqld`或`sudo chkconfig mysqld on`,确保系统启动时自动启动MySQL。 在MySQL 5.6.35版本中,关键的改进和特性包括: - **性能提升**:引入了InnoDB存储引擎的并行...

    MySQL-5.1.56 for linux 驱动程序

    安装MySQL-5.1.56 on Linux通常涉及以下步骤: 1. 下载:您已经拥有名为“mysql-5.1.56.tar_PiaoXu.net.gz”的压缩文件,这是Linux上的标准tarball格式,包含所有必要的源代码。首先,使用`gunzip`解压gz文件,然后...

    OperatorCenter:操作员中心

    #OperatorCenter ========= #Config #Flask-WTF https://flask-wtf.readthedocs.org/en/latest/install.html #Flask-WTF $ easy_install Flask-WTF ...http://yuji.wordpress.com/2009/08/31/python-on-window

    PyPI 官网下载 | mysql-connector-repackaged-0.3.1.tar.gz

    《PyPI官网下载的mysql-connector-repackaged-0.3.1.tar.gz:Python连接MySQL数据库的关键工具》 在Python编程中,与各种数据库进行交互是常见的需求,特别是对于MySQL这种广泛使用的开源关系型数据库管理系统。...

    node.js插件工具

    install-node-msi-version-on-windows-step1 步骤 2 : 点击以上的Run(运行),将出现如下界面: install-node-msi-version-on-windows-step2 步骤 3 : 勾选接受协议选项,点击 next(下一步) 按钮 : install-...

    基于python+django+mysql的超市管理系统源码+项目说明(计算机毕设).zip

    mysql> GRANT ALL PRIVILEGES ON demo_django_supermarket.* TO 'admin'@'localhost'; ``` ### 初始化数据 1. migrate 迁移/初始化数据库 ```bash > python3 manage.py makemigrations > python3 manage.py ...

    使用Python语言和MySQL连接库进行MySQL表连接的示例代码

    pip install mysql-connector-python ``` #### 三、示例代码详解 接下来,我们将逐步分析提供的示例代码。 ##### 1. 导入必要的库 ```python import mysql.connector ``` 这里导入了`mysql.connector`模块,它是...

    Python3实现连接mysql并执行增删改查操作(源代码)

    pip install mysql-connector-python ``` 该命令会自动下载并安装所需的库及其依赖项。 ##### 2. 数据库配置信息 连接数据库之前,需要准备一个包含数据库连接信息的字典。这些信息通常包括用户名、密码、主机...

    PyPI 官网下载 | pandas_upsert_to_mysql-0.0.3.tar.gz

    《PyPI官网下载:pandas_upsert_to_mysql-0.0.3.tar.gz——Python数据库操作新星》 在Python的生态环境中,PyPI(Python Package Index)是开发者们获取和分享开源软件的重要平台。本资源,"pandas_upsert_to_mysql...

    python与mysql基础用法

    pip install mysql-connector-python ``` 然后,你可以编写以下代码来连接 MySQL 数据库: ```python import mysql.connector # 创建数据库连接 cnx = mysql.connector.connect(user='your_username', password='...

    服务器:在树莓派上安装MySQL数据库和简单使用方法 过程详细

    pip install mysql-connector-python ``` 编写Python脚本连接数据库: ```python import mysql.connector cnx = mysql.connector.connect(user='newuser', password='password', host='localhost', database='...

    搭建apache+python+django+MySQL Web开发环境.docx

    搭建Apache+Python+Django+MySQL Web开发环境 本文将详细介绍如何搭建Apache+Python+Django+MySQL Web开发环境,并对相关的技术进行详细的解释。 一、 Python 语言简介 Python是一种面向对象、直译式计算机程序...

    Python技术数据库操作中常见问题解答.docx

    要解决这个问题,你需要使用Python的包管理器pip来安装`mysql-connector-python`模块,命令是`pip install mysql-connector-python`。确保你的Python环境已经配置好,并且具备网络连接,这样就能成功安装缺失的模块...

    Centos6.4安装reviewboard.pdf

    - 安装 MySQL:`yum install -y mysql-server mysql mysql-devel` - 启动 MySQL 服务:`/etc/init.d/mysqld start` - 检查 MySQL 是否设置为开机启动:`chkconfig --list | grep mysqld` - 如果没有,设置为开机...

Global site tag (gtag.js) - Google Analytics