Loading...
 
Skip to main content

Architecture / Installation


Can't login after admin renaming

Hi, newbie mistake again

i renamed the "admin" user into something like "Gedeon T." and logged out.

I couldn't log back it.

I tried the trick from the FAQ:

INSERT INTO `users_users` SET `password`='MYNEWPASS', `hash`= md5('adminMYNEWPASS') WHERE `login`='admin';

But it didn't work and got this error message:

SQL query:

INSERT INTO `users_users`
SET `password` = 'MYNEWPASS',
`hash` = md5( 'adminMYNEWPASS' ) WHERE `login` = 'admin'

MySQL said: Documentation

  1. 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 'WHERE `login`='admin'' at line 1


I tried the trick with user "Gedeon T." and could login with it, but it didn't have admin privileges anymore!

For all pracical purpose, user "admin" doesn't exist anymore, but no user with admin privileges exists either: I can't admin my wiki.

Any ideas?

There are a number of ways to solve this. You need to use phpMyAdmin or similar tool on the database.

1) Change the first user in the users_users table back to having a login of admin . Then replace the password with f6fdffe48c908deb0f4c3bd36c032e72 This is the hashed version of a password = admin

2) You could add an entry in users_grouppermissions for Registered to have tiki_p_admin (temporarily). Then create an Admin group, assign permission tiki_p_admin, add a user to it and then remove the tiki_p_admin from Registered. This is a brute force way of doing it. And allows every user to be admin while you are doing this. Dangerous for sites that have other users already.

gary


You can't rename the admin user.

However you can give another username tiki_p_admin permission to make them an admin.

Recreate the admin user in SQL from the .sql files in db/

Damian ))Parker-Croft((