Page 1 of 1
mysql database. deleting..
Posted: Sun Oct 24, 2010 10:46 am
by tomtefan
I have deleted my test chars over and over. when ever i need to test regestering from start etc..
but, how can i set the ID back to 0 (zero).
when i start a char again, it says: id 79. 80 etc.
Re: mysql database. deleting..
Posted: Sun Oct 24, 2010 4:05 pm
by Chris
Code: Select all
ALTER TABLE `table` AUTO_INCREMENT =1
Re: mysql database. deleting..
Posted: Sun Oct 24, 2010 9:18 pm
by Callan S.
I was wondering that too! Thanks Chris! Is there a way to do that manually through phpMyAdmin as well?
Re: mysql database. deleting..
Posted: Sun Oct 24, 2010 9:31 pm
by Jackolantern
Callan S. wrote:I was wondering that too! Thanks Chris! Is there a way to do that manually through phpMyAdmin as well?
It has been a while since I have used phpMyAdmin, but I know there is a way to type SQL queries directly into the GUI and execute them. I don't think I have ever had to use it before, but it would come in handy to perform that command manually.
Re: mysql database. deleting..
Posted: Mon Oct 25, 2010 9:21 am
by Chris
Yes there is.
Select your table. Then choose the 'Operations' tab along the top. Should be the 8th tab.
Then under Table options put 'AUTO_INCREMENT' to whatever you want.
Re: mysql database. deleting..
Posted: Mon Oct 25, 2010 3:02 pm
by hallsofvallhalla
good info here
Re: mysql database. deleting..
Posted: Mon Oct 25, 2010 11:46 pm
by Callan S.
Ah ha! Thanks Chris! Do you know what happens if you set it to a number already used? Does it overwrite the entry, or just keep looking until it finds an index that's empty? Just asking if you know, as I'd have to fiddle about alot (for me, atleast), to find out by experiment.
Re: mysql database. deleting..
Posted: Tue Oct 26, 2010 6:59 am
by Chris
I'm guessing it will throw an error. Not sure myself

.
Re: mysql database. deleting..
Posted: Mon Nov 01, 2010 4:37 pm
by tomtefan
hmm.. tried to delete (alter) the database manualy, but it doesnt work for me.
i put the auto increment to 1 (want the id to start from 1) and i press Go.
it loads up, and when its done it still shows the old id 86 (and rising).
I also tried to change it when i didnt have any characters in the table. still doesnt work / change for me.
any ideas ?
EDIT:
HMM, NOW it worked. weird.
