XF 1.5 Deleting an IP address from the DB

Alfa1

Well-known member
During an import process, the admin IP address was erroneously added to the accounts of a number of users.
This would create significant problems as soon as a multiple accounts checker is activated.
How can I query the DB for this IP address and remove all instances of it?

I see the IPs are in binary format, but for soem reason when I search for the binary I get no results.
 

Alfa1

Well-known member
How weird. I get this when running the select version:

#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 'FROM xf_ip WHERE ip = UNHEX(LPAD(HEX(INET_ATON('1.2.3.4')), 8, '0')) LIMIT' at line 1
 

Mike

XenForo developer
Staff member
I'm guessing you missed the column list that you need for selects (* will work).
 

doublespaces

Well-known member
For anyone wanting to test:
Code:
SELECT * FROM xf_ip WHERE ip = UNHEX(LPAD(HEX(INET_ATON('1.2.3.4')), 8, '0'));
I managed to run this on XF2 database and it worked. Replace "SELECT *" with "DELETE" to actually delete. It won't show the IP address when you do this, for me it just said "user".
 
Top