|
|
|
|
| |
Setting up your Computer - Windows
Setting up MySQL for Python and Server-based MySQL for multi-user Transana-MU
- Make sure your Python's "Lib\site-packages" folder does not have a MySQLdb folder, and that there are not files called "_mysql.pyd", "_mysql_exceptions.py", and "_mysql_exceptions.pyc". Depending on how the previous installation was done, you need to either uninstall MySQL for Python or delete these files manually.
- Download and install MySQL 4.1.14. Although MySQL does not need to be run on the same computer as Transana-MU during use, you need to install it on your development computer in order to build MySQL for Python.
We would not recommend using a production MySQL server while you are developing Transana-MU, as it is possible to crash the database server during program development and testing.
Follow the installation instructions on the MySQL site. Be sure to set up at least one user account. If you are upgrading from a version 4.0.x version, please see the MySQL Web Site for instructions on migrating data.
- Create a folder called "C:\MySQLtemp". We've had better luck with creating a temporary folder and copying necessary files to it than we've had trying to build MySQL for Python directly from the MySQL installation folder.
- Copy the folder "C:\MySQL Server 4.1.14\include" and all its files to "C:\MySQLtemp".
- Create a folder in "C:\MySQLtemp" called "libs". Copy
"C:\MySQL Server 4.1.14\lib\opt\mysqlclient.lib" to this folder.
- We must build MySQL for Python from source to get it to work with MySQL 4.1.14. Therefore, download and install "MySQL-Python-1.2.0.tar.gz", the source code version of MySQL for Python 1.2.0. Unzip this archive and extract the files somewhere where you can find them and run Python code.
- Open a Command Prompt window. Change to the folder where you have put the files for MySQL for Python 1.2.0.
- If a "build" folder exists in your MySQL for Python source folder, delete it. Old versions of this folder can interfere with the build process because the C compiler might think it has already completed certain steps that in fact it hasn't.
- The next thing we need to do is set up three environment variables that MySQL for Python uses in its build process. Type the following three commands at the DOS prompt:
set mysqlroot=C:\MySQLtemp
set mysqlversion=4.1.14
set mysqlclient=mysqlclient
- Edit MySQL for Python's "setup.py" file to add the line:
extra_compile_args = None
at the end of the "if sys.platform == 'win32':" block, at approximately line 61.
- To ensure that previous install attempts don't interfere with this install, type the command:
python setup.py clean
- To build MySQL for Python using MySQL 4.1.14, type the command:
python setup.py build
- To install the MySQL for Python package to your Python installation, type the command:
python setup.py install
- Finally, when you start working on Transana, you will need to edit the TransanaConstants.py file. At approximately line 31 of this file, the "singleUserVersion" variable is declared. To work with this configuration of server-based MySQL and MySQL for Python, the singleUserVersion variable must be set to False.
singleUserVersion = False
|
|
|