HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   How to change password of MySql and others? (http://www.howtoforge.com/forums/showthread.php?t=58114)

tanvir 29th July 2012 07:47

How to change password of MySql and others?
 
Hello,

I have configured a two mail servers on openSUSE from here. Now I want to change the password of MySQL and the server. Please tell me step by step how can I do it with out interrupting the services ?

Thanks
Tanvir

rosehosting 29th July 2012 09:52

Quote:

Originally Posted by tanvir (Post 282913)
Hello,

I have configured a two mail servers on openSUSE from here. Now I want to change the password of MySQL and the server. Please tell me step by step how can I do it with out interrupting the services ?

Thanks
Tanvir

Assuming you know your current 'root' passwords, to reset your system's 'root' password you need to login to your server via ssh and execute

Code:

# passwd
it will ask you to enter and confirm your new system's 'root' password.

as for resetting the mysql's 'root' password, you need to login to your mysql server as root by executing:

Code:

# mysql -u root -p
once you're in, you need to change the database to 'mysql'

Code:

mysql> use mysql;
and then reset your mysql's 'root' password by executing:

Code:

mysql> update user set Password=PASSWORD('YOUR_NEW_PASS') WHERE User='root';
to quit the mysql shell type:

Code:

mysql> \q
cheers

tanvir 29th July 2012 10:01

After changing MySQL password will postfix, Apache2, BIND, Dovecot, ISPConfig 3 etc work fine as they are doing now... ?

rosehosting 29th July 2012 10:49

Quote:

Originally Posted by tanvir (Post 282916)
After changing MySQL password will postfix, Apache2, BIND, Dovecot, ISPConfig 3 etc work fine as they are doing now... ?

I'm not that familiar with ISPConfig 3 and cannot tell for sure if it or its services use a MySQL database, specifically the 'root' account.

You may want to wait for an answer on this from some one who knows how things work in ISPConfig 3.

anyhow, the services like apache, bind, dovecot, postfix should not be affected by the change of your mysql 'root' password.

tanvir 30th July 2012 12:44

Quote:

Originally Posted by rosehosting (Post 282918)
I'm not that familiar with ISPConfig 3 and cannot tell for sure if it or its services use a MySQL database, specifically the 'root' account.

You may want to wait for an answer on this from some one who knows how things work in ISPConfig 3.

anyhow, the services like apache, bind, dovecot, postfix should not be affected by the change of your mysql 'root' password.

Thank you rosehosting. I am waiting for someone who knows the answer...

till 31st July 2012 08:50

ISPConfig uses the mysql root password only to create new databases, all other operations are donw ith the less priveliged mysql user "ispconfig". So after you changed the mysql root password change it in the file /usr/local/ispconfig/server/lib/mysql_clientdb.conf as well.

tanvir 31st July 2012 10:43

Quote:

Originally Posted by till (Post 283029)
ISPConfig uses the mysql root password only to create new databases, all other operations are donw ith the less priveliged mysql user "ispconfig". So after you changed the mysql root password change it in the file /usr/local/ispconfig/server/lib/mysql_clientdb.conf as well.

Just being curious, If I do as you said then will postfix, Apache2, BIND, Dovecot, ISPConfig 3 work fine as they are working now ?

falko 31st July 2012 18:05

Apache and BIND are fine as they don't use MySQL as backend. For Postfix, Dovecot, and ISPConfig you will have to update the MySQL password in the appropriate configuration files.

tanvir 1st August 2012 09:07

Quote:

Originally Posted by falko (Post 283048)
Apache and BIND are fine as they don't use MySQL as backend. For Postfix, Dovecot, and ISPConfig you will have to update the MySQL password in the appropriate configuration files.

till has described how to change the for ISPConfig 3. Thanks for that. Can you tell ma how to change for Postfix and Dovecot ?

falko 1st August 2012 14:02

For Postfix, you must modify the mysql*.cf files in the /etc/postfix/ directory. The same has to be done for dovecot.conf (which is either in /etc/or /etc/dovecot/). Restart both daemons afterwards.


All times are GMT +2. The time now is 10:52.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.