1

Topic: MySQL backup for remote mysql

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.4.0 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer?  downloadable installer
- Linux/BSD distribution name and version:  Ubuntu 20.04 aarch64
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I setup my server using remote SQL following this document https://docs.iredmail.org/install.iredm … erver.html
However, the mysql backup tools doesn't seem to recognize the configure and still try to access local mysql and complain
[ERROR] MySQL username or password is incorrect in file /var/vmail/backup/backup_mysql.sh.
Please fix them first.

Is there a way to update server configuration in backup_mysql? This seem like a bug.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: MySQL backup for remote mysql

dnwk210 wrote:

Is there a way to update server configuration in backup_mysql? This seem like a bug.

Update the SQL server address/port/user/password in /root/.my.cnf.

3

Re: MySQL backup for remote mysql

ZhangHuangbin wrote:
dnwk210 wrote:

Is there a way to update server configuration in backup_mysql? This seem like a bug.

Update the SQL server address/port/user/password in /root/.my.cnf.


I have recently upgraded Ubuntu from 18.04 to 20.04.03 and now Cron Daemon is reporting:
[ERROR] MySQL username or password is incorrect in file /var/vmail/backup/backup_mysql.sh.
Please fix them first.

So I found this reply on the forum and have checked the file /root/.my.cnf and it correctly has the following:

# WARNING: Do NOT remove this file. It is also used by backup scripts to access
#          SQL databases.
[client]
host=127.0.0.1
port=3306
user=root
password="correct" <- showing the correct password here

I also used to receive a second email from Cron Daemon each day with title Cron <root@mail> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) and body /etc/cron.daily/logrotate:
mysqld is alive

Now I am not receiving this email at all, but everything else seems to be working ok.

What else would be stopping the sql backup from working properly?

4

Re: MySQL backup for remote mysql

You understand what remote means?

i doubt host=127.0.0.1 is your remote mysql ip