Reset Admin Password

One of the easiest way to reset the data in the database. 

1. Log into PHPMyAdmin, to go your opencart database and go to SQL tab. 

2. Run query below - replace: reallylongpassword, admin username and 'oc_' with yourdatabase prefix

UPDATE oc_user SET password = md5('reallylongpassword') WHERE username = 'admin';


Another way with only FTP access upload a PHP script which runs the above query.

E.g. paste this into a file reset-admin-password.php and upload to the root (same folder as config.php). Then visit this file in a browser or command line.


<?php

require_once('config.php');
if (file_exists(DIR_SYSTEM . 'library/db/' . DB_DRIVER . '.php')){
require DIR_SYSTEM . 'library/db/' . DB_DRIVER . '.php';
} else {
require DIR_SYSTEM . 'database/' . DB_DRIVER . '.php';
}
require DIR_SYSTEM . 'library/db.php';
$db = new DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
$sql = "UPDATE `".DB_PREFIX."user` SET password = md5('reallylongpassword') WHERE username = 'admin'";
$result = $db->query($sql);
var_dump($result);
die('DONE!');