1 (edited by ruslancfc 2015-05-26 16:23:37)

Topic: Install problems with remote mysql server

==== Required information ====

- iRedMail version: 0.9.1
- Store mail accounts in which backend (remote - MySQL 5.6.24):
- Web server (Apache):Apache
- Linux/BSD distribution name and version: Centos 7 x64
- Related log if you're reporting an issue:
====

Hi all,

I try to install iredmail with remote mysql server as it is described in website howto, but when iReadMail configuration has started, i receive errors.

[ INFO ] Create self-signed SSL certification files (2048 bits).
[ INFO ] Create required system account: vmail, iredadmin, iredapd.
[ INFO ] Configure Apache web server and PHP.
[ INFO ] Configure PHP.
[ INFO ] Configure MariaDB database server.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[ INFO ] Setup daily cron job to backup SQL databases: /var/vmail/backup/backup_mysql.sh
[ INFO ] Configure Postfix (Message Transfer Agent).
[ INFO ] Configure Cluebringer (postfix policy server).
groupadd: group 'cluebringer' already exists
useradd: user 'cluebringer' already exists
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[ INFO ] Configure Dovecot (pop3/imap/managesieve server).
[ INFO ] Configure ClamAV (anti-virus toolkit).
[ INFO ] Configure Amavisd-new (interface between MTA and content checkers).
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[ INFO ] Configure SpamAssassin (content-based spam filter).
[ INFO ] Configure iRedAPD (postfix policy daemon).
[ INFO ] Configure iRedAdmin (official web-based admin panel).
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[ INFO ] Configure Fail2ban (authentication failure monitor).
[ INFO ] Configure Roundcube webmail.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[ INFO ] Configure Awstats (logfile analyzer for mail and web server).

On remote server firewall is disabled, and no any problems with grants in mysql.

Command
MYSQL_SERVER='x.x.x.x.' MYSQL_ROOT_USER='user_name' MYSQL_GRANT_HOST='y.y.y.y' bash iRedMail.sh

Thanks.

----

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

2

Re: Install problems with remote mysql server

A known bug in iRedMail-0.9.1, please try this patch:
http://www.iredmail.org/forum/post39365.html#p39365

Note: this fix will be available in upcoming 0.9.2 release.

3

Re: Install problems with remote mysql server

ZhangHuangbin wrote:

A known bug in iRedMail-0.9.1, please try this patch:
http://www.iredmail.org/forum/post39365.html#p39365

Note: this fix will be available in upcoming 0.9.2 release.

Hi,
Thanks!

4

Re: Install problems with remote mysql server

Let me know whether or not the patch works for you.

5

Re: Install problems with remote mysql server

ZhangHuangbin wrote:

Let me know whether or not the patch works for you.

OK, i'll let you know

6

Re: Install problems with remote mysql server

ruslancfc wrote:
ZhangHuangbin wrote:

Let me know whether or not the patch works for you.

OK, i'll let you know




Unfortunately, i receive same errors, after mysql.sh file modify.

System information

[root@mail runtime]# uname -a
Linux mail.example.com 3.10.0-123.8.1.el7.x86_64 #1 SMP Mon Sep 22 19:06:58 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

7

Re: Install problems with remote mysql server

What errors?

8

Re: Install problems with remote mysql server

ZhangHuangbin wrote:

What errors?

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

My mysql.sh file after modify

mysql_generate_defauts_file_root()
{
    if [ X"${BACKEND_ORIG}" == X'MARIADB' ]; then
        ECHO_INFO "Configure MariaDB database server."
    else
        ECHO_INFO "Configure MySQL database server."
    fi

    ECHO_DEBUG "Generate temporary defauts file for MySQL client option --defaults-file: ${MYSQL_DEFAULTS_FILE_ROOT}."
    cat >> ${MYSQL_DEFAULTS_FILE_ROOT} <<EOF
[client]
user=${MYSQL_ROOT_USER}
password=${MYSQL_ROOT_PASSWD}
EOF

    if [ X"${LOCAL_ADDRESS}" != X'127.0.0.1' ]; then
        cat >> ${MYSQL_DEFAULTS_FILE_ROOT} <<EOF
host=${MYSQL_SERVER}
port=${MYSQL_SERVER_PORT}
EOF
    fi
}

9

Re: Install problems with remote mysql server

Up

10

Re: Install problems with remote mysql server

My mistake, please modify it with below code:

    if [ X"${LOCAL_ADDRESS}" != X'127.0.0.1' -o X"${MYSQL_SERVER}" != X'127.0.0.1' ]; then
        cat >> ${MYSQL_DEFAULTS_FILE_ROOT} <<EOF
host=${MYSQL_SERVER}
port=${MYSQL_SERVER_PORT}
EOF
    fi

11

Re: Install problems with remote mysql server

After modify, installation was completed without any errors. Patch works!

Thanks!!!