- Joined
- Jun 22, 2021
- Messages
- 118
- Points
- 43
Reputation:
Hi everyone
here is some mysql queries that i have been used for a while.
Query to replace the searched phrase with a different phrase in all messages
Changing a user's posting date with a SQL query
Password reset with SQL query
Changing default language with sql query
Changing default style with sql query
I hope it helps
Query to replace the searched phrase with a different phrase in all messages
UPDATE xf_post
SET
message = REPLACE(message, 'old words', 'new words');
Changing a user's posting date with a SQL query
UPDATE xf_user
SET register_date = UNIX_TIMESTAMP('yyyy-mm-dd 00:00:00')
WHERE user_id = 2
Password reset with SQL query
UPDATE xf_user_authenticate
SET data = BINARY
CONCAT(
CONCAT(
CONCAT('a:3:{s:4:"hash";s:40:"', SHA1(CONCAT(SHA1('new password'), SHA1('salt')))),
CONCAT('";s:4:"salt";s:40:"', SHA1('salt'))
),
'";s:8:"hashFunc";s:4:"sha1";}'
),
scheme_class = 'XenForo_Authentication_Core'
WHERE user_id = 1;
Changing default language with sql query
UPDATE xf_user SET language_id = 2;
Changing default style with sql query
UPDATE xf_user SET style_id = 2;
I hope it helps