栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Mac OS 10.6.2 Snow Leopard上的Django + MySQL

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Mac OS 10.6.2 Snow Leopard上的Django + MySQL

我最终解决了自己的问题,当然,我从许多已读过的帖子,博客和邮件日志中获得了潜意识和有意识的帮助。如果我记得的话,我会提供链接。

简而言之,我使用MacPorts重新安装了一切。

编辑〜/ .bash_profile并注释掉对$ {PATH}的所有先前修改之后,我下载了Snow
Leopard
的dmg并进行了安装。

然后打开终端并运行自我更新。

sudo port selfupdatesudo port install python26

第二部分,安装Python 2.6,花费了很多时间。但完成后,提示我以下内容:

To fully complete your installation and make python 2.6 the default, please runsudo port install python_select  sudo python_select python26

我都做了,他们很快就完成了。

我忘了提到“端口搜索”命令有多方便。我搜索了“
mysql”,并且类似地找到了“安装”后要键入的内容。但是我着手重新安装MySQL的客户端和服务器。也许我以相反的顺序进行了操作,但是最终结果很好。

sudo port install mysql5...--->  Installing mysql5 @5.1.41_0The MySQL client has been installed.If you also want a MySQL server, install the mysql5-server port.

很自然地:

sudo port install mysql5-server

我喜欢这么多的macports安装如何为您提供有关下一步操作的反馈。在服务器安装结束时,它表示以下内容:

******************************************************* In order to setup the database, you might want to run* sudo -u _mysql mysql_install_db5* if this is a new install******************************************************

这对我来说是新安装的(没有任何本地模式)。为了完整起见,并供我自己参考,以下是运行该命令的输出:

Installing MySQL system tables...OKFilling help tables...OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !To do so, start the server, then issue the following commands:/opt/local/lib/mysql5/bin/mysqladmin -u root password 'new-password'/opt/local/lib/mysql5/bin/mysqladmin -u root -h iMac.local password 'new-password'Alternatively you can run:/opt/local/lib/mysql5/bin/mysql_secure_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default.  This isstrongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:cd /opt/local ; /opt/local/lib/mysql5/bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.plcd /opt/local/mysql-test ; perl mysql-test-run.plPlease report any problems with the /opt/local/lib/mysql5/bin/mysqlbug script!The latest information about MySQL is available at http://www.mysql.com/Support MySQL by buying support/licenses from http://shop.mysql.com/

快完成了 在“端口搜索”的早期,我遇到了一个有趣的端口:

py26-mysql @ 1.2.2(python,devel,数据库)mysql的Python接口

非常希望这会为我提供MySQLdb软件包,我安装了它(确实做到了)。

sudo port install py26-mysql

余言之后,我加速了python解释器的尝试,以导入MySQLdb,这一直都是我的方式。

iMac:~ drhoden$ pythonPython 2.6.4 (r264:75706, Dec 15 2009, 18:00:14) [GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import MySQLdb/opt/local/Library/frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated from sets import ImmutableSet>>>

警告,但是有效!!

还有一件事:

sudo port install py26-django

完成所有这些之后,我终于能够启动Django项目并远程连接到公司的MySQL服务器!可能没有必要使用MacPorts重新安装Django,但我并不会冒任何麻烦。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/394087.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号