The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
MYSQL change user id manually
heyo, i was wandering threw my vast vast vast database looking at the user table, i went in, clicked on browse,
now, user #1 is obously the person who installed vb... and i need to change his userid form 1 to my user id (4). i tryed doing that in my spot, but when i did, all that happened was my username was changed to user#1's name if that makes any sence... if not, ill try 2 explain it a bit more basiclly i need 2 change the userids |
#2
|
|||
|
|||
[sql]UPDATE user
SET userid = '1' WHERE userid = '4';[/sql] [sql]UPDATE user SET userid = '4' WHERE userid = '1' AND username= 'username';[/sql] The above two queries should work, I didn't test them. And I also don't know how this will affect your board. So be warned, and I would test it on a test board before you do it. And Change 'username' with the username of the user you want to switch. |
#3
|
|||
|
|||
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table user
SET userid = '1' WHERE userid = '2'' at line 1 |
#4
|
|||
|
|||
Quote:
|
#5
|
|||
|
|||
lol, whoops, and i thought i copyed it /;
SQL-query : UPDATE user SET userid = '1' WHERE userid = '4' MySQL said: #1062 - Duplicate entry '1' for key 1 and shouldent i have the username 4 teh first 1 aswell? |
#6
|
|||
|
|||
The username isn't needed for the first one since there are not duplicate user-ids. For the second one however, you do need it to prevent the error your getting know.
|
#7
|
|||
|
|||
lol, and how would i fix it?
do i out them both in? im only putting in the first 1 should i do both? and what username do i put in? mine or the other 1? |
#8
|
|||
|
|||
Hm...it seems the userid field must be unique. You can try first setting the user with userid 1 to have a userid that doesn't exist, then change yours to userid 1, and then change his to 4. But I don't know what effect this would have on the database and the auto_increment. Why do you need to this anyway?
|
#9
|
|||
|
|||
i just to be #1 thats all i was on our old site... but he installed vb, (and is nolonger active)
and doing that... wouldent that change all the users posts... llike swttch em around? al user 1's posts becoume user #4 posts... so on? |
#10
|
|||
|
|||
Quote:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|