A new client project I’m working on requires I duplicate their website, install it on my development server and work on it before transferring it back onto their server once complete.
To do this, I need access to the OpenCart admin panel, but I want to keep the existing admin users where they are and just add myself in as a new one. Without access to the admin area I can’t create this by the normal method, so I have to manually create one in the database before I can log in through the site admin area. Here’s how:
1. Access the site’s database through PHPMyAdmin
2. When in the root of all the tables in the database, click on the SQL tab in the main window
3. Paste in the following:
INSERT INTO oc_user VALUES (9999,1, 'phil.owen', '21232f297a57a5a743894a0e4a801fc3', '', 'Phil', 'Owen', 'firstname.lastname@example.org', '', '0.0.0.0',1,CURDATE());
In the above example:
phil.owen is the username of the new admin account
21232f297a57a5a743894a0e4a801fc3 is the encrypted password, its for the password ‘admin’
Phil is the first name
Owen is the last name
email@example.com is the email associated with the admin account, so if I forget the password and want to reset it, here’s where the password reminder will go.
4. Click the ‘Go’ button and it will run the command, creating a new user so you can now login.