在雪豹上安装mysqldb [英] Install mysqldb on snow leopard

查看:108
本文介绍了在雪豹上安装mysqldb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开始在Django上使用Python我是专业的PHP开发人员,并且被告知要在我目前的apache和mysql设置上设置django和python,但是我无法获取Mysqldb模块的python要工作,我必须遵循大约6个不同的说明,我正在运行雪豹,并且已经安装了mysql,它不是MAMP或类似的一部分。请你告诉我需要什么,我需要什么步骤,我会非常感激。



谢谢

解决方案

我建议安装macports(最新的svn trunk)并从中安装mysql。



sudo端口安装mysql5-server



下载MySQL-python-1.2.2源代码



确保/ opt / local / lib / mysql5 / bin位于您的路径或编辑site.cfg以包括:

  mysql_config = / opt / local / lib / mysql5 / bin / mysql_config 

注释掉_mysql.c的第38行

  // #define uint unsigned int 

然后运行:

  sudo python setup .py安装

应该是好的。


I am trying to get started on working with Python on Django I am by profession a PHP developer and have been told to set up django and python on my current apache and mysql setup however I am having trouble getting the Mysqldb module for python to work, I must of followed about 6 different set of instructions, I am running snow leopard and have mysql installed natively it is not part of MAMP or similar. Please can some tell me where I need to start and what steps I need to follew I would be most grateful.

Thanks

解决方案

I'd recomend installing macports (latest svn trunk) and installing mysql from there.

sudo port install mysql5-server

Download the MySQL-python-1.2.2 source

make sure /opt/local/lib/mysql5/bin is in your path or edit site.cfg to include:

mysql_config = /opt/local/lib/mysql5/bin/mysql_config

Comment out line 38 of _mysql.c

// #define uint unsigned int

Then run:

sudo python setup.py install

should be all good.

这篇关于在雪豹上安装mysqldb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆