PDA

View Full Version : Chracter Database Cleanup


GreatSageCorban
04-28-2004, 02:47 AM
I was wondering if anyone knew of a database cleanup wizard of some sort. Basically what I'm looking at is I've deleted Characters from character_ and accounts from the account database (lets say id 1) as well as removing their inventory from the inventory database. When new people join, their ID's don't fill in the the now empty slot at id 1, they continue on from a different end point.

If there is no clean up wizard, I was wondering if I could get the db's that I need to cleanup myself to fix this.

I know I need accounts, inventory, and chracters_ , what other one's do I need to check?

smogo
04-28-2004, 03:20 AM
mysql still uses old autoincrement counter. Dump table contents, drop tables, then reload account and chars. Should do it.

GreatSageCorban
04-28-2004, 05:03 AM
What about inventory? it links up with the characters via character id, wouldn't I have to remodify the inventory to reconnect to the right characters? or do the users maintain their original id's, it's just MySQL will fill in the gaps once the tables have been dumped, and imported.

smogo
04-28-2004, 05:40 AM
i'm not sure to get what you want to do exactly.

If you just want to get a clean start for once, just drop all 3 tables (accounts, character_ and inventory, plus char and corpse backup) and start over on fresh clean tables, creating admin account. It'll start from id 1 on all tables, and no char/account/inventory pbs

If you plan to make a system to backup char info, tweak database, then reinsert char info ... well it's a bit harder. i could only advise you to backup every step :/

Basically, if you want to remove only some old account or chars, just delete the rows, and let mysql skip over the empty slots. It's the RDBMS engine's job to access rows equally fast whether contiguous id or not.

GreatSageCorban
04-28-2004, 05:50 AM
Well I'm just trying to keep a clean user account without confusing the database. For example if I were to remove an account, but then have someone else jump in to the same character ID I would want to prevent MySQL from confusing who's inventory is connected to what chracter, or what character is connected to what account, ect. I basically ran into an issue recently where the profile <BLOB> for one character looked as if it was carrying information for a different character. This is what prompted me to delete a few unused accounts, and attempt to cleanup the database. I was also running into errors when exporting, and importing the character_ database. It maybe that 5.6's item depoping is causing a temporary corruption in the database. I don't know.

devn00b
04-28-2004, 05:54 AM
As already stated it WILL NOT create a usser account over one you have deleted. it auto increments from the last created user

IE:

you have users 1,2,3,4,5,6,7,8

you delete 2,5,7..

new user creates char..guess what...it makes the user id 9, then 10 , then 11

so no worries.

GreatSageCorban
04-28-2004, 06:01 AM
Which leaves me then questioning how the <BLOB> for one character ended up with the <BLOB> for another. Well, for now I won't worry about it until it happens again. At that point I can post screen shots of exactly what I'm talking about. :) Thanks for your help. :)