From 034ac470ecbadea81354ea20d481dd8e7e0abdec Mon Sep 17 00:00:00 2001 From: gimick Date: Tue, 29 Jun 2010 20:58:54 +0100 Subject: [PATCH 1/2] MySql-python windows installer walkthrough added --- .../MySqlPython1.2.2WalkthroughPython26.txt | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 packaging/windows/MySqlPython1.2.2WalkthroughPython26.txt diff --git a/packaging/windows/MySqlPython1.2.2WalkthroughPython26.txt b/packaging/windows/MySqlPython1.2.2WalkthroughPython26.txt new file mode 100644 index 00000000..fa3a75d6 --- /dev/null +++ b/packaging/windows/MySqlPython1.2.2WalkthroughPython26.txt @@ -0,0 +1,136 @@ +Create MySqlPython windows installer for Python26 +created by Gimick on 29th June 2010 + +The FPDB exe needs to build against the MySql-Python project. Unfortunately, for python 2.6 there is no official installer for windows, and none is ever likely to be provided. +Community builds are available, but to reduce third-party dependencies, we will build our own here. + +This walkthrough is derived from excellent installation instructions here ... http://www.bcspcsonline.com/wiki/index.php?title=MySQL-5.1.34_Python-2.6_Module_Build_Instructions + + +Step 0 Get a fresh XP installation +---------------------------------- + +0.1/ Using XPhome 32bit + + +Step 1, VisualStudio 2008 express install +----------------------------------------- + +1.1/ Get the ISO CD from here ... http://www.microsoft.com/express/Downloads/#2008-All + +1.2/ Run and install Visual C++ only, don't bother with the additional packages offered + +This package will run 30 days before registration is needed + + +Step 2, setup Mysql Server +-------------------------- + +2.1/ Install MySQL server runtime ... http://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.34-win32.msi + +Choose Typical, choose configure, choose Standard Configuration, choose all defaults, supply admin username/password. + + +Step 3, more installs +---------------------- + +3.1/ install the following in sequence (accept all default options) there should be no errors ! + +Python 2.6.5 ... http://www.python.org/ftp/python/2.6.5/python-2.6.5.msi +7zip 914 ... http://sourceforge.net/projects/sevenzip/files/7-Zip/9.14/7z914.exe/download + + +Step 4, grab Mysql server Source +-------------------------------- + +4.1/ Download ... http://downloads.mysql.com/archives/mysql-5.1/mysql-noinstall-5.1.34-win32.zip +4.2/ Unpacking Desktop\mysqlsource (use 7zip) +4.3/ Copy the following source directories to the MySql installation: + +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\data\* "c:\Program Files\MySQL\MySQL Server 5.1\data" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\Embedded\* "c:\Program Files\MySQL\MySQL Server 5.1\Embedded" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\include\* "c:\Program Files\MySQL\MySQL Server 5.1\include" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\lib\* "c:\Program Files\MySQL\MySQL Server 5.1\lib" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\mysql-test\* "c:\Program Files\MySQL\MySQL Server 5.1\mysql-test" /I/E/F/H +dos> xcopy Desktop\mysqlsource\mysql-5.1.34-win32\sql-bench\* "c:\Program Files\MySQL\MySQL Server 5.1\sql-bench" /I/E/F/H + +4.4/ You can delete Destop\mysqlsource, is no longer needed. + + +Step 5, grab Mysql-python source +-------------------------------- + +5.1/ get download +MySql for python ... http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download + +5.2/ extract MySQL-python-1.2.2 directory to the Desktop using 7zip +(note: use 7zip, open the gz, then open the tar, then extract the directory found inside there) + +Desktop\MySQL-python-1.2.2 should now exist + + +Step 6, get python build tools +------------------------------ + +6.1/ get Easy Setup installer +Easy setup installer ... http://peak.telecommunity.com/dist/ez_setup.py + +6.2/ Check the DEFAULT VERSION specified in Easy Setup and get the corresponding setuptools (version c11 in this case) +Setuptools version 11 ... http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg + +6.3/ Put both of these files into Desktop\MySQL-python-1.2.2, overwriting any existing files + + +Step 7, install the build tool +------------------------------ + +dos> cd Desktop\MySQL-python-1.2.2 +dos> c:\Python26\python.exe ez_setup.py setuptools-0.6c11-py2.6.egg + + +Step 8, Tweak the configuration +------------------------------- + +dos> cd Desktop\MySQL-python-1.2.2 + +8.1/ dos> write site.cfg + +Change registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0 + to registry_key = SOFTWARE\MySQL AB\MySQL Server 5.1 + +8.2/ dos> write _mysql.c + +Find the following lines + +... +#include +#include +... + +Insert an additional winsock2 line + +... +#include +#include +#include +... + + +Step 9, build +------------- + +dos> cd Desktop\MySQL-python-1.2.2 + +9.1/ dos> c:\python26\python.exe setup.py build + +* Note: You will probably get a bunch of warnings and maybe a manifest error, these are ok as long as there are no errors in compiling or linking. +* Note: This will generate the "MySQL-python-1.2.2/build" folder + +9.2/ dos> c:\python26\python.exe setup.py bdist_wininst + + +Step 10, done +------------- + +10.1/ the \dist directory will contain MySQL-python-1.2.2.win32-py2.6.exe !!!!! +10.2/ rename to MySQL-python-1.2.2.win32-py2.6-fpdb0.20.exe From 812f9759b30ffc5f7cfe932da2d6bc84604bdef3 Mon Sep 17 00:00:00 2001 From: gimick Date: Tue, 29 Jun 2010 21:42:23 +0100 Subject: [PATCH 2/2] update py2exe walkthrough for mysql-python package changes --- packaging/windows/py2exeWalkthroughPython26.txt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packaging/windows/py2exeWalkthroughPython26.txt b/packaging/windows/py2exeWalkthroughPython26.txt index 080bd8e4..207d1cc3 100644 --- a/packaging/windows/py2exeWalkthroughPython26.txt +++ b/packaging/windows/py2exeWalkthroughPython26.txt @@ -21,16 +21,15 @@ pycairo 1.8.6 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pycairo/1.8/pyca pyGobject 2.20.0 ... http://ftp.gnome.org/pub/GNOME/binaries/win32/pygobject/2.20/pygobject-2.20.0.win32-py2.6.exe py2exe 0.6.9 ... http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.6.exe/download psycopg2 ... http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.2.1.win32-py2.6-pg8.4.3-release.exe +(Note: stickpeople is the offical repository, not a community build) 1.2/ MySQL -mysql-python is needed -The sourceforge page is http://sourceforge.net/projects/mysql-python/files/ -Unfortunately there is no py2.6 build for windows yet. -Instructions to build the installer package can be found here -http://www.bcspcsonline.com/wiki/index.php?title=MySQL-5.1.34_Python-2.6_Module_Build_Instructions -A pre-built intaller is available here -MySQL-python 1.2.3c1 ... http://www.codegood.com/download/4/ (MySQL-python-1.2.3c1.win32-py2.6.exe) +MySQL-python-1.2.2.win32-py2.6-fpdb0.20.exe ... http://www.mediafire.com/file/zjyljynz2mz/MySQL-python-1.2.2.win32-py2.6-fpdb0.20.exe + +This is an intaller built from source by gimick. There are no official mysql-python2.6 build for windows. + +Community builds are also available from some developers. see www.codegood.com for example. Step 2 Setup GTK