Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2018-11-15 13:30:50

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

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

#2 2018-11-15 13:47:43

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

Re: Create new admin user via phpMyAdmin

Okay, I overlooked an entry in the database, my bad — feel free to delete the topic.

Offline

#3 2018-11-15 13:52:25

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,435
Website

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 youemail.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

#4 2018-11-16 08:25:23

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

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

#5 2018-11-16 08:49:58

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

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

#6 2018-11-16 09:33:15

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

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

#7 2018-11-16 10:21:04

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

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

#8 2018-11-16 10:59:27

funtoosh
Member
From: Münster, Germany
Registered: 2006-10-09
Posts: 138
Website

Re: Create new admin user via phpMyAdmin

Worked for me as well!

#314908:

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

Board footer

Powered by FluxBB