|
|
麻烦翻译一下,下面这段文章:xhan 8 e, G2 _* m3 W$ {+ }
% _0 @2 B. i. y9 x: s' y3 {
- 8 ?- l4 q3 B* \" e3 t7 {" P
- ###### Using MySQL as Database for TeamSpeak-Server 2.0.20.1 ######
1 ^( g8 c, j! a4 z+ C: A - - L/ I& }9 t* L& W4 P" I4 o
- ### What we need ###/ g6 ^3 d7 e+ @/ V# Y# O
- Naturally, we will need a MySQL server to store the data for us, this document
6 z& M; i4 e7 J1 L - will not explain how this can be done - there are documents out there for the & I- C8 k6 i7 D% g" O' m
- interested. The requirements include a (empty) database for TeamSpeak to use
! Z; [( o1 ]6 J1 {; |1 m - and a user account (username + password) that has the permissions to do stuff8 o0 ~. ~! Y; g0 t- o
- with the database. Additionally, you will need a vendor library installed on the
: z0 ?, ]' u7 Z+ q* V - local machine, this came with my MySQL install.% X/ Z1 j2 N/ [6 }* m4 a) l/ f
- These instructions will not tell you how you might transfer your data from the
7 h7 W9 M# D; k, B" S3 @ - SQLite database to the MySQL database, we start with a clean and empty MySQL# W+ e0 P/ a# B: V/ P. I
- database.# _: g5 S. I; i/ V; A# w
- Some users have reported ways to import a SQLite database into MySQL, but at
7 e$ [- y+ h+ B4 E - the time of writing, there are still too many issues - check the current status
$ P- M" \4 d! c* Y- n - in the TeamSpeak forums if you are interested.
6 m/ N) W6 w1 P6 H2 j3 T- P - NOTE: To allow TeamSpeak to access the MySQL database the dbExpress driver from
. ]& E) G6 N3 L, W p1 V' t y& i - Borland was used. This driver can only interface with the client library that
' L# T: ~, p E - comes with MySQL 3.x. It is possible to access a MySQL 4.x database with this# r% D: Z# P, L; U1 V8 N
- client library - basically all you have to do is to use a 3.x client library as
) F; e; L$ ^+ Z' ], g, ?" q - "VendorLib" and a 4.x database to connect to., V) ?1 S! r6 e5 V9 _. y
- If you need more info about dbExpress, you can contact Borland.
) W0 j3 ?( @3 K& C$ X3 ~
* H3 ~3 N6 O+ d' `4 \2 d' a- ### Doing the work ###
% u8 Y3 x: d$ V - Setting up TeamSpeak to use MySQL (should) be straight forward once you have all
9 m6 M+ S. i" x8 H0 {* m0 r: { - the perquisites right, just open your server.ini file, and add this section at
# `4 H4 v4 Z% \/ N - the end:
' ?$ t# K z% W( _5 H2 a - ---cut here---
2 j, y* k7 M; ]" m4 x - [DBEXPRESS]1 x: w6 A+ p, y1 Y) H/ k0 U
- sqldir=mysql_sql
% ^" M: E4 Y/ \+ C - Drivername=mysql* \' j. W( e! N: H* H ?7 ]5 f
- Database=Your_Database_Name_Here# n& J- a% B: v1 R/ s" a3 _
- Hostname=The_PC_the_MySQL-Server_is_on. y" v% A1 |0 A' T, C1 M7 l) E
- User_name=User_name_on_the_MySQL-Server
" b8 _- r/ y, x3 i' u' T: C - Password=Password_to_go_with_above_user_name
$ p& Q) t0 [2 O' s - GetDriverFunc=getSQLDriverMYSQL
8 m# W& z+ G/ E, G) I- \ l - VendorLib=path_pointing_at_your_mysql_vendor_lib( I6 J$ S# ~; z- v2 C4 b" R* E4 z
- LibraryName=path_to_libsqlmy_libary7 i% F3 y! J) t R7 t7 |1 e1 f, P8 Q
- Active=1
& ]- ^$ ]! s! g6 k: l9 K - ---cut here---
* T0 ^( ^2 Y" ]/ S# H2 I7 @ - In my environment (a linux box with a MySQL server running locally) I have:
) T5 |* r& L( D7 { - ---example---% S* d8 p+ F5 D4 ]0 \
- [DBEXPRESS]
- ]* W, A, d: N2 Q - sqldir=mysql_sql
3 g2 w9 A" G! z) E4 Z5 l - Drivername=mysql/ A- j5 W2 e) F! @1 a8 i
- Database=test* @ O) T1 { \0 U
- Hostname=localhost
7 ?- u0 E; K8 v - User_name=testuser' r. |# l7 p0 g: a
- Password=my_password( m7 ?/ ^2 F( d U3 w& x
- GetDriverFunc=getSQLDriverMYSQL
: x0 z: H/ ?/ t. \) l* H - VendorLib=/usr/lib/libmysqlclient_r.so.10.0.0
6 G7 s/ l$ L8 E8 M% X1 i - LibraryName=./libsqlmy.so
7 G* y% \' d* ]# ^9 } - Active=12 G8 E( f2 B# U9 {
- ---example---* ` U7 x4 w( f1 l% ^3 g- w
- ! x W# @) c9 A a2 V' o
- On a windows box, also running the MySQL server locally, it would be:
& P; {' Z* l* E, U O - ---example---4 v5 c- x7 _7 G' ]0 K
- [DBEXPRESS]
. A7 D' e L o - sqldir=mysql_sql% B% o) e6 F% r9 h
- Drivername=mysql
; y5 h' v+ a1 [: f9 F O - Database=test2 _6 p& \9 ?+ {7 S1 z
- Hostname=127.0.0.12 m% p9 W8 |! L( c I
- User_name=testuser
3 O- _" j: X8 l; ]( ^: f4 q0 V0 N - Password=my_password
e- s. R/ `: F8 u# G9 U - GetDriverFunc=getSQLDriverMYSQL% n7 s: r& W0 \2 l
- VendorLib=libmysql.dll M. A) W" q3 C' `& z1 Z$ L2 X& v
- LibraryName=dbexpmysql.dll
' ^( f% V) {# l- s6 ^" q - Active=1
: G! p; o4 Q2 G9 d- } - ---example----
' U3 p7 I! {+ n4 @% X7 x+ y5 w& m - - written 02.03.04 by pwk.linuxfan
" Q5 ?: B [; n: a7 m8 @
- ~1 s, r1 l* u5 U8 j9 N
复制代码 |
|