diff --git a/mysql/README.MySQLmodule b/mysql/README.MySQLmodule new file mode 100644 index 0000000..fd417bf --- /dev/null +++ b/mysql/README.MySQLmodule @@ -0,0 +1,9 @@ +If you have code that uses the old MySQLmodule's Mysqldb interface, +try CompatMysqldb. It is the old module adapted to use _mysql instead +of MySQL[module]. The original Mysqldb was written by James Henstridge. +If it's broken, it's probably my fault: I haven't tested it very much. +Consider it experimental. + +Andy Dustman + +2000-08-09 diff --git a/mysql/README.windows b/mysql/README.windows new file mode 100644 index 0000000..5977a5b --- /dev/null +++ b/mysql/README.windows @@ -0,0 +1,94 @@ +Notes: + +1) The patches are applied already, so you won't find them. +2) Supposedly the compile.py that is included here will work on + both unix and windows, but I've tried it on neither. + +Andy + +From bkline@rksystems.com Tue Sep 14 16:09:13 1999 +Date: Sat, 11 Sep 1999 13:22:06 -0400 (EDT) +From: Bob Kline +To: adustman@comstar.net +Subject: Win32 Build of MySQLdb + +Andy: + +In the documentation for MySQLdb, you wrote: + +> If you work out an installation routine for Windows, please contact +> the author. + +I have built MySQLdb on Windows NT 4.0, PL5, using MSVC 6.0. The steps +I took were: + + 1. Pull down and modify David Ascher's compile.py. + 2. Modify _mysqlmodule.c. + 3. Modify Setup.in. + 4. Run compile.py. + 5. Copy _mysql.pyd and MySQLdb.py into the PYTHONPATH. + +I have attached a zip archive containing: + + * _mysqlmodule.c + * _mysqlmodule.diff + * Setup.in + * Setup.diff + * compile.py + +Specifics about the modifications: + +1. Ascher's script linked to the single-threaded C run-time libraries, + but the mysql libraries are multi-threaded. Changed /MD to /MT and + /MDd to /MTd. +2. The mysql headers need but fail to include windows.h on WIN32. Added + conditional #include statement. +3. The non-standard type uint needed to be defined. +4. Some of the mysql constants used by MySQLdb are presumably from + version 3.22.19 (as you indicate in the documentation), but the + latest version of the client/development tools available for + Win32 is 3.22.14, which doesn't have all of those constants defined. + Added some #ifdef statements to make sure symbols that aren't + defined aren't used. +5. The PyObject_HEAD_INIT(&PyType_Type) don't work on Win32, as + explained in the online Python tutorials. Added conditional + replacement approach as instructed by that documentation. +6. Added a null pointer test to a Py_DECREF call to avoid a + segmentation fault. +7. Modifed Setup.in to account for the location of the mysql + headers and libraries on my system, and to include the Win32 + sockets library (wsock32.lib) + +The modified C source code should still work on all platforms. The +Setup file will need to be customized for each platform which doesn't +have its mysql headers and libraries in the default locations, and Win32 +builds will need wsock32 in the setup file. I wasn't able to determine +how to put conditional portions in the setup file (ideally I wouldn't +have needed to modify compily.py at all). I presume there is +documentation somewhere for this setup file, but I'm new enough to the +Python world that I haven't found it yet. + +Assuming the modifications to _mysqlmodule.c get folded into the +distribution, and a version of Setup.in for Win32 (including +"-lwsock32") is added to the distribution (for example, as Setup.w32), +and the attached version of Ascher's script is included, the steps +someone else would take in order to build with the current version of +MSVC would be: + +1. Copy Setup.w32 to Setup.in. +2. Adjust paths in Setup.in as needed. +3. Run compile.py. +4. Copy _mysql.pyd and MySQLdb.py into the PYTHONPATH. + +Hope this is useful. + +-- +Bob Kline +mailto:bkline@rksystems.com +http://www.rksystems.com + + + [ Part 2, "Mods for building MySQLdb on Win32 platforms" ] + [ Application/ZIP 29KB. ] + [ Unable to print this part. ] +