|
You last visited: Today at 10:19
Advertisement
[SQL Question]Database cleanup
Discussion on [SQL Question]Database cleanup within the Dekaron Private Server forum part of the Dekaron category.
08/25/2009, 18:45
|
#1
|
elite*gold: 0
Join Date: Oct 2008
Posts: 83
Received Thanks: 15
|
[SQL Question]Database cleanup
so i am trying to perform my own databse cleanup(as i and about 4 other people have already mad a char with the existing db) but everytime i try to delete all account but ours they are all gone...i know verry little about SQL but this should be pretty simple should it not...this is what query i am running on the account database:
delete * from tbl_user where user_no<>firstnumber or user_no<>secondnumber or user_no<>thirdnumber or user_no<>fourthnumber
but all accounts are gone even the ones with said user numbers....i'm sure i will probably get flamed for this but i tried all day yesterday and everytime it got ride of everything...i tired putting the numbers between '',using != instead of <> even tried using the user id's instead....if i do a select query for user_no = to what i want then it works...but if i say <> then i get all records returned
any ideas?
edit:I could just delete all account and have everyone create a new account then move chars over but i should be able to just delete all accounts but the ones i want to keep....
|
|
|
08/25/2009, 19:15
|
#2
|
elite*gold: 115
Join Date: Oct 2007
Posts: 9,390
Received Thanks: 12,345
|
I haven't done much with SQL either, but I think I've found the error in your query.
Try this:
Code:
delete from tbl_user where user_no!=[i]firstnumber[/i] and user_no!=[i]secondnumber[/i] and user_no!=[i]thirdnumber[/i] and user_no!=[i]fourthnumber[/i]
|
|
|
08/25/2009, 19:25
|
#3
|
elite*gold: 0
Join Date: Oct 2008
Posts: 83
Received Thanks: 15
|
thank you for your reply
i will try that but my understanding of and,or was this...using or it will test each condition on each record that it reads...using and i will combine the conditions and check against records....so i'm not sure this will work either....maybe sql does not treat and,or this way..?
|
|
|
08/25/2009, 20:15
|
#4
|
elite*gold: 115
Join Date: Oct 2007
Posts: 9,390
Received Thanks: 12,345
|
If you use or, only at least 1 condition needs to be true. If you use and, all conditions need to be true.
That also explains why all accounts got deleted when you used or.
|
|
|
08/26/2009, 01:04
|
#5
|
elite*gold: 20
Join Date: Nov 2007
Posts: 2,854
Received Thanks: 1,891
|
why you keep posting the same stuff in here then in R a g e z o n e ???
|
|
|
08/26/2009, 02:31
|
#6
|
elite*gold: 0
Join Date: Oct 2008
Posts: 83
Received Thanks: 15
|
different forums different peeps....more chance to get a good answer....why do u care?
|
|
|
08/30/2009, 07:16
|
#7
|
elite*gold: 0
Join Date: Jul 2009
Posts: 29
Received Thanks: 8
|
I have been using this script to clean up the whole Character database with the exception of the DEV characters. NOTE: the DEV characters are needed to create a new character. The server grabs the info in the DEV account a copies it over to your new char. Without them, this process fails. Anyways the second reply is correct, but also remember you can clean up the user bag, suit, store.... All you need to know is the "character_no". You can also use this script to clean the account DB, just change the fileds. WARNING: The script also deletes the guilds along with some other stuff. Read the script a little before you run it.
***EDIT: added MASTERCODE to guild_info and guild_peerage. Without these you will not be able to create guilds.
Open any table in the character DB then click on the SQL button. Remove SELECT * FROM theTableYouAreIn, paste the section below, then click on the !
DELETE FROM user_character
WHERE (character_no NOT IN ('DEKARON0000001', 'DEKARON1000001', 'DEKARON2000001', 'DEKARON3000001', 'DEKARON4000001', 'DEKARON5000001'))
DELETE FROM GUILD_CHAR_INFO
DELETE FROM GUILD_INFO
WHERE (guild_code NOT IN ('MASTERCODE'))
DELETE FROM GUILD_INFO_SECEDE
DELETE FROM GUILD_PEERAGE
WHERE (guild_code NOT IN ('MASTERCODE'))
DELETE FROM user_bag_copy
WHERE (character_no NOT IN ('DEKARON0000001', 'DEKARON1000001', 'DEKARON2000001', 'DEKARON3000001', 'DEKARON4000001', 'DEKARON5000001'))
DELETE user_bag_secede
WHERE (character_no NOT IN ('DEKARON0000001', 'DEKARON1000001', 'DEKARON2000001', 'DEKARON3000001', 'DEKARON4000001', 'DEKARON5000001'))
DELETE user_character_secede
WHERE (character_no NOT IN ('DEKARON0000001', 'DEKARON1000001', 'DEKARON2000001', 'DEKARON3000001', 'DEKARON4000001', 'DEKARON5000001'))
DELETE USER_POSTBOX
DELETE USER_POSTBOX_SECEDE
DELETE user_storage_copy
WHERE (character_no NOT IN ('DEKARON0000001', 'DEKARON1000001', 'DEKARON2000001', 'DEKARON3000001', 'DEKARON4000001', 'DEKARON5000001'))
DELETE USER_STORE_copy
WHERE (character_no NOT IN ('DEKARON0000001', 'DEKARON1000001', 'DEKARON2000001', 'DEKARON3000001', 'DEKARON4000001', 'DEKARON5000001'))
DELETE user_suit_copy
WHERE (character_no NOT IN ('DEKARON0000001', 'DEKARON1000001', 'DEKARON2000001', 'DEKARON3000001', 'DEKARON4000001', 'DEKARON5000001'))
|
|
|
03/02/2011, 18:57
|
#8
|
elite*gold: 0
Join Date: Nov 2007
Posts: 6
Received Thanks: 0
|
Thank you Fatty!
I have been searching for this (: i am not so good at sql, i am better with editing files xD (Easy i kno xD) but still ty!
|
|
|
03/02/2011, 20:02
|
#9
|
elite*gold: 0
Join Date: Jan 2009
Posts: 142
Received Thanks: 23
|
cheers you bumped up a 2 years old topic
|
|
|
03/03/2011, 00:02
|
#10
|
elite*gold: 35
Join Date: Aug 2009
Posts: 5,822
Received Thanks: 1,958
|
#closed
|
|
|
 |
Similar Threads
|
[Question] Database
03/11/2010 - EO PServer Hosting - 8 Replies
Is there a script that you can run to clean out your database. I've noticed there is a lot of things left over from the previous owner.
|
DK Database question
08/12/2009 - Dekaron Private Server - 0 Replies
while trying to help someone fix a prob i ran into something that i would like to get clarification on if anyone knows. in the billing database in table user_account what is the point of the remain_time remain_freetime and the expiration. i assumed that an account with 0 remain time and expired date that has passed would not be able to login. but that does not seem to be the case.....
|
question about getting database
05/25/2009 - SRO Private Server - 10 Replies
Hi all,just wondering how people gets original database from Sro,i mean they pay for it?they stole it?
People from ecsro made it,but they donīt have the whole thing,so that make me guess they just stole it or something.
Wanna know your opinnions :mofo:
|
Cleanup?
04/04/2008 - Dekaron - 8 Replies
Can we request a cleanup of the 2moons hack sections, or maybe just a thread that lists current working hacks for the BMR patch, so we dont have to go searching everywhere in the planet for them if/when they are created and released. Just an idea.
|
Forum cleanup
06/13/2006 - Conquer Online 2 - 24 Replies
I was wondering, who else would like the forums to be cleaned up, basicaly all posts reset, we can pin the new bots, I cant find anything I look for so I know its the same for everyone else. So maybe we could let the Epvpers vote on a forum reset, then repost bots. We can tell by Karma who posted what bots before so noone steals credit ^^
|
All times are GMT +1. The time now is 10:20.
|
|