|
|
麻烦翻译一下,下面这段文章:xhan 7 U& E2 ]+ V1 W8 m
N4 {/ \% ^" U) B
-
, \+ z& ]3 J- L* `! L# | - ###### Using MySQL as Database for TeamSpeak-Server 2.0.20.1 ######+ P. ]. [5 o& V8 ?! _0 c
) H# O9 ~. c: p- ### What we need ###
: l" e4 A8 {) ^ ]1 a0 x) V! L - Naturally, we will need a MySQL server to store the data for us, this document
! o+ e, o# c8 G% u( |% Z - will not explain how this can be done - there are documents out there for the
) t% D0 f2 X% u& V, B - interested. The requirements include a (empty) database for TeamSpeak to use
; k% X/ x2 j3 e/ n" Y- o' } J" j+ x0 B1 X - and a user account (username + password) that has the permissions to do stuff
0 v% t# f5 v; o- ]1 P* @! g - with the database. Additionally, you will need a vendor library installed on the
A' t5 e/ L8 y& T8 W* B q2 `, a - local machine, this came with my MySQL install.
3 Y9 h. S. h, V% j0 L - These instructions will not tell you how you might transfer your data from the
5 Z" ]- W9 j& e' r' ^, k( s - SQLite database to the MySQL database, we start with a clean and empty MySQL8 f! D( h3 {) W6 Z3 |- h+ |) {' x7 f
- database.
# u+ g6 U7 J0 i! w$ _! b% ]- k - Some users have reported ways to import a SQLite database into MySQL, but at
: I& R7 E8 M+ R; \, { - the time of writing, there are still too many issues - check the current status
, G& X6 \5 P% \% D5 R4 h - in the TeamSpeak forums if you are interested.9 W5 b% B* u: ^! d) w
- NOTE: To allow TeamSpeak to access the MySQL database the dbExpress driver from* Q& e! q5 D5 X& C$ o! T
- Borland was used. This driver can only interface with the client library that
4 m* N2 ]. ~9 J& N' i* d! D7 z - comes with MySQL 3.x. It is possible to access a MySQL 4.x database with this: R" S, t0 R _/ `/ C
- client library - basically all you have to do is to use a 3.x client library as 8 S. l# B3 u" m( K6 A
- "VendorLib" and a 4.x database to connect to.
& c* K! u4 j2 E" _ d) o. Y( l - If you need more info about dbExpress, you can contact Borland.
, X. ]0 w8 ]0 ?$ O% i - & o2 I, ?1 V7 e2 q" F
- ### Doing the work ###
: `4 W. Q6 C7 J, G. J - Setting up TeamSpeak to use MySQL (should) be straight forward once you have all j: ? w) `1 }7 _7 P7 u+ O1 V1 l
- the perquisites right, just open your server.ini file, and add this section at/ x1 @7 L- [8 L4 Z; T
- the end:
- k& l* V" {1 w4 a* o ] - ---cut here---- a6 |- R9 L, x' x; H3 ~
- [DBEXPRESS]0 J% ~0 X4 m9 p" D* S
- sqldir=mysql_sql
) O" p, G3 ?. e- f - Drivername=mysql
( y" U8 T5 E8 T/ A8 i - Database=Your_Database_Name_Here j L, b' [5 o/ _! U. {
- Hostname=The_PC_the_MySQL-Server_is_on
, m0 U7 a# g3 @ - User_name=User_name_on_the_MySQL-Server# `; {- W% v3 j9 r: `+ E6 e
- Password=Password_to_go_with_above_user_name
6 Z5 u" @) p' g - GetDriverFunc=getSQLDriverMYSQL1 |, G; Z( N% Z B- o! O, t8 U
- VendorLib=path_pointing_at_your_mysql_vendor_lib
1 f" c+ ]/ X# c - LibraryName=path_to_libsqlmy_libary7 N% R# Z- N6 {
- Active=1
; M i- K0 Y6 r/ x. p6 U- H - ---cut here---9 ^' l4 Z$ u2 X
- In my environment (a linux box with a MySQL server running locally) I have:
/ K, x, b3 Z* e5 d% B( H3 ?) D - ---example---; J/ \( E5 ~) ~) S- o' }$ H m
- [DBEXPRESS]
1 r6 B$ H3 x: E# L - sqldir=mysql_sql, j( |6 P$ ]; u% a3 V0 v
- Drivername=mysql
4 s) T) i1 B9 R6 W6 ]# ^4 y - Database=test
& u q! D% s8 s* C5 T - Hostname=localhost5 a" B* e: o; t) M
- User_name=testuser
! P( U. U/ } K0 w* ~ - Password=my_password
2 l$ d& S/ X* s5 S" m+ {( J - GetDriverFunc=getSQLDriverMYSQL4 ^: `; Q% G1 n
- VendorLib=/usr/lib/libmysqlclient_r.so.10.0.0
3 ~* q% [9 M/ n; A" E5 `, Z - LibraryName=./libsqlmy.so3 V9 _1 ~3 ? {9 [
- Active=1
6 R9 V; z2 `) K/ C% L7 u8 [ - ---example---
; Y Y* T# c$ t& T4 z0 h* f - " L( k3 R. C/ ]3 z; ~( X! U' `- G
- On a windows box, also running the MySQL server locally, it would be:7 j' Z/ A# u0 }/ A/ z
- ---example---
- _9 r( b& F/ \; K( f) E - [DBEXPRESS]
1 T: U3 A0 ?$ ]- q; e- z, A - sqldir=mysql_sql- Z6 d# p* q. }) K7 S! D
- Drivername=mysql
- _. [) A+ E! T; y - Database=test$ S8 J$ M; Q( H0 n" j
- Hostname=127.0.0.15 ^4 y6 b, y+ \8 j
- User_name=testuser
2 S8 j# Z) o+ `: S4 u8 _- u/ p2 T - Password=my_password; \3 B6 l7 ^! W7 v0 m; `' i; N
- GetDriverFunc=getSQLDriverMYSQL
( y- ]0 k8 \, l/ d- e; d7 \7 g2 W; D& | - VendorLib=libmysql.dll: i5 |' n" d1 A$ t" O
- LibraryName=dbexpmysql.dll w+ o$ n! A7 q
- Active=1. }+ a5 M1 _+ c1 k9 x" M
- ---example----
( e, M4 D5 t/ I7 S) Z+ l' G - - written 02.03.04 by pwk.linuxfan( J7 h0 u- V! o% M( B
- ' r7 R% a: F; h/ i
复制代码 |
|