# Changing MySQL credentials

**URL:** <https://community.ciphermail.com/t/changing-mysql-credentials/638>\
**Category:** Gateway\
**Created:** [August 6, 2018, 11:16am UTC](https://community.ciphermail.com/t/changing-mysql-credentials/638 "2018-08-06T11:16:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dino\_Edwards](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@Dino\_Edwards](https://community.ciphermail.com/u/Dino_Edwards)\
**Post date:** [August 6, 2018, 11:16am UTC](https://community.ciphermail.com/t/changing-mysql-credentials/638/1 "2018-08-06T11:16:16Z")

</div>

If I wanted to change MySQL credentials for Ciphermail, what config files would I have to modify?

The installation Guide only seems to mention the /usr/share/djigzo/conf/database/hibernate.mysql.connection.xml file, but the /usr/share/djigzo/conf/database/hibernate.mysql.cfg.xml also seems to have the MySQL crendentials in it. Does the /usr/share/djigzo/conf/database/hibernate.mysql.cfg.xml get generated automatically by the system?

Thanks a lot

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [August 9, 2018, 7:24am UTC](https://community.ciphermail.com/t/changing-mysql-credentials/638/2 "2018-08-09T07:24:32Z")

</div>

The file hibernate.mysql.cfg.xml should not have credentials in it.  
hibernate.mysql.cfg.xml includes the file hibernate.mysql.connection.xml  
(see &connectionsettings;)

Are you sure you are not referring to the file:

/usr/share/djigzo/conf/database/mysql.cnf

Because this file also contains the credentials. This file is used for  
backup/restore because MariaDB backup/restore functions need a password.  
So if you change the password and need to use the backup/restore  
functionality, you also need to update this password.

Kind regards,

Martijn Brinkers

> **···**
>
> On 06-08-18 13:16, Dino Edwards via Users wrote:
> 
> > If I wanted to change MySQL credentials for Ciphermail, what config  
> > files would I have to modify?
> > 
> > The installation Guide only seems to mention the  
> > /usr/share/djigzo/conf/database/hibernate.mysql.connection.xml file,  
> > but the /usr/share/djigzo/conf/database/hibernate.mysql.cfg.xml also  
> > seems to have the MySQL crendentials in it. Does the  
> > /usr/share/djigzo/conf/database/hibernate.mysql.cfg.xml get generated  
> > automatically by the system?
> 
> --  
> CipherMail email encryption
> 
> Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> secure webmail pull.
> 
> > **[CipherMail email encryption and digital signatures](https://www.ciphermail.com)**
> >
> > Easy to use server-side email encryption for automatic encryption and digital signing of email.
> 
> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)

---

<div class="post-metadata">

**Author:** ![Dino\_Edwards](https://avatars.discourse-cdn.com/v4/letter/d/6a8cbe/32.png) [@Dino\_Edwards](https://community.ciphermail.com/u/Dino_Edwards)\
**Post date:** [August 16, 2018, 9:27am UTC](https://community.ciphermail.com/t/changing-mysql-credentials/638/3 "2018-08-16T09:27:15Z")

</div>

If I remove the following lines from hibernate.mysql.cfg.xml:

\<property name="hibernate.connection.url"\>jdbc:mysql://127.0.0.1:3306/djigzo\</property\>^M  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<property name="hibernate.connection.username"\>USERNAME\</property\>^M  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<property name="hibernate.connection.password"\>PASSWORD\</property\>^M

I cannot login to the Ciphermail web GUI. Without the lines above, I get the back-end is not running error.

Also, I can't find an include for the hibernate.mysql.connection.xml in the hibernate.mysql.cfg.xml file.

The hibernate.mysql.cfg.xml seems like it's generated automatically by something. I suspect that's the case with the ^M characters in it.

Thanks

> **···**
>
> -----Original Message-----  
> From: Users [mailto:users-bounces(a)[lists.ciphermail.com](http://lists.ciphermail.com)] On Behalf Of Martijn Brinkers via Users  
> Sent: Thursday, August 9, 2018 3:25 AM  
> To: users(a)lists.ciphermail.com  
> Subject: Re: Changing MySQL credentials
> 
> On 06-08-18 13:16, Dino Edwards via Users wrote:
> 
> > If I wanted to change MySQL credentials for Ciphermail, what config  
> > files would I have to modify?
> > 
> > The installation Guide only seems to mention the  
> > /usr/share/djigzo/conf/database/hibernate.mysql.connection.xml file,  
> > but the /usr/share/djigzo/conf/database/hibernate.mysql.cfg.xml also  
> > seems to have the MySQL crendentials in it. Does the  
> > /usr/share/djigzo/conf/database/hibernate.mysql.cfg.xml get generated  
> > automatically by the system?
> 
> The file hibernate.mysql.cfg.xml should not have credentials in it.  
> hibernate.mysql.cfg.xml includes the file hibernate.mysql.connection.xml (see &connectionsettings;)
> 
> Are you sure you are not referring to the file:
> 
> /usr/share/djigzo/conf/database/mysql.cnf
> 
> Because this file also contains the credentials. This file is used for backup/restore because MariaDB backup/restore functions need a password.  
> So if you change the password and need to use the backup/restore functionality, you also need to update this password.
> 
> Kind regards,
> 
> Martijn Brinkers
> 
> --  
> CipherMail email encryption
> 
> Email encryption with support for S/MIME, OpenPGP, PDF encryption and secure webmail pull.
> 
> > **[CipherMail email encryption and digital signatures](https://www.ciphermail.com)**
> >
> > Easy to use server-side email encryption for automatic encryption and digital signing of email.
> 
> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Users mailing list  
> Users(a)lists.ciphermail.com  
> [https://lists.ciphermail.com/mailman/listinfo/users](https://lists.ciphermail.com/mailman/listinfo/users)

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [August 20, 2018, 7:36am UTC](https://community.ciphermail.com/t/changing-mysql-credentials/638/4 "2018-08-20T07:36:25Z")

</div>

> If I remove the following lines from hibernate.mysql.cfg.xml:
> 
> \<property name="hibernate.connection.url"\>jdbc:mysql://127.0.0.1:3306/djigzo\</property\>^M  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<property name="hibernate.connection.username"\>USERNAME\</property\>^M  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<property name="hibernate.connection.password"\>PASSWORD\</property\>^M
> 
> I cannot login to the Ciphermail web GUI. Without the lines above, I get the back-end is not running error.
> 
> Also, I can't find an include for the hibernate.mysql.connection.xml in the hibernate.mysql.cfg.xml file.
> 
> The hibernate.mysql.cfg.xml seems like it's generated automatically by something. I suspect that's the case with the ^M characters in it.

Please download the tar file to confirm that hibernate.mysql.xml  
contains the include:

\<!-- include XML fragment with the database connection URL and  
credentials --\>  
&connectionsettings;

Older releases of hibernate.mysql.xml did not contain this import so you  
had to modify hibernate.mysql.connection.xml if you wanted to change the  
credentials. This was not optimal because if hibernate.mysql.xml was  
updated, you would either loose your changes or the files had to be  
merged manually.

You probably changed the credentials in the file hibernate.mysql.xml  
somewhere before 5/3/2016 (the date the version with include was  
provided) and did not merge the old and the new file. Therefore your  
(old) version does not contain the part to include  
hibernate.mysql.connection.xml.

Kind regards,

Martijn Brinkers

> **···**
>
> On 16-08-18 11:27, Dino Edwards via Users wrote:
> 
> > -----Original Message-----  
> > From: Users [mailto:users-bounces(a)[lists.ciphermail.com](http://lists.ciphermail.com)] On Behalf Of Martijn Brinkers via Users  
> > Sent: Thursday, August 9, 2018 3:25 AM  
> > To: users(a)lists.ciphermail.com  
> > Subject: Re: Changing MySQL credentials
> > 
> > On 06-08-18 13:16, Dino Edwards via Users wrote:
> > 
> > > If I wanted to change MySQL credentials for Ciphermail, what config  
> > > files would I have to modify?
> > > 
> > > The installation Guide only seems to mention the  
> > > /usr/share/djigzo/conf/database/hibernate.mysql.connection.xml file,  
> > > but the /usr/share/djigzo/conf/database/hibernate.mysql.cfg.xml also  
> > > seems to have the MySQL crendentials in it. Does the  
> > > /usr/share/djigzo/conf/database/hibernate.mysql.cfg.xml get generated  
> > > automatically by the system?
> > 
> > The file hibernate.mysql.cfg.xml should not have credentials in it.  
> > hibernate.mysql.cfg.xml includes the file hibernate.mysql.connection.xml (see &connectionsettings;)
> > 
> > Are you sure you are not referring to the file:
> > 
> > /usr/share/djigzo/conf/database/mysql.cnf
> > 
> > Because this file also contains the credentials. This file is used for backup/restore because MariaDB backup/restore functions need a password.  
> > So if you change the password and need to use the backup/restore functionality, you also need to update this password.
> > 
> > Kind regards,
> > 
> > Martijn Brinkers
> > 
> > --  
> > CipherMail email encryption
> > 
> > Email encryption with support for S/MIME, OpenPGP, PDF encryption and secure webmail pull.
> > 
> > [https://www.ciphermail.com](https://www.ciphermail.com)
> > 
> > Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.ciphermail.com  
> > [https://lists.ciphermail.com/mailman/listinfo/users](https://lists.ciphermail.com/mailman/listinfo/users)  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.ciphermail.com  
> > [https://lists.ciphermail.com/mailman/listinfo/users](https://lists.ciphermail.com/mailman/listinfo/users)
> 
> --  
> CipherMail email encryption
> 
> Email encryption with support for S/MIME, OpenPGP, PDF encryption and  
> secure webmail pull.
> 
> > **[CipherMail email encryption and digital signatures](https://www.ciphermail.com)**
> >
> > Easy to use server-side email encryption for automatic encryption and digital signing of email.
> 
> Twitter: [http://twitter.com/CipherMail](http://twitter.com/CipherMail)
