PDA

View Full Version : MySQL manipulation


DeeCo
18-03-2004, 23:16
Hi,

Does any body know what command to run on the mysql database, so that all current server admins could be removed ?


i have a large server and rather than having to manually edit all the users and remove the SA status, I was hoping it could be done via the Databse.

The TCP query port doesn't allow wildcard selction on user attribs command :(


any help much appreciated.

madcat
18-03-2004, 23:32
With this command you can check who is an admin

select * from ts2_clients where b_client_privilege_serveradmin = -1 and i_client_server_id =1 ;
and with this command you can check who is super admin:
select * from ts2_clients where b_client_privilege_serveradmin = -1 and i_client_server_id =0 ;

so with this command you can delete all admins
DELETE from ts2_clients where b_client_privilege_serveradmin = -1 and i_client_server_id =0 ;
and all super admins
DELETE from ts2_clients where b_client_privilege_serveradmin = -1 and i_client_server_id =1 ;

use the delete option with CAUTION !!
ps: i'm not respondsable if i made a mistake :)

backup your database first, before fucking around!

DeeCo
18-03-2004, 23:41
Many thanks, I'll give it a whirl :)

I'll have a go at making a php/mysql admin section were you can use tick box's to select what to do,


n00b skillz :D

madcat
19-03-2004, 15:09
Originally posted by DeeCo
Many thanks, I'll give it a whirl :)

I'll have a go at making a php/mysql admin section were you can use tick box's to select what to do,


n00b skillz :D


you also can download and install phpmyadmin, it's very easy to use !

DeeCo
20-03-2004, 18:26
suppose :)

some one did

DELETE from ts2_clients where b_client_privilege_serveradmin = -1

and "accidently" did this.

I found out it actaully deletes the accounts of all players with SA status and ALL superadmins as well !

Now is it posible to add the SuperAdmin account back ?
Tried start stop, recreate servers etc, but under it wont recreate the Superadmin account, or give me a password now :(

Is there a way to add the superadmin back ?

DeeCo
20-03-2004, 18:43
double post

madcat
20-03-2004, 23:04
Originally posted by DeeCo
suppose :)

some one did

DELETE from ts2_clients where b_client_privilege_serveradmin = -1

and "accidently" did this.

I found out it actaully deletes the accounts of all players with SA status and ALL superadmins as well !

Now is it posible to add the SuperAdmin account back ?
Tried start stop, recreate servers etc, but under it wont recreate the Superadmin account, or give me a password now :(

Is there a way to add the superadmin back ?

it's very simple, put the backup you made back!
you did made a backup right? if not i'm going to laugh very loud!
i DID warn you about it.

edit:
oh well i will get you started use "insert into" or "update"
the rest you need to figure out yourself, so you learn not to make mistakes again. you will learn to walk if you have felt many times.
use http://www.mysql.com/documentation/ for more information