After deleting a slew of spam registrations, the next User ID will be a high number. Is there a way to reset it to my own value? If so, where is it stored?
Sandy
On 27/11/2007, Sandy Rozhon srozhon@oh.rr.com wrote:
After deleting a slew of spam registrations, the next User ID will be a high number. Is there a way to reset it to my own value? If so, where is it stored?
Will it be a high number? I think the user_id is just an auto-incrementing integer in the database, I'm not entirely sure how they work, but I think it gets the next number by just adding one to the highest number in the table, so if you've deleted the spam registrations, they shouldn't be taken into account. You may need to manually reset any good registrations (if any) made during or after the spam registrations, which might be quite a challenge if they've made edits, etc. but should be possible.
Nevermind! I found where the auto increment number is (user table). MySQL lets you change the value under the OPERATIONS tab.
Sandy
On 27 Nov 2007 at 18:08, Thomas Dalton wrote:
On 27/11/2007, Sandy Rozhon srozhon@oh.rr.com wrote:
After deleting a slew of spam registrations, the next User ID will be a high number. Is there a way to reset it to my own value? If so, where is it stored?
Will it be a high number? I think the user_id is just an auto-incrementing integer in the database, I'm not entirely sure how they work, but I think it gets the next number by just adding one to the highest number in the table, so if you've deleted the spam registrations, they shouldn't be taken into account. You may need to manually reset any good registrations (if any) made during or after the spam registrations, which might be quite a challenge if they've made edits, etc. but should be possible.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
-- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.503 / Virus Database: 269.16.8/1154 - Release Date: 11/27/2007 11:40 AM
On Tue, 2007-11-27 at 12:51 -0500, Sandy Rozhon wrote:
After deleting a slew of spam registrations, the next User ID will be a high number. Is there a way to reset it to my own value? If so, where is it stored?
ALTER TABLE foo AUTO_INCREMENT = 0;
David A. Desrosiers wrote:
On Tue, 2007-11-27 at 12:51 -0500, Sandy Rozhon wrote:
After deleting a slew of spam registrations, the next User ID will be a high number. Is there a way to reset it to my own value? If so, where is it stored?
ALTER TABLE foo AUTO_INCREMENT = 0;
A little note - this will define the value from which we continue incrementing. So probably you will not want to set it to null. :) Use n+1 (n=last user id) instead of that.
On Tue, 2007-11-27 at 21:57 +0200, Georgi Hristozov wrote:
A little note - this will define the value from which we continue incrementing. So probably you will not want to set it to null. :) Use n+1 (n=last user id) instead of that.
Incorrect. This will start incrementing at the next free, unused number in the sequence. Try it yourself and see.
I've used this thousands of times with various CMS systems without a single problem.
David A. Desrosiers wrote:
On Tue, 2007-11-27 at 21:57 +0200, Georgi Hristozov wrote:
A little note - this will define the value from which we continue incrementing. So probably you will not want to set it to null. :) Use n+1 (n=last user id) instead of that.
Incorrect. This will start incrementing at the next free, unused number in the sequence. Try it yourself and see.
I've used this thousands of times with various CMS systems without a single problem.
Yes, you're absolutely right. It seems that this trick with the zero is a feature in MySQL, that I hadn't known before. :) By the way, it seems that using "NULL" instead of "0" is a bit safer: "NO_AUTO_VALUE_ON_ZERO affects handling of AUTO_INCREMENT columns. Normally, you generate the next sequence number for the column by inserting either NULL or 0 into it. NO_AUTO_VALUE_ON_ZERO suppresses this behavior for 0 so that only NULL generates the next sequence number." (from http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html )
mediawiki-l@lists.wikimedia.org