This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
change_db_password [2012/12/15 09:52] nuxwin created |
change_db_password [2017/04/14 18:25] (current) nuxwin |
||
---|---|---|---|
Line 1: | Line 1: | ||
======How to change i-MSCP database SQL user password?====== | ======How to change i-MSCP database SQL user password?====== | ||
- | =====If you are using master branch====== | + | Run the following commands as root user: |
- | ====I. If you know the old password==== | ||
- | |||
- | **1.** Set a new password to the existent SQL user | ||
<code> | <code> | ||
- | # mysql -u root -p | + | # perl /var/www/imscp/engine/setup/imscp-reconfigure -dar sql |
- | > UPDATE mysql.user SET Password=PASSWORD('cleartext password') WHERE User='root' AND Host='localhost'; | + | |
- | > FLUSH PRIVILEGES; | + | |
- | > quit; | + | |
</code> | </code> | ||
- | **Note:** Here, assumption is made that the i-MSCP SQL user is the SQL root user (default). Another way is to run the **mysql_secure_installation** script as provided with the MySQL server. | ||
- | |||
- | **2.** Inform i-MSCP about new password | ||
- | <code> | ||
- | # perl /var/www/imscp/engine/setup/imscp-setup | ||
- | </code> | ||
- | |||
- | Then, you will be asked again about i-MSCP SQL username and password. | ||
- | |||
- | ====II. If you do not know the old password==== | ||
- | |||
- | **1.** Set a new password to the existent SQL user | ||
- | <code> | ||
- | # /etc/init.d/mysql stop | ||
- | # /usr/bin/mysqld_safe --skip-grant-tables & | ||
- | # mysql -u root | ||
- | > UPDATE mysql.user SET Password=PASSWORD('PASSWORD') WHERE User='root' AND Host='localhost'; | ||
- | > FLUSH PRIVILEGES; | ||
- | > quit; | ||
- | # /etc/init.d/mysql start | ||
- | </code> | ||
- | |||
- | **2.** Inform i-MSCP about new password | ||
- | <code> | ||
- | # perl /var/www/imscp/engine/setup/imscp-setup | ||
- | </code> | ||
- | Then, you will be asked again about i-MSCP SQL username and password. |