###### Using MySQL as Database for TeamSpeak-Server 2.0.23.19 ######


### Some discouragement first ###

The TeamSpeak 2 Server will use a sqlite database by default, this doesn't
require *any* additional configuring, it is setup to work out of the box. Using
sqlite as database backend for TeamSpeak 2 Servers is the recommended way, the
mysql implementation has not been tested as thoroughly and might contain bugs.
Please only continue on with this guide if you have strong reasons for wanting
TeamSpeak to use mysql as backing store.

### What we need ###

Naturally, we will need a MySQL server to store the data for us, this document 
will not explain how this can be done - there are documents out there for the 
interested. The requirements include a (empty) database for TeamSpeak to use
and a user account (username + password) that has the permissions to do stuff
with the database. Additionally, you will need a vendor library installed on the
local machine, this came with my MySQL install.

These instructions will not tell you how you might transfer your data from the
SQLite database to the MySQL database, we start with a clean and empty MySQL
database.
Some users have reported ways to import a SQLite database into MySQL, but at
the time of writing, there are still too many issues - check the current status
in the TeamSpeak forums if you are interested.

NOTE: To allow TeamSpeak to access the MySQL database the dbExpress driver from
Borland was used. This driver can only interface with the client library that 
comes with MySQL 3.x. It is possible to access a MySQL 4.x database with this
client library - basically all you have to do is to use a 3.x client library as 
"VendorLib" and a 4.x database to connect to.
If you need more info about dbExpress, you can contact Borland.


### Doing the work ###

Setting up TeamSpeak to use MySQL (should) be straight forward once you have all
the perquisites right, just open your server.ini file, and add this section at
the end:

---cut here---
[DBEXPRESS]
sqldir=mysql_sql
Drivername=mysql
Database=Your_Database_Name_Here
Hostname=The_PC_the_MySQL-Server_is_on
User_name=User_name_on_the_MySQL-Server
Password=Password_to_go_with_above_user_name
GetDriverFunc=getSQLDriverMYSQL
VendorLib=path_pointing_at_your_mysql_vendor_lib
LibraryName=path_to_libsqlmy_libary
Active=1
---cut here---

In my environment (a linux box with a MySQL server running locally) I have:

---example---
[DBEXPRESS]
sqldir=mysql_sql/
Drivername=mysql
Database=test
Hostname=localhost
User_name=testuser
Password=my_password
GetDriverFunc=getSQLDriverMYSQL
VendorLib=/usr/lib/libmysqlclient_r.so.10.0.0
LibraryName=./libsqlmy.so
Active=1
---example---


On a windows box, also running the MySQL server locally, it would be:

---example---
[DBEXPRESS]
sqldir=mysql_sql
Drivername=mysql
Database=test
Hostname=127.0.0.1
User_name=testuser
Password=my_password
GetDriverFunc=getSQLDriverMYSQL
VendorLib=libmysql.dll
LibraryName=dbexpmysql.dll
Active=1
---example----

- written 02.03.04 by pwk.linuxfan
- updated 02.08.07 by pwk.linuxfan

