FAQ I Lost my password: Difference between revisions

m
no edit summary
Tag: 2017 source edit
mNo edit summary
Line 7: Line 7:


[[Category:FAQ EN]]
[[Category:FAQ EN]]
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.
You may have forget your MariaDB or 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.  
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 =
=With Microsoft Windows=
== Reset the root password of Mysql ==
==If you lost the root password of MariaDB/MySql==
* Connect to a Windows administrator account on your computer,<br />
 
* Go on menu Windows:
*Connect to a Windows administrator account on your computer,<br />
*Go on menu Windows:
 
     Menu Start -> parameters -> Setup panel -> Administration tools -> Services.
     Menu Start -> parameters -> Setup panel -> Administration tools -> Services.
* 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
*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
 
     Menu Start -> Execute -> cmd
     Menu Start -> Execute -> cmd
* Type the following lines to restart MySQL in a particular mode.
 
*Type the following lines to restart MySQL in a particular mode.
 
     CD C:\dolibarr\bin\mysql\mysql5.0.45\bin  
     CD C:\dolibarr\bin\mysql\mysql5.0.45\bin  
     C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysqld-nt --skip-grant-tables
     C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysqld-nt --skip-grant-tables
* Launch another command line by going to
 
*Launch another command line by going to
 
     Menu Start -> Execute -> cmd
     Menu Start -> Execute -> cmd
* Type in this new windows  
 
*Type in this new windows
 
     CD C:\dolibarr\bin\mysql\mysql5.0.45\bin  
     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\mysql -u root
* At the MySQL prompt, type
 
*At the MySQL prompt, type
 
<source lang="sql">
<source lang="sql">
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root';
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root';
Line 32: Line 45:
mysql> QUIT;
mysql> QUIT;
</source>
</source>
* Type  
 
*Type
 
     C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysqladmin -u root -panewpassword shutdown
     C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysqladmin -u root -panewpassword shutdown
* Restart Windows.
 
*Restart Windows.




You should now be able to access your MySQL database, you can now tell to Dolibarr to use the new password.
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 ==
==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)
If you use the root user also to allow Dolibarr to connect to your database (not recommanded but why not)
* Go into  
 
*Go into
 
     C:\dolibarr\www\dolibarr\htdocs\conf  
     C:\dolibarr\www\dolibarr\htdocs\conf  
* Edit file conf.php to change variable
 
*Edit file conf.php to change variable
 
     $dolibarr_main_db_pass
     $dolibarr_main_db_pass
with value of the new password.
with value of the new password.
* Save file and quit. It should be ok.
 
*Save file and quit. It should be ok.


If Dolibarr use another MySQL user than root,
If Dolibarr use another MySQL user than root,
* Go in Windows menu
 
*Go in Windows menu
 
     Menu Start - > execute -> CMD  
     Menu Start - > execute -> CMD  
     cd C:\dolibarr\bin\mysql\mysql5.0.45\bin\
     cd C:\dolibarr\bin\mysql\mysql5.0.45\bin\
     C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysql -u root -ppassword
     C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysql -u root -ppassword
* At the MySQL prompt, type
 
*At the MySQL prompt, type
 
<source lang="sql">
<source lang="sql">
mysql> UPDATE mysql.user SET Password = PASSWORD('anothernewpassword') WHERE User = 'userusedbydolibarr';
mysql> UPDATE mysql.user SET Password = PASSWORD('anothernewpassword') WHERE User = 'userusedbydolibarr';
Line 59: Line 84:
mysql> QUIT;
mysql> QUIT;
</source>
</source>
* Go into  
 
*Go into
 
     C:\dolibarr\www\dolibarr\htdocs\conf  
     C:\dolibarr\www\dolibarr\htdocs\conf  
* edit file conf.php and search lines
 
*edit file conf.php and search lines
 
     $dolibarr_main_db_user="xxx";
     $dolibarr_main_db_user="xxx";
     $dolibarr_main_db_pass="yyy";
     $dolibarr_main_db_pass="yyy";
Replace xxx and yyy by real values.
Replace xxx and yyy by real values.


= Linux =
=Linux=
== Reset the root password of Mysql or MariaB ==
==Reset the root password of Mysql or MariaB==
* Connect to a terminal console with user roor.
 
* Stop Mysql:
*Connect to a terminal console with user roor.
*Stop Mysql:
 
     /usr/sbin/mysql stop
     /usr/sbin/mysql stop
* Type the following line to restart MySQL in a particular mode.
 
*Type the following line to restart MySQL in a particular mode.
 
     /usr/sbin --skip-grant-tables
     /usr/sbin --skip-grant-tables
* Launch another terminal console.
 
* Type in this new windows  
*Launch another terminal console.
*Type in this new windows
 
     /usr/bin/mysql -u root
     /usr/bin/mysql -u root
* At the MySQL prompt, type
 
*At the MySQL prompt, type
 
<source lang="sql">
<source lang="sql">
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root';
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root';
Line 87: Line 124:
mysql> QUIT;
mysql> QUIT;
</source>
</source>
* Type  
 
*Type
 
     /usr/bin/mysqladmin -u root -panewpassword shutdown
     /usr/bin/mysqladmin -u root -panewpassword shutdown
* Restart your server or only mysql server.
 
*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.
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 ==
==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)
If you use the root user also to allow Dolibarr to connect to your database (not recommanded but why not)
* Go into  
 
*Go into
 
     htdocs\conf  
     htdocs\conf  
* Edit file conf.php to change variable
 
*Edit file conf.php to change variable
 
     $dolibarr_main_db_pass
     $dolibarr_main_db_pass
with value of the new password.
with value of the new password.
* Save file and quit. It should be ok.
 
*Save file and quit. It should be ok.


If Dolibarr use another MySQL user than root,
If Dolibarr use another MySQL user than root,
* Ru mysql with root user
 
*Ru mysql with root user
 
     /usr/bin/mysql -u root -ppassword
     /usr/bin/mysql -u root -ppassword
* At the MySQL prompt, type
 
*At the MySQL prompt, type
 
<source lang="sql">
<source lang="sql">
mysql> UPDATE mysql.user SET Password = PASSWORD('anothernewpassword') WHERE User = 'userusedbydolibarr';
mysql> UPDATE mysql.user SET Password = PASSWORD('anothernewpassword') WHERE User = 'userusedbydolibarr';
Line 111: Line 160:
mysql> QUIT;
mysql> QUIT;
</source>
</source>
* Go into  
 
*Go into
 
     htdocs\conf  
     htdocs\conf  
* edit file conf.php and search lines
 
*edit file conf.php and search lines
 
     $dolibarr_main_db_user="xxx";
     $dolibarr_main_db_user="xxx";
     $dolibarr_main_db_pass="yyy";
     $dolibarr_main_db_pass="yyy";
Replace xxx and yyy by real values.
Replace xxx and yyy by real values.


= Mac =
=Mac=
== DoliMamp ==
==DoliMamp==
{{ToComplete}}
{{ToComplete}}