How to change password of MySql and others?

Discussion in 'Server Operation' started by tanvir, Jul 29, 2012.

  1. tanvir

    tanvir New Member

    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
     
  2. rosehosting

    rosehosting Member

    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
     
  3. tanvir

    tanvir New Member

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

    rosehosting Member

    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.
     
  5. tanvir

    tanvir New Member

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

    till Super Moderator Staff Member ISPConfig Developer

    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.
     
  7. tanvir

    tanvir New Member

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

    falko Super Moderator ISPConfig Developer

    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.
     
  9. tanvir

    tanvir New Member

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

    falko Super Moderator ISPConfig Developer

    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.
     
  11. tanvir

    tanvir New Member

    Thanks for your replay.

    • Dovecot:
      • there is no direct password field in dovecot.conf. it is in dovecot-sql.conf.
      • it only uses the Ispconfig user password not the root.
      • However the password in encrypted. can you tell me the encryption method or how can I make like that?
    • Postfix:
      • Postfix also do the same. unless I change the ISPConfig's user password, change is not needed. but the encryption is same here.

    Thanks for sharing your knowledge with me...
     
  12. tanvir

    tanvir New Member

    Thanks to all

    Thanks to everybody for the help.
    Please visit this link. I tried to solve it. Now this solution works just fine for me. I guess it might help you. :)

    And feel free to advice or ask questions. We will be pleased to help you.

    Thanks
    Tanvir
     

Share This Page