1

Topic: Can't connect to mysql: Can't connect to MySQL server on '127.0.0.1

hi Mr Zhang

I have this problem connecting to my mysql database.

What to do ?

Thanx
==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.2

- Linux/BSD distribution name and version: debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): 10.0.22-MariaDB-0+deb8u1
- Web server (Apache or Nginx):  Apache/2.4.10
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
[dbd:error] [pid 717] (20014)Internal error: AH00629: Can't connect to mysql: Can't connect to MySQL server on '127.0.0.1' (111)
[dbd:error] [pid 717] (20014)Internal error: AH00633: failed to initialise
[dbd:crit] [pid 717] (20014)Internal error: AH00636: child init failed!
====

----

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

2

Re: Can't connect to mysql: Can't connect to MySQL server on '127.0.0.1

MySQL service is NOT running, please try to start it.

By the way, you'd better show us which software raised this error message, in which log file you found the error message.
If you can clearly explain the issue with related log/error message, it's very helpful for us to troubleshoot for you.

3

Re: Can't connect to mysql: Can't connect to MySQL server on '127.0.0.1

Hullo Mr Zhang

I have a similar mysql  problem of connecting to my mysql database. But i realised that at initial installation i was not asked for the mysql root password


Thanx
==== Required information ====

root@iredmail:/var/log/apache2# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:        14.04
Codename:       trusty

- iRedMail version (check /etc/iredmail-release):  0.9.3
-  Web server (Nginx): nginx/1.4.6 (Ubuntu)
- Manage mail accounts with iRedAdmin-Pro? Not yet as per now
- Related log if you're reporting an issue:
root@iredmail:/var/log/apache2# tail -f error.log

[Wed Dec 23 21:54:55.726436 2015] [dbd:error] [pid 2883] (20014)Internal error: AH00629: Can't connect to mysql: Access denied for user 'vmail'@'localhost' (using password: YES)
[Wed Dec 23 21:54:55.726507 2015] [dbd:error] [pid 2883] (20014)Internal error: AH00633: failed to initialise
[Wed Dec 23 21:54:55.726518 2015] [dbd:crit] [pid 2883] (20014)Internal error: AH00636: child init failed!
[Wed Dec 23 21:54:55.727469 2015] [dbd:error] [pid 2884] (20014)Internal error: AH00629: Can't connect to mysql: Access denied for user 'vmail'@'localhost' (using password: YES)
[Wed Dec 23 21:54:55.727538 2015] [dbd:error] [pid 2884] (20014)Internal error: AH00633: failed to initialise
[Wed Dec 23 21:54:55.727548 2015] [dbd:crit] [pid 2884] (20014)Internal error: AH00636: child init failed!
[Wed Dec 23 21:55:41.775471 2015] [dbd:error] [pid 2912] (20014)Internal error: AH00629: Can't connect to mysql: Access denied for user 'vmail'@'localhost' (using password: YES)
[Wed Dec 23 21:55:41.775579 2015] [dbd:error] [pid 2912] (20014)Internal error: AH00633: failed to initialise
[Wed Dec 23 21:55:41.775590 2015] [dbd:crit] [pid 2912] (20014)Internal error: AH00636: child init failed!
[Wed Dec 23 22:06:06.439003 2015] [mpm_prefork:notice] [pid 2876] AH00169: caught SIGTERM, shutting down

root@iredmail:/var/vmail/backup# ./backup_mysql.sh
[ERROR] MySQL username or password is incorrect in file ./backup_mysql.sh.
Please fix them first.

root@iredmail:/var/vmail/backup# service mysql start
start: Job failed to start

Is there a short cut that i can use for i have already migrated my mailboxes to the server and they are about 6TB of storage and this takes quite sometime through the chown and chmod commands during installation.And attached is my install.log file

Any assistance is highly appreciated
Thanx
Moses



portmeirion wrote:

hi Mr Zhang

I have this problem connecting to my mysql database.

What to do ?

Thanx
==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.2

- Linux/BSD distribution name and version: debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): 10.0.22-MariaDB-0+deb8u1
- Web server (Apache or Nginx):  Apache/2.4.10
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
[dbd:error] [pid 717] (20014)Internal error: AH00629: Can't connect to mysql: Can't connect to MySQL server on '127.0.0.1' (111)
[dbd:error] [pid 717] (20014)Internal error: AH00633: failed to initialise
[dbd:crit] [pid 717] (20014)Internal error: AH00636: child init failed!
====

Post's attachments

install.log 11.5 kb, 2 downloads since 2015-12-25 

You don't have the permssions to download the attachments of this post.

4

Re: Can't connect to mysql: Can't connect to MySQL server on '127.0.0.1

According to `install.log`, iRedMail cannot copy sample MySQL config file to /etc/mysql/my.cnf, because /etc/mysql/ didn't exist.

Do you have other SQL databases in MySQL? If yes, then you can reset a root password manually, and update /var/vmail/backup/backup_mysql.sh with correct MySQL root password so that it can backup database every night.

kibsmoses wrote:

Is there a short cut that i can use for i have already migrated my mailboxes to the server and they are about 6TB of storage and this takes quite sometime through the chown and chmod commands during installation.And attached is my install.log file

If iRedMail didn't create other required SQL databases, you need to re-install iRedMail.

A simple way to avoid the time wasting on 'chown/chmod', you can specify a different directory during installation, e.g. /opt/vmail/. After installation, remove '/opt/vmail/', and create a symbol link of the real mailbox storage directory to /opt/vmail/. If your storage is a NFS/NAS/..., you can umount it BEFORE iRedMail installation, and mount it after installation.