PDA

View Full Version : A topic more about MySQL4.1


ToW
27-11-2005, 23:00
After much grief I have gotten TS2 to work with MySQL 4.1.12, but not yet error free in the logs.

Here is what I did and what I am using.
OS: CentOS 4.2 Linux 2.6.x
MySQL RPMS
>mysql-4.1.12-3.RHEL4.1
>mysqlclient10-3.23.58-4.RHEL4.1
>MySQL-shared-compat-4.0.25-0
These can be obtained via YUM
ts2_server_rc2_20201.tar.bz2

Steps:
Remove the password for sql-user teamspeak using webmin/shell/mysqladmin or similair tool and set it as
SET PASSWORD FOR '<mysqluser>'@'<host>' = OLD_PASSWORD('<password>'); as IceMatrix (http://member.php?u=105976) posted here: http://forum.goteamspeak.com/showthread.php?t=27200

drop the tables in your teamspeak-database (unforturnally I didnt find a way to avoid this) :(

Then do as mokum (http://member.php?u=90247) posted here http://forum.goteamspeak.com/showthread.php?p=114582#post114582
in ./mysql_sql/read_servers.sql replace the content with
select * from ts2_servers WHERE i_server_id > 0;
and in ./mysql_sql/read_channel_privilege.sql replace everything with
select * from ts2_channel_privileges where i_cp_server_id = :iServerID and i_cp_channel_id = :iChannelID and i_cp_client_id = :iClientID

then copy /usr/lib/mysql/libmysqlclient_r.so.10.0.0 to your TS2 dir (on linux "cp /usr/lib/mysql/libmysqlclient_r.so.10.0.0 /path/to/teamspeak")
You can properly remove the mysqlclient10-3.23.58-4.RHEL4.1 rpm now unless you need it for other things.

edit your server.ini accordingly (see example)
[DBEXPRESS]
sqldir=mysql_sql/
Drivername=mysql
Database=teamspeak-database
Hostname=localhost
User_name=sql-user-username
Password=sql-user-password
GetDriverFunc=getSQLDriverMYSQL
VendorLib=./libmysqlclient_r.so.10.0.0
LibraryName=./libsqlmy.so
Active=1

start teamspeak as a non-root user.

These steps brought my TS2 up and running smoothly

I am getting some errors in the server.log which I dont understand / knows why / how to fix.
ERROR,All,SQL, ExecSQL Error: EDatabaseError.MyISAM table 'ts2_servers' is in use (most likely by a MERGE table). Try FLUSH TABLES. in query: CREATE TABLE `ts2_servers` (
`i_server_id` int(11) NOT NULL auto_increment,
`s_server_name` varchar(40) default NULL,
`s_server_welcomemessage` varchar(80) default NULL,
`i_server_maxusers` int(11) default NULL,
`i_server_udpport` int(11) default NULL,
`s_server_password` varchar(80) default NULL,
`b_server_clan_server` int(11) default NULL,
`b_server_allow_codec_celp51` int(11) default NULL,
`b_server_allow_codec_celp63` int(11) default NULL,
`b_server_allow_codec_gsm148` int(11) default NULL,
`b_server_allow_codec_gsm164` int(11) default NULL,
`b_server_allow_codec_celp52` int(11) default NULL,
`b_server_allow_codec_speex2150` int(11) default NULL,
`b_server_allow_codec_speex3950` int(11) default NULL,
`b_server_allow_codec_speex5950` int(11) default NULL,
`b_server_allow_codec_speex8000` int(11) default NULL,
`b_server_allow_codec_speex11000` int(11) default NULL,
`b_server_allow_codec_speex15000` int(11) default NULL,
`b_server_allow_codec_speex18200` int(11) default NULL,
`b_server_allow_codec_speex24600` int(11) default NULL,
`s_server_webposturl` varchar(200) default NULL,
`s_server_weblinkurl` varchar(200) default NULL,
`b_server_active` int(11) default NULL,
`dt_server_created` varchar(20) default NULL,
`s_server_description` varchar(100) default NULL,
PRIMARY KEY (`i_server_id`)
) TYPE=MyISAM
Maybe you know why I am getting these errors?


On that note, its way past my bedtime, I hope I helped someone and that someone can help me :)

PS: Since more and more people are upgrading to MySQL4/5 then I dont understand why the TS devel team doesnt release a new build of TS2 with support for
libmysqlclient_r.so.14.x (yes yes I know they are busy busy busy with TS3, for a small build upgrade for TS2 cant take that many minutes to do?)

mrdeath
28-11-2005, 01:27
Hi.

I followed your example but I have the following system;

TS Version: v2.0.r21.b3 Linux
Server: FreeBSD 6.0
MySQL: 5.0.15

(and I applied software accordingly)..

But I only get this error in the server.log file;
28-11-05 01:03:31,ALL,Info,server, Server init initialized
28-11-05 01:03:31,ALL,Info,server, Server version: 2.0.21.3 Linux
28-11-05 01:03:31,ERROR,All,SQL, Database initialization error: EDatabaseError.dbExpress Error: Invalid Username/Password
28-11-05 01:03:31,ERROR,All,SERVER, Start_Server: unable to open database

Then I rememberd a tips that I had seen in the forums about using 127.0.0.1 instead of “localhost”.. this is my mysql setting in server.ini;

[DBEXPRESS]
sqldir=./mysql_sql/
Drivername=mysql
Database=teamspeak
Hostname=127.0.0.1
User_name=db_user
Password=db_password
GetDriverFunc=getSQLDriverMYSQL
VendorLib=./libmysqlclient.so.10.0.0
LibraryName=./libsqlmy.so
Active=1

Now the server started up correctly with MySql =) (for me)..

best regards


PS. I don’t know if it helped that I created the tables manually;
mysql --user=db_user –pdb_password teamspeak < ./mysql_sql/create_settings.sql (on all “create_*.sql” files).

ToW
29-11-2005, 21:38
OK so those errors i got was really messing up TS2, but I think I got the solution this time.

My steps this time (still unable to use the old database I did: (remember this is via SSH!)
I've used webmin to remove the teamspeak user's password (i forgot the raw sql command to do so) :(

as user 'teamspeak'
(# = note and $ = command)
# backup my settings and the mysql3.23 lib
$ cp teamspeak2/server.ini teamspeak2/libmysqlclient_r.so.10.0.0 ./

# delete old ts2 dir
$ rm -rf teamspeak2

# untar ts2
$ tar -jxf ts2_server_rc2_20201.tar.bz2

# rename to my prefered folder name
$ mv tss2_rc2 teamspeak2

# move the 2 backed up files back to appropriate dir
$ mv server.ini libmysqlclient_r.so.10.0.0 teamspeak2

# change dir to teamspeak2
$ cd teamspeak2

# edit read_servers.sql
# and repalce its content with select * from ts2_servers WHERE i_server_id > 0;
$ pico mysql_sql/read_servers.sql

# edit mysql_sql/read_channel_privilege.sql too
# and replace all its content with select * from ts2_channel_privileges where i_cp_server_id = :iServerID and i_cp_channel_id = :iChannelID and i_cp_client_id = :iClientID
[/b] # note that this is 1 long line, do NOT split it up as in the original !!
$ pico mysql_sql/read_channel_privilege.sql

# edit server.ini
# and set my new database-name
$ pico server.ini
Database=new_db
# access mysql as user "root"
$ mysql -u root -p
********

# delete the password for user teamspeak
# and set it again with this command
mysql> SET PASSWORD FOR '<mysqluser>'@'<host>' = OLD_PASSWORD('<password>');

# quit mysql
mysql> quit

# access mysql as user "teamspeak"
$ mysql -u teamspeak -p
********

# create a new database
mysql> CREATE DATABASE new_db;

#quit mysql
mysql> quit

# as root check that /etc/my.cnf has old_passwords set to '1' in the [mysqld] section
$ cat /etc/my.cnf

# if not then edit the file
# and change the value to '=1'
$ pico /etc/my.cnf

# as root restart mysql
$ /etc/init.d/mysql restart
# note some versions are named 'mysqld' and not 'mysql'

# exit from root state

# start ts2 as user teamspeak
$ ./teamspeak2-server_startscript start

Your TS2 server should now be fully functional and the log error free even if you restarts it or if a user leaves and comes back he still have his privileges.

_
Happy Chatting :)


-------------- log started at 29-11-05 14:46 -------------
---------------------------------------------------------------
29-11-05 14:46:26,ALL,Info,server, Server init initialized
29-11-05 14:46:26,ALL,Info,server, Server version: 2.0.20.1 Linux
29-11-05 14:46:26,WARNING,Info,SQL, created table ts2_servers
29-11-05 14:46:26,WARNING,Info,SQL, created table ts2_server_privileges
29-11-05 14:46:26,WARNING,Info,SQL, created table ts2_channels
29-11-05 14:46:26,WARNING,Info,SQL, created table ts2_channel_privileges
29-11-05 14:46:26,WARNING,Info,SQL, created table ts2_clients
29-11-05 14:46:26,WARNING,Info,SQL, created table ts2_bans
29-11-05 14:46:28,ALL,Info,server, Starting VirtualServer id:1 with port:8767
29-11-05 14:46:28,WARNING,Info,SERVER, Default VirtualServer created
29-11-05 14:46:28,WARNING,Info,SERVER, admin account info: username: admin password: ******
29-11-05 14:46:28,WARNING,Info,SERVER, superadmin account info: username: superadmin password: ******
29-11-05 14:46:29,ALL,Info,server, Server init finished
29-11-05 14:46:29,WARNING,Info,server, TeamSpeak Server daemon activated