|
麻烦翻译一下,下面这段文章:xhan
; w" d4 B6 H5 u5 `! ^2 G* B, r' q) Z! W& j) Q: \8 w: B G
- % L b" |3 U+ z; }3 F
- ###### Using MySQL as Database for TeamSpeak-Server 2.0.20.1 ######
7 S# M) u% w2 w8 w+ A5 x0 D
% s0 j& J* }9 m+ d5 Q7 U! q5 f- ### What we need ###
" Q7 O0 n; ]; i; P - Naturally, we will need a MySQL server to store the data for us, this document & P' E2 d6 h; Q- }
- will not explain how this can be done - there are documents out there for the 0 E6 R" @: @! F5 @5 J5 f
- interested. The requirements include a (empty) database for TeamSpeak to use
/ |( C! V- n {4 @2 c - and a user account (username + password) that has the permissions to do stuff
' o) c+ d* L9 p( R+ {$ b" Y - with the database. Additionally, you will need a vendor library installed on the9 h" P; J+ e3 C \1 ]* ~; ~! y
- local machine, this came with my MySQL install.
- T+ Q+ r3 `, \! I+ E2 E/ L; d) l - These instructions will not tell you how you might transfer your data from the
" m V& S$ x- g! z& M% C3 t - SQLite database to the MySQL database, we start with a clean and empty MySQL
6 j( {1 ~' ^% ^# M - database.
. D: S! B' a a* I& v6 n, T - Some users have reported ways to import a SQLite database into MySQL, but at4 R. o* W3 j& w
- the time of writing, there are still too many issues - check the current status
9 z5 B% {2 ^; D7 h# C6 S - in the TeamSpeak forums if you are interested.' c5 V! E! E1 ^: K1 Z+ J
- NOTE: To allow TeamSpeak to access the MySQL database the dbExpress driver from2 n4 I9 a/ M n% y* x( o
- Borland was used. This driver can only interface with the client library that & q9 V; x% V. ^9 m
- comes with MySQL 3.x. It is possible to access a MySQL 4.x database with this
& v8 d4 ?- V2 E: T p - client library - basically all you have to do is to use a 3.x client library as " W% x' u$ D# V/ J! X! V4 H( R: l
- "VendorLib" and a 4.x database to connect to.. t- s+ Q9 E: O- M9 R
- If you need more info about dbExpress, you can contact Borland. O/ S. [) V' q! J& l
6 |/ o2 |' t& @6 o- g+ x6 X- ### Doing the work ###
! T U+ y. k/ {0 B# U% F6 B - Setting up TeamSpeak to use MySQL (should) be straight forward once you have all
* f- ^% ?- `3 @7 E - the perquisites right, just open your server.ini file, and add this section at
) v* V7 h s2 U - the end:
6 A; x$ Y; I8 S4 f - ---cut here---
1 g- ~7 d9 _ T$ Q) e4 Y' f2 B - [DBEXPRESS]
3 x v+ B0 {& U/ K) _8 l - sqldir=mysql_sql8 N9 d! S- P# Z8 ~$ L, C
- Drivername=mysql
+ B! `* E! ^) B( M8 D - Database=Your_Database_Name_Here
! t1 H. e6 V. i( f - Hostname=The_PC_the_MySQL-Server_is_on2 L _3 J' S1 |5 f# ?
- User_name=User_name_on_the_MySQL-Server
2 q" d- c. Z! T1 _6 { - Password=Password_to_go_with_above_user_name
( \9 h3 U/ n( C" B - GetDriverFunc=getSQLDriverMYSQL
) r* w, M: ]* M# t - VendorLib=path_pointing_at_your_mysql_vendor_lib+ \# x5 |0 @+ i! }
- LibraryName=path_to_libsqlmy_libary. R6 k( _4 ?3 ]
- Active=1
- U4 D4 `7 d' H( @* D) D- h - ---cut here---
7 |0 L1 k8 S- l1 J5 Y" {" A - In my environment (a linux box with a MySQL server running locally) I have:
9 o( Z. G: }* E5 p - ---example---3 ]" M7 T# U3 | D
- [DBEXPRESS]
: T4 u+ H$ P4 `9 t - sqldir=mysql_sql+ H t+ \% j7 w9 w3 a- B5 l6 ~1 V
- Drivername=mysql
# z) y7 K6 O r+ D$ p* B - Database=test$ K6 m: p- a# I; I0 B0 o9 H% P8 j8 L
- Hostname=localhost E) q5 p3 y% ^8 p, }% K2 X! H
- User_name=testuser) N; j f7 c8 ~; ]
- Password=my_password @* j: c6 N" p' }. @
- GetDriverFunc=getSQLDriverMYSQL: [% o ~2 T7 _# A
- VendorLib=/usr/lib/libmysqlclient_r.so.10.0.0
1 T4 s6 V/ n$ X9 e; x# [ - LibraryName=./libsqlmy.so
% @' ^; U" b/ w! {9 y5 | - Active=1
* C$ f2 m3 d+ x# i6 B - ---example---
2 u8 {2 ]' {0 G1 @
0 y7 u! b' }! S; i9 y4 g! e+ ^- On a windows box, also running the MySQL server locally, it would be:" H+ n/ c4 F7 D! V: _7 F$ |
- ---example---
: T& o0 h8 L* V- z! t - [DBEXPRESS]3 J/ U/ Y4 E2 S
- sqldir=mysql_sql
1 ^7 X0 ? Q) d( v - Drivername=mysql
+ O$ d, i) G8 n5 h - Database=test
0 x! c3 i% T* M! G - Hostname=127.0.0.1
. Q3 o3 b) d2 H9 |. b. I - User_name=testuser4 B6 Y/ Z# y! l( I# c
- Password=my_password
1 a$ p% P+ H' D; }0 L5 D - GetDriverFunc=getSQLDriverMYSQL
+ t& Q Q1 p2 X - VendorLib=libmysql.dll
: P& x+ }0 V/ c4 S% A - LibraryName=dbexpmysql.dll" P4 S* }3 h- X5 a* F/ J- f* I
- Active=1
, F" a0 {, |, f' i8 w# z! {9 x - ---example----: i, h# W" p& \8 l
- - written 02.03.04 by pwk.linuxfan
3 ^4 K5 ]) t: ?7 l( I - , t* }! r9 v6 A, s d/ a
复制代码 |
|