|
|
麻烦翻译一下,下面这段文章:xhan 3 k2 D4 G: j0 @- t1 p3 r
" B! Y% z. y1 E* V7 s8 y# v-
, z- C: z. l1 b' s3 z - ###### Using MySQL as Database for TeamSpeak-Server 2.0.20.1 ######0 |. Q- B9 c, f( F9 |1 P
- + }5 I; F3 |8 c# Y: {/ V+ [
- ### What we need ###
1 q/ n/ U$ Q5 w Q. R# U - Naturally, we will need a MySQL server to store the data for us, this document " ^1 ~5 b1 a, J- S0 x/ B5 R
- will not explain how this can be done - there are documents out there for the
' n7 f% x/ S% w# Q5 o8 ~ - interested. The requirements include a (empty) database for TeamSpeak to use& R* {, Z5 ^' f& x9 G: [5 ~ q
- and a user account (username + password) that has the permissions to do stuff
/ \: Z. a3 a! W- o - with the database. Additionally, you will need a vendor library installed on the V: e( i5 J- H6 |9 B9 U6 g/ D' K$ F) U
- local machine, this came with my MySQL install.
; @0 F7 ~* c9 k5 }# o5 o# [ - These instructions will not tell you how you might transfer your data from the$ Q* _& ~! E5 ~3 t/ @8 W& x" P( v7 ?
- SQLite database to the MySQL database, we start with a clean and empty MySQL. ]' V" E4 ?- \4 y- X2 [
- database.1 C- P7 c/ v/ t1 h
- Some users have reported ways to import a SQLite database into MySQL, but at0 U$ p% Q2 b7 h
- the time of writing, there are still too many issues - check the current status
% D0 J4 V9 X* x - in the TeamSpeak forums if you are interested.
. J* m+ W9 J/ M4 T1 @( f% Y8 N - NOTE: To allow TeamSpeak to access the MySQL database the dbExpress driver from9 a$ t- r3 I/ l2 J8 E. |3 o5 }+ H
- Borland was used. This driver can only interface with the client library that
3 w& N0 M. ~ e4 c4 [* I' H/ _ - comes with MySQL 3.x. It is possible to access a MySQL 4.x database with this
% q) J- V; U7 E& ? - client library - basically all you have to do is to use a 3.x client library as ; |% B3 Z- j% |% ~) W$ k( j
- "VendorLib" and a 4.x database to connect to.
1 O6 W. r$ h3 ]0 c' ~; w2 C$ I" ]' q - If you need more info about dbExpress, you can contact Borland.
2 Y; \: e$ w! w; d/ O% S, l& ^/ t
! V# d7 Y. R. w+ K- ### Doing the work ###6 |9 D- a; H1 F' ?) C
- Setting up TeamSpeak to use MySQL (should) be straight forward once you have all
. C! _; c) G3 I* t! @ V - the perquisites right, just open your server.ini file, and add this section at+ O2 f% s8 I) x. x4 p
- the end:' j/ R* }9 O+ G( ~9 w4 `
- ---cut here---
6 E. u8 y& }1 r, K! @ - [DBEXPRESS]3 x ^7 h5 _1 `) I
- sqldir=mysql_sql
9 b1 R9 x$ L( W/ @: E+ p4 Z; E0 R - Drivername=mysql
' j- s, W- n0 b$ O7 h) h. |4 | - Database=Your_Database_Name_Here
; O, m& x2 ^9 J/ E* W% [! j - Hostname=The_PC_the_MySQL-Server_is_on
2 } M; @ a* |5 i; x* J - User_name=User_name_on_the_MySQL-Server
6 E+ I6 z( x( n1 F - Password=Password_to_go_with_above_user_name: B: S( z& G; A. C" X
- GetDriverFunc=getSQLDriverMYSQL
' p' K; \* D1 s& [7 ^4 p - VendorLib=path_pointing_at_your_mysql_vendor_lib' @: K$ k1 i/ l. A. y
- LibraryName=path_to_libsqlmy_libary
( S" Y; N3 u5 s9 J0 m! G - Active=18 Z% i k' q1 u9 _: d( e
- ---cut here---
9 K4 |7 k. q' @% k - In my environment (a linux box with a MySQL server running locally) I have:
3 a1 P0 R% U( t5 q) c' _ o0 d - ---example---
' e) D1 q( K9 N' ~9 w f - [DBEXPRESS]9 K6 t+ S5 c9 F+ d) ?; {; P
- sqldir=mysql_sql5 Q9 ]4 `6 u: L
- Drivername=mysql. D9 P" ]* r, t! V+ x
- Database=test
8 {- N/ x( j# `* V - Hostname=localhost4 L* f: u( N5 c
- User_name=testuser4 k/ e0 p5 m5 p& }& V
- Password=my_password) ]# d$ a2 q: f9 e9 v0 D c
- GetDriverFunc=getSQLDriverMYSQL- H' k! n, s' C
- VendorLib=/usr/lib/libmysqlclient_r.so.10.0.0
2 r% k7 c& U4 B$ E% B ^8 S - LibraryName=./libsqlmy.so v0 L4 ?& v; N: ]5 X
- Active=19 B1 B% B# _. o8 x9 r% X7 e
- ---example---& p4 |8 R$ d" C/ h, S3 u/ p
- , ?3 P- f1 }/ g( w3 ~
- On a windows box, also running the MySQL server locally, it would be:- f0 M H( j1 e: i! g
- ---example---
% M: G8 t1 Q2 V - [DBEXPRESS]
3 [; O2 K8 ?9 Y/ V2 S - sqldir=mysql_sql
& ~1 I2 J9 `0 \1 H! u# W - Drivername=mysql+ q; s) ~6 L: C6 G6 c9 H
- Database=test
' V% o6 }7 m2 f$ k7 y - Hostname=127.0.0.1
' V' l' [; m# @" M - User_name=testuser
$ L @) `* o E% Y) y6 x. D - Password=my_password
5 n; Q& X+ k- A9 z/ K" S8 x - GetDriverFunc=getSQLDriverMYSQL
: X- Q7 z- N% c' N5 a# A$ j - VendorLib=libmysql.dll
6 _) y1 [7 r" e4 T9 k4 Z - LibraryName=dbexpmysql.dll& Y& N4 Z5 c2 f" d- ~
- Active=1) a* A+ E$ G4 I3 [
- ---example----
4 g. q5 Q- n$ [! Z$ O. v - - written 02.03.04 by pwk.linuxfan3 n! n, [9 z/ l- J8 h9 p1 @, v
. j; t# O- X4 ~
复制代码 |
|