Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Create new admin user via phpMyAdmin
Hey there,
I have a problem updating two ancient Textpattern sites, that had been lying dormant for years but will now have to be brought back to live (after the provider upgraded to PHP 7 and they had vanished).
Funny enough, both sites have empty txp_users tables in phpMyAdmin so I can’t log back in to complete the update process.
So: is there an SQL command that can create an admin user??
By the way, can I trigger the update process by other means than by logging back in?
Cheers from sunny but chilly Germany,
-f
Offline
Re: Create new admin user via phpMyAdmin
Okay, I overlooked an entry in the database, my bad — feel free to delete the topic.
Offline
Re: Create new admin user via phpMyAdmin
In case it’s of use to anyone:
In phpMyAdmin or your favourite SQL client, enter:
INSERT INTO `txp_users` (`user_id`, `name`, `pass`, `RealName`, `email`, `privs`, `last_access`, `nonce`)
VALUES
(1, 'username', '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7', 'Actual Name', 'you@email.com', 1, NULL, '1f31138afc38e1cdfceae0e42d196df0');
replacing username
with your login name, Actual Name
with your display name and you
email.com@ with your email address. This has the password pass
and the new user has full admin privileges (1).
If you already have user entries in your table, you must also change the ID 1
at the very beginning to the next available empty number.
Then change the password by doing the following:
UPDATE `txp_users` SET pass=password(lower('pass')) WHERE name='username';
again replacing username
with the login name you used above and pass
with your desired password.
TXP Builders – finely-crafted code, design and txp
Offline
Re: Create new admin user via phpMyAdmin
Danke Dir, Jakob!
I find myself using something similar for WordPress sites quite a lot, so it’s definitely a good idea to have this here for reference!
Offline
Re: Create new admin user via phpMyAdmin
With regard to updating ancient versions of Textpattern (here: 4.0.3 from 2006 .-) to 4.7, it did finally work when updating to 4.6.2 first, logging back in etc., then moving on to 4.7.1. Yay!
Offline
Re: Create new admin user via phpMyAdmin
One site still gives me errors, though, I can’t get past the language panel in 4.6.2. I did already set the production state to ‘live’ in phpMyAdmin and upped the version in txp_prefs to 4.6.2, but to no avail. Every time I refresh, the version has been set back to 0.9.9!?
Cf. #314374
Any idea, how I might bypass this?
In the language panel, I can neither update the textpacks via ‘install’, nor can I manually upload a textpack from github …
Last edited by funtoosh (2018-11-16 10:19:01)
Offline
Re: Create new admin user via phpMyAdmin
Mhm … is there any means to somehow temporarily lock the database version table to prevent it from being overwritten by PHP?
Offline
Re: Create new admin user via phpMyAdmin
Worked for me as well!
FIX:
— Uploaded Textpattern 4.7.1 to server
— Made two empty files,_to_1.0.0.php
and_to_4.0.2.php
in update folder
and used_to_4.6.0.php
from dev version 4.7.2 @ github
— Then ran /textpattern/update/update.php directly
Frontend and backend are back, languages are updated, yay!
Offline