Difference between revisions of "FAQ I Lost my password"
Tag: 2017 source edit |
Tag: 2017 source edit |
||
(10 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
<!-- You can edit this section but do NOT remove these comments | <!-- You can edit this section but do NOT remove these comments | ||
Links below will be automatically replicated on translated pages by PolyglotBot --> | Links below will be automatically replicated on translated pages by PolyglotBot --> | ||
− | [[fr: | + | [[fr:FAQ J'ai perdu mon mot de passe]] |
− | [[es: | + | [[es:FAQ Tengo un problema en la contraseña]] |
<!-- END interlang links --> | <!-- END interlang links --> | ||
[[Category:FAQ EN]] | [[Category:FAQ EN]] | ||
− | + | It may happen that you forget your password or that for an unknown reason it no longer works, here is the solution to regain control depending on the 3 types of passwords concerned. | |
+ | = Resetting MariaDB/MySQL database root password = | ||
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== |
− | |||
− | |||
*Connect to a Windows administrator account on your computer,<br /> | *Connect to a Windows administrator account on your computer,<br /> | ||
*Go on menu Windows: | *Go on menu Windows: | ||
Line 35: | Line 34: | ||
*Type in this new windows | *Type in this new windows | ||
− | CD C:\dolibarr\bin\mysql\ | + | CD C:\dolibarr\bin\mysql\mysqlx.y.z\bin |
− | C:\dolibarr\bin\mysql\ | + | C:\dolibarr\bin\mysql\mysqlx.y.z\bin\mysql -u root |
*At the MySQL prompt, type | *At the MySQL prompt, type | ||
− | < | + | <syntaxHighlight lang="sql"> |
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root'; | mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root'; | ||
+ | or on a more recent version | ||
+ | mysql> SET PASSWORD FOR 'root@localhost' = PASSWORD('anewpassword'); | ||
+ | </syntaxHighlight> | ||
+ | And to take change into account | ||
+ | <syntaxHighlight lang="sql"> | ||
mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
mysql> QUIT; | mysql> QUIT; | ||
− | </ | + | </syntaxHighlight> |
*Type | *Type | ||
Line 51: | Line 55: | ||
*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. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | ==Linux== | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | =Linux | ||
− | |||
*Connect to a terminal console with user roor. | *Connect to a terminal console with user roor. | ||
Line 110: | Line 73: | ||
*Type in this new windows | *Type in this new windows | ||
− | + | ||
*At the MySQL prompt, type | *At the MySQL prompt, type | ||
− | < | + | <syntaxHighlight lang="sql"> |
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root'; | mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root'; | ||
or on a more recent version | or on a more recent version | ||
mysql> SET PASSWORD FOR 'root@localhost' = PASSWORD('anewpassword'); | mysql> SET PASSWORD FOR 'root@localhost' = PASSWORD('anewpassword'); | ||
− | </ | + | </syntaxHighlight> |
Then validate the change with | Then validate the change with | ||
− | < | + | <syntaxHighlight lang="sql"> |
mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
mysql> QUIT; | mysql> QUIT; | ||
− | </ | + | </syntaxHighlight> |
*Type | *Type | ||
Line 133: | Line 96: | ||
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. | ||
− | = | + | |
+ | = Reset the password used by Dolibarr to access the database = | ||
*Go into | *Go into | ||
− | 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. The name of user is store into $dolibarr_main_db_user | ||
*Save file and quit. It should be ok. | *Save file and quit. It should be ok. | ||
− | + | *Go into the MariaDB prompt from a terminal: | |
− | |||
− | * | ||
− | + | With Linux: /usr/bin/mysql -u root | |
+ | With Windows: Menu Start - > execute -> CMD then cd C:\dolibarr\bin\mysql\mysql5.0.45\bin\; C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysql -u root -ppassword | ||
*At the MySQL prompt, type | *At the MySQL prompt, type | ||
− | < | + | <syntaxHighlight lang="sql"> |
− | mysql> UPDATE mysql.user SET Password = PASSWORD(' | + | mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'userusedfordolibarrdatabase'; |
+ | or on a more recent version | ||
+ | mysql> SET PASSWORD FOR 'userusedfordolibarrdatabase@localhost' = PASSWORD('anewpassword'); | ||
+ | </syntaxHighlight> | ||
+ | The to take the change into account. | ||
+ | <syntaxHighlight lang="sql"> | ||
mysql> FLUSH PRIVILEGES; | mysql> FLUSH PRIVILEGES; | ||
mysql> QUIT; | mysql> QUIT; | ||
− | </ | + | </syntaxHighlight> |
− | + | Note that you may need to change the "localhot" with the ip of the server if the database is onto another server. | |
− | |||
− | + | = Resetting the password of a Dolibarr application user account = | |
+ | == If you have another account to access the application and it is admin == | ||
+ | Log in with it. Then go to the user's profile whose password you need to change. Modify the profile to force a new password. | ||
− | + | == If the lost password is that of the Dolibarr admin account == | |
− | + | Log in to the Dolibarr mysql database and modify the "pass" field of the login with which you want to connect. | |
− | + | <syntaxHighlight lang="sql"> | |
+ | mysql> USE nomdelabaseolibar; | ||
+ | mysql> UPDATE llx_user SET pass = 'atemporarypasswod' WHERE login ='loginuserbloque'; | ||
+ | </syntaxHighlight> | ||
− | + | Try to connect then modify your password from your user profile. This will clear the unencrypted temporary password in order to store your new encrypted password in this table. | |
− | |||
− |
Latest revision as of 17:40, 18 January 2025
It may happen that you forget your password or that for an unknown reason it no longer works, here is the solution to regain control depending on the 3 types of passwords concerned.
Resetting MariaDB/MySQL database root password
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
- Connect to a Windows administrator account on your computer,
- Go on menu Windows:
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
Menu Start -> Execute -> cmd
- Type the following lines to restart MySQL in a particular mode.
CD C:\dolibarr\bin\mysql\mysql5.0.45\bin C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysqld-nt --skip-grant-tables
- Launch another command line by going to
Menu Start -> Execute -> cmd
- Type in this new windows
CD C:\dolibarr\bin\mysql\mysqlx.y.z\bin C:\dolibarr\bin\mysql\mysqlx.y.z\bin\mysql -u root
- At the MySQL prompt, type
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root';
or on a more recent version
mysql> SET PASSWORD FOR 'root@localhost' = PASSWORD('anewpassword');
And to take change into account
mysql> FLUSH PRIVILEGES;
mysql> QUIT;
- Type
C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysqladmin -u root -panewpassword shutdown
- Restart Windows.
You should now be able to access your MySQL database, you can now tell to Dolibarr to use the new password.
Linux
- Connect to a terminal console with user roor.
- Stop Mysql:
/usr/sbin/mysql stop
- Type the following line to restart MySQL in a particular mode.
/usr/sbin --skip-grant-tables
- Launch another terminal console.
- Type in this new windows
- At the MySQL prompt, type
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'root';
or on a more recent version
mysql> SET PASSWORD FOR 'root@localhost' = PASSWORD('anewpassword');
Then validate the change with
mysql> FLUSH PRIVILEGES;
mysql> QUIT;
- Type
/usr/bin/mysqladmin -u root -panewpassword shutdown
- 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.
Reset the password used by Dolibarr to access the database
- Go into
C:\dolibarr\www\dolibarr\htdocs\conf
- Edit file conf.php to change variable
$dolibarr_main_db_pass
with value of the new password. The name of user is store into $dolibarr_main_db_user
- Save file and quit. It should be ok.
- Go into the MariaDB prompt from a terminal:
With Linux: /usr/bin/mysql -u root With Windows: Menu Start - > execute -> CMD then cd C:\dolibarr\bin\mysql\mysql5.0.45\bin\; C:\dolibarr\bin\mysql\mysql5.0.45\bin\mysql -u root -ppassword
- At the MySQL prompt, type
mysql> UPDATE mysql.user SET Password = PASSWORD('anewpassword') WHERE User = 'userusedfordolibarrdatabase';
or on a more recent version
mysql> SET PASSWORD FOR 'userusedfordolibarrdatabase@localhost' = PASSWORD('anewpassword');
The to take the change into account.
mysql> FLUSH PRIVILEGES;
mysql> QUIT;
Note that you may need to change the "localhot" with the ip of the server if the database is onto another server.
Resetting the password of a Dolibarr application user account
If you have another account to access the application and it is admin
Log in with it. Then go to the user's profile whose password you need to change. Modify the profile to force a new password.
If the lost password is that of the Dolibarr admin account
Log in to the Dolibarr mysql database and modify the "pass" field of the login with which you want to connect.
mysql> USE nomdelabaseolibar;
mysql> UPDATE llx_user SET pass = 'atemporarypasswod' WHERE login ='loginuserbloque';
Try to connect then modify your password from your user profile. This will clear the unencrypted temporary password in order to store your new encrypted password in this table.