kiova Posted September 2, 2013 Group: Members Topic Count: 23 Topics Per Day: 0.00 Content Count: 59 Reputation: 0 Joined: 09/02/12 Last Seen: October 19, 2013 Share Posted September 2, 2013 Hello, I am looking for a script to clean up accounts, characters, items, etc. of the database in the wake of a date.Thank you very much. Quote Link to comment Share on other sites More sharing options...
Patskie Posted September 2, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 1 hour ago Share Posted September 2, 2013 (edited) To cleanup a certain table you need to execute this command to your database : TRUNCATE TABLE `table_name`; EDITED : Misunderstood your request sorry for that DELETE FROM `char` WHERE `account_id` = ( SELECT `account_id` FROM `login` WHERE DATE_FORMAT(`lastlogin`, '%Y-%m-%d') < '2013-09-03' AND `account_id` != 1 ); DELETE FROM `login` WHERE DATE_FORMAT(`lastlogin`, '%Y-%m-%d') < '2013-09-03' AND `account_id` != 1; This will delete all character and all account who are not online before 2013-09-03 ( YYYY/MM/DD ). Regarding the item i am not sure about it. In any case, do backup your database to prevent worst possible scenarios. Edited September 3, 2013 by Patskie Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted September 3, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Share Posted September 3, 2013 how about clean the whole ragnarok db in one command? Quote Link to comment Share on other sites More sharing options...
-1 Patskie Posted September 3, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 1 hour ago Share Posted September 3, 2013 how about clean the whole ragnarok db in one command? Either you drop that database DROP DATABASE `database_name`; or : TRUNCATE TABLE `auction`; TRUNCATE TABLE `cart_inventory`; TRUNCATE TABLE `char`; TRUNCATE TABLE `charlog`; TRUNCATE TABLE `friends`; TRUNCATE TABLE `elemental`; TRUNCATE TABLE `global_reg_value`; TRUNCATE TABLE `guild`; TRUNCATE TABLE `guild_alliance`; TRUNCATE TABLE `guild_castle`; TRUNCATE TABLE `guild_expulsion`; TRUNCATE TABLE `guild_member`; TRUNCATE TABLE `guild_position`; TRUNCATE TABLE `guild_skill`; TRUNCATE TABLE `guild_storage`; TRUNCATE TABLE `homunculus`; TRUNCATE TABLE `hotkey`; TRUNCATE TABLE `interlog`; TRUNCATE TABLE `inventory`; TRUNCATE TABLE `ipbanlist`; TRUNCATE TABLE `mail`; TRUNCATE TABLE `mapreg`; TRUNCATE TABLE `memo`; TRUNCATE TABLE `mercenary`; TRUNCATE TABLE `mercenary_owner`; TRUNCATE TABLE `party`; TRUNCATE TABLE `pet`; TRUNCATE TABLE `quest`; TRUNCATE TABLE `ragsrvinfo`; TRUNCATE TABLE `sc_data`; TRUNCATE TABLE `skill`; TRUNCATE TABLE `skill_homunculus`; TRUNCATE TABLE `sstatus`; TRUNCATE TABLE `storage`; TRUNCATE TABLE `login`; INSERT INTO `login` (`account_id`, `userid`, `user_pass`, `sex`, `email`) VALUES ('1', 's1', 'p1', 'S','[email protected]'); Quote Link to comment Share on other sites More sharing options...
ccjosh Posted September 3, 2013 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 66 Reputation: 6 Joined: 11/13/12 Last Seen: November 17, 2014 Share Posted September 3, 2013 Don't forget to re-create the 's' account Quote Link to comment Share on other sites More sharing options...
Patskie Posted September 3, 2013 Group: Members Topic Count: 50 Topics Per Day: 0.01 Content Count: 1702 Reputation: 241 Joined: 09/05/12 Last Seen: 1 hour ago Share Posted September 3, 2013 Don't forget to re-create the 's' account Thanks for the reminder. edited my last post Quote Link to comment Share on other sites More sharing options...
frenzmu06 Posted September 3, 2013 Group: Members Topic Count: 16 Topics Per Day: 0.00 Content Count: 326 Reputation: 47 Joined: 04/01/12 Last Seen: February 1, 2023 Share Posted September 3, 2013 @Patskie & ccjosh ok tnx ty this help alot Quote Link to comment Share on other sites More sharing options...
Question
kiova
Hello, I am looking for a script to clean up accounts, characters, items, etc. of the database in the wake of a date.
Thank you very much.
Link to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.