wiki:DataBaseInstalation
Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Version 10 (modified by anonymous, 11 years ago) (diff)

Fix spelling of SQLite

This page is intended to be used by either SQLObject or SQLAlchemy and even though it's not directly TG related it's a must.

NOTE: please note that even though SQLALchemy support is now primitive it's the way to go in the future.

For now it's just a bunch of links because I intend it to be created by everyone

 SQLObject Supported Backends

  • MySQL
  • Postgres
  • SQLite
  • Firebird
  • Sybase
  • MAX DB
  • MS SQL Server

 SQLAlchemy Supported Backends

  • Firebird
  • MS SQL Server
  • MySQL
  • Oracle
  • Postgres
  • SQLite

First we'll assume you already have a database backend installed and working, since if you want an ORM you are probably sick of SQL and therefore have a funtional database :)

The process of installing a db is very diferent for each one so please  google it.

pause while you install the db engine

So now that we have a working db we need some python bindings for it, that is a library that lets python programs interact with the db backend.

Linux

There many ways to install

  • look to see if the package is in your package manager.
  • if not then make a package for it.
  • look to see if it is available from  http://www.python.org/pypi and easy_install it.
  • build from source.

Which way to go depends on you, although most distros prefer to manage all install, easy_install is probably the easiest way.

MySql

You will need  mysqldb it may be called mysql-python on your package manager and it is called that in pypi.

Best Approach

  • Use your package manager

if that fails

  • Install development tools (gcc,make,etc.)
  • Install mysql developement tools
    easy_install mysql-python
    

SQLite

You will need  pysqlite

Best Approach

  • Use your package manager

As easy as the above

easy_install pysqlite

PostgreSql

You will need  psycopg2 if you're going to use Unicode, otherwise either psycopg or psycopg2 will do it. We recommend using psycopg2 because of other features besides unicode.

Best Approach

  • Use your package manager
  • Build it yourself using  these instructions.

Windows

In Windows there is basically one way to install packages, an exe file (aka installer), provided by the package author or users. Installing from source is a pain and should be your last resource. If you do choose to go this way you will need VisualStudio? or the equivalent TODO add link to MC visual C compiler, NOTE it's not an easy task.

MySql

You will need  mysqldb, mysql-python is the name in in pypi.

As of May 3 2006 there is no installer for the lastest version (1.2.1_p2), so easy_install will fail. Instead, download the installer for an older version, such as  1.2.0.

Best Approach

 mysql-python Downloads and get the lastest exe/zip (1.2.0).

if that fails

  • TODO if I ever get this (got a week trying to compile it, post it here)

SqlLite

You will need  pysqlite

Best Approach

  • easy_install pysqlite

PostgreSql

  • Download and install from  here.

MacOS

The easiest way of installed most of the common open source databases on OS X is to either use  DarwinPorts or  Fink.

Both of these are package management systems that will install all the dependencies for you.

To install Darwin Ports, first install GCC from Apple, and then install the dmg from Darwin Ports  http://darwinports.opendarwin.org/getdp/ and follow the instructions on the Darwin Ports site.

MySql

For Darwin Ports

$ sudo port install mysql4 +server

or

$ sudo port install mysql5 +server

SQLite

For Darwin Ports

$ sudo port install sqlite2

PostgreSql

For Darwin Ports

$ sudo port install postgresql8

or

$ sudo port install portgresql7