Forgotten admin password

In the root folder of SuiteCRM there is a file called config.php

If you look at this file yo will find the necessary information to connect to the database.

Then write a php script to execute the query provided by @AlxGr and you are done.

First look for a similar section in config.php:


 'dbconfig' => 
  array (
    'db_host_name' => 'yourdbhost',
    'db_user_name' => 'yourdbuser',
    'db_password' => 'yourdbpwd',
    'db_name' => 'yourdbname',
    'db_type' => 'mysql',
  ),

You can try this:


<?php
$dbhost = "yourdbhost"; // replace yourdbhost with the value found in config.php
$dbuser = "yourdbuser"; // replace yourdbuserwith the value found in config.php
$dbpwd ="yourdbpwd"; // replace yourdbpwdwith the value found in config.php
$dbname = "yourdbname"; // replace yourdbnamewith the value found in config.php

    $mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbname);
    $result = $mysqli->query("UPDATE users SET user_hash = '$2y$10$ua6PicOvqyYMKgOR6gzFcub.Z5s40j6moWRH4oaO.Ef667lz.nb0m' WHERE user_name = 'YourUserNameHere';"); // you must edit also YourUserNameHere and put your actual username (like admin, for example)
?>
1 Like