This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
change_db_password [2014/01/04 00:18] nuxwin [If you know the old password] |
change_db_password [2016/10/11 21:48] 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 know the old password===== | + | Run the following commands as root user: |
- | **1.** Set a new password to the existent SQL user | ||
<code> | <code> | ||
- | # mysql -u root -p | + | # dpkg-reconfigure mysql-server-5.5 |
- | > UPDATE mysql.user SET Password=PASSWORD('cleartext password') WHERE User='root'; | + | |
- | > 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. | + | <WRAP center round important 80%> |
+ | You must adapt the **dpkg-reconfigure** command according the SQL server/version you're using. | ||
+ | </WRAP> | ||
- | **2.** Inform i-MSCP about new password | + | Once done you must reconfigure i-MSCP by running the imscp-reconfigure script. |
- | <code> | + | |
- | # perl /var/www/imscp/engine/setup/imscp-setup | + | |
- | </code> | + | |
- | + | ||
- | Then, you will be asked again about i-MSCP SQL username and password. | + | |
- | + | ||
- | =====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. |