The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Remove ICQ/MSN/YAHOO/BIO etc. of around 1600 users via Phpmyadmin.
I was just working on a forum setup few years ago.. then took offline.
It has around 1540 users. (mostly spammers) I dont want to delete those members. Is there anyway I can remove there ICQ/MSN/BIO/INTERESTS and other details directly via PHPMYADMIN ? Thanks. |
#2
|
|||
|
|||
You should be able to do something like this:
Code:
UPDATE user SET msn='', icq='' Code:
UPDATE userfield SET field1='', field2='', field3='', field4='' As always, you should make sure you have a database backup before modifying the database directly, just in case. Edit: you could also add "WHERE usergroupid=X" to do it only for a certain group, if you have other users (admins and mods) that you don't want to change. |
#3
|
||||
|
||||
Dear kh99,
You saved me lot of time... I want to few more advanced things if possible. 1. Change username of those users from xyz2 to abc1 Can i directly edit this from phpmyadmin ? Opening the DB in phpmyadmin and changing the usernames for faster process. 2. Can I also change passwords of this usergroups to something UNIQUE ? Change passwords for all users to XXYYZZ1122. I tried to setup this password in PHPMYADMIN, but that wont help me login. (gives wrong password) Regards, |
#4
|
|||
|
|||
I can't think of any reason offhand that you couldn't change the username field directly, except that I think there are other tables that have a username field (like the thread last poster) that won't be changed.
You should be able to change the password, but it's hashed. I think you'd need to do something like: Code:
UPDATE user set password=MD5(CONCAT(MD5('XXYYZZ1122'),salt)) but I haven't tested this. Be careful because as I'm sure you're aware, if it doesn't work you won't be able to log in either (unless you add a WHERE so that your password isn't changed). |
#5
|
||||
|
||||
Dear kh99,
Thanks again for keeping with me and your quick answers. The database only has users NO CONTENT/NO POSTS/NO THREADS.. I dont want to delete all the users, as those were registered few years ago.. and its from a VERY UNIQUE NICHE.. But we have around 500+ banned spammers as well.. We promoted that site few years ago, then closed because of busy schedule. time to re-launch again soon. I want to run a query.. which can change passwords for all users who belong to a specific usergroup (primary or secondary) to fasten my process. I will manage changing the usernames manually via PHPMYADMIN which works perfect.. THANKS FOR suggesting backup.. taking a new backup everytime after successfully accomplishing above tasks in proper order. *Hardly few MBs back* directly storing on server, naming appropriately. Regards, --------------- Added [DATE]1423141417[/DATE] at [TIME]1423141417[/TIME] --------------- I tried to run the above query.. Code:
UPDATE User2 set password=MD5(CONCAT(MD5('XXYYZZ1122'),salt)) Getting following error: #1146 - Table 'DBi_dbname.User2' doesn't exist Not a techy to frame query or code. |
#6
|
|||
|
|||
You'd want something like this:
Code:
UPDATE user SET password=MD5(CONCAT(MD5('XXYYZZ1122'),salt)) WHERE username='User2' If you want to do it for a primary usergroup, you'd change the WHERE part to Code:
WHERE usergroupid=X For a secondary usergroup, I think this will work: Code:
WHERE FIND_IN_SET(X, membergroupids) != NULL If you want to test before doing an actual change, you could do something like Code:
SELECT username FROM user WHERE FIND_IN_SET(X, membergroupids) != NULL and see what gets selected. Of course in the above queries you want to replace X with the usergroupid you're interested in. |
#7
|
||||
|
||||
Hello once again.
I was able to sucessfully use following command for 1 site: HTML Code:
UPDATE user set password=MD5(CONCAT(MD5('XXYYZZ1122'),salt)) ************************************************** ************* But for another complex site.. which has few different user groups.. (Many Paid members here offline/online payment method, differentiated into multiple groups by mode of payment/amount etc.) Example: UserOne belongs to GROUP NAME Members ID = 2 UserOne is also under another GROUP NAME Paid Donors ID = 117 - This is like an Additional Group member belongs too. Trying to run the queries you guided me with, these are results. HTML Code:
SELECT username FROM vb3_user WHERE FIND_IN_SET(117, membergroupids) = NULL Results: 0 (2.5048s), Page 1 of 0 HTML Code:
UPDATE vb3_user SET password=MD5(CONCAT(MD5('XXYYZZ1122'),salt)) WHERE FIND_IN_SET(117, membergroupids) != NULL Confirm Query Execution This query may modify data in your database. If this change is done in error, it is possible that you will not be able to recover from this change. Are you sure you wish to continue? Affected Rows: 0 (3.3929s) There are many users in Group ID - 117 Seems I am missing something ? |
#8
|
|||
|
|||
Well, I have to admit that I didn't try it. I think the problem is that you have to check for 0 instead of NULL. So
Code:
SELECT username FROM vb3_user WHERE FIND_IN_SET(117, membergroupids) = 0 |
#9
|
||||
|
||||
Yes it worked fine.., gives all users not are not in Group ID - 117
--------------- Added [DATE]1423229058[/DATE] at [TIME]1423229058[/TIME] --------------- and this HTML Code:
SELECT username FROM vb3_user WHERE FIND_IN_SET(117, membergroupids) = 1 --------------- Added [DATE]1423229433[/DATE] at [TIME]1423229433[/TIME] --------------- should i try UPDATE vb3_user SET password=MD5(CONCAT(MD5('XXYYZZ1122'),salt)) WHERE FIND_IN_SET(117, membergroupids) != 1 OR UPDATE vb3_user SET password=MD5(CONCAT(MD5('XXYYZZ1122'),salt)) WHERE FIND_IN_SET(117, membergroupids) != 0 dont want to risk. |
#10
|
|||
|
|||
If you're unsure, change your query to SELECT first to see which rows will be affected.
SELECT * FROM vb3_user WHERE FIND_IN_SET(117, membergroupids) != 1 -- SELECT * FROM vb3_user WHERE FIND_IN_SET(117, membergroupids) != 0 |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|