FAQ I Lost my database password

You may have forget your MySQL database password or for an unknown reason, it does not works anymore. This is a solution to restore this. This FAQ speak about a MySQL database administrator password problem and not about the lost of the password of a Dolibarr account used to work on Dolibarr.

= With Microsoft Windows =

Reset the root password of Mysql

 * Connect to a Windows administrator account on your computer,

Menu Start -> parameters -> Setup panel -> Administration tools -> Services. Menu Start -> Execute -> cmd CD C:\dolibarr\bin\mysql\mysql5.0.45\bin C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysqld-nt --skip-grant-tables Menu Start -> Execute -> cmd CD C:\dolibarr\bin\mysql\mysql5.0.45\bin C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysql -u root C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysqladmin -u root -panewpassword shutdown
 * Go on menu Windows:
 * Find the service MySQL doliwampmysql into the list and stop it (we assume you installed DoliWamp. Name may differs if using a manuel installation of MySql).
 * Launch the command line command by going to
 * Type the following lines to restart MySQL in a particular mode.
 * Launch another command line by going to
 * Type in this new windows
 * At the MySQL prompt, type
 * Type
 * Restart Windows.

You should now be able to access your MySQL database, you can now tell to Dolibarr to use the new password.

Change dolibarr config file to use new password
If you use the root user also to allow Dolibarr to connect to your database (not recommanded but why not) C:\dolibarr\www\dolibarr\htdocs\conf $dolibarr_main_db_pass with value of the new password.
 * Go into
 * Edit file conf.php to change variable
 * Save file and quit. It should be ok.

If Dolibarr use another MySQL user than root, Menu Start - > execute -> CMD cd C:\dolibarr\bin\mysql\mysql5.0.45\bin\ C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysql -u root -ppassword C:\dolibarr\www\dolibarr\htdocs\conf $dolibarr_main_db_user="xxx"; $dolibarr_main_db_pass="yyy"; Replace xxx and yyy by real values.
 * Go in Windows menu
 * At the MySQL prompt, type
 * Go into
 * edit file conf.php and search lines

= Linux =

Reset the root password of Mysql
/usr/sbin/mysql stop /usr/sbin --skip-grant-tables /usr/bin/mysql -u root /usr/bin/mysqladmin -u root -panewpassword shutdown
 * Connect to a terminal console with user roor.
 * Stop Mysql:
 * Type the following line to restart MySQL in a particular mode.
 * Launch another terminal console.
 * Type in this new windows
 * At the MySQL prompt, type
 * Type
 * Restart your server or only mysql server.

You should now be able to access your MySQL database, you can now tell to Dolibarr to use the new password.

Change Dolibarr config file to use new password
If you use the root user also to allow Dolibarr to connect to your database (not recommanded but why not) htdocs\conf $dolibarr_main_db_pass with value of the new password.
 * Go into
 * Edit file conf.php to change variable
 * Save file and quit. It should be ok.

If Dolibarr use another MySQL user than root, /usr/bin/mysql -u root -ppassword htdocs\conf $dolibarr_main_db_user="xxx"; $dolibarr_main_db_pass="yyy"; Replace xxx and yyy by real values.
 * Ru mysql with root user
 * At the MySQL prompt, type
 * Go into
 * edit file conf.php and search lines

= Mac =