If you are stuck without database or phpMyAdmin access, and cannot reset a password via the WordPress admin, take a look at the following code.
Add it to your theme’s functions.php file, change the details on lines 2-4 (to ones that do not exist for any existing user), and the next time you access the WordPress login screen a new user with administrator permissions will be created and you can log in.
function sv_wp_admin_account(){
$user = 'Username';
$pass = 'Password';
$email = 'email@domain.co.il';
if ( !username_exists( $user ) && !email_exists( $email ) ) {
$user_id = wp_create_user( $user, $pass, $email );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
} }
add_action('init','sv_wp_admin_account');