Alternatively, you can just download the MySQL package format installer from
the MySQL site (Mirror).

There have been reports about problems when trying to install MySQLdb via
easy_install on Mac OS X, so you may be better of using one of the above
alternatives.

Another issue with installing mysql-python on OS X Leopard (and a work-around
for it) is described in the article the MySQLdb on Leopard. In short, before
attempting to install, ensure that the MySQL bin directory is in your path,
otherwise mysql_config will not be found.

First set the database connection string in your project’s deployment
configuration (i.e. dev.cfg for a development environment, prod.cfg for
a production environment):

sqlobject.dburi="mysql://george@localhost/test"

assuming george as the database user name, localhost as the hostname of
the database server and test as the database name. See the TurboGears
Configuration page for more information on TurboGears’ configuration files.

Then we need to create database using the mysql shell (give the password for the
MySQLroot user when prompted for):

MySQL includes several storage engines (e.g. MyISAM and InnoDB). MyISAM is older
and most sites only use this engine. MyISAM is somewhat faster than InnoDB but
is not able to handle transactions (and you like to keep your data integrity,
right? ;-).

Note that transactions are not the only reason why using InnoDB is a good idea.
InnoDB also enforces data integrity more strictly than MyISAM and also has many
more features.

Every table in MySQL can have its own engine. When creating a table, you can
specify which engine to use. The default engine in MySQL is MyISAM.

Unfortunately, SQLObject does not allow the specification of a storage engine
as most databases only use one storage engine.

When the command tg-adminsqlcreate is issued, the default table type is
used.

Change the table types by hand after TurboGears created them:
“ALTERTABLEmytableTYPE=INNODB“

By default TurboGears uses transactions. But there is a hook that allows you to
disable transactions in TurboGears. If you do not want TurboGears to manage
transactions put :doc:`/notrans` in front of the dburi, TurboGears will
silently ignore all begin / commit / rollback / end instructions. Here is the
above dburi string with transactions disabled:

To change the default storage engine of MySQL to InnoDB, you have to add the
following line to the [mysqld] section of your my.ini / my.cnf
file:

default-storage-engine=INNODB

This will have the effect that when you issue a CREATETABLE statement,
MySQL will create an InnoDB table by default. Under Windows the file is
usually found in the C:\ProgramFiles\MySQL\MySQLServerX.Y directory and
on Linux under the path name /etc/my.cnf or /etc/mysql/my.cnf.

If you have the MySQL Administrator GUI installed, you can also change this
setting from within this program.

Your version of the MySQLdb module must be compatible with the database you want
to connect to. Old versions of MySQLdb may not support newer MySQL versions as
data formats may have changed or the underlying C libraries behave differently
in certain situations (such as “Connection lost”).

If you experience problems because your MySQL server version is too new, the
correct solution to this problem is to update your MySQLdb module.

Unfortunately, Redhat ships incompatible versions of MySQLdb (version 1.0) and
MySQL (version 4.1) in its Redhat Enterprise Linux 4 (Update 4). You may
experience problems with that configuration if you have database fields with the
MySQL type TIMESTAMP which changed its format from MySQL 4.0 to 4.1. If your
SQLObject class is being autogenerated from the database, this error will be
raised: