1

Topic: /var/lib/mysql/mysql.sock missing

==== Required information ====
- iRedMail version: 0.6.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CentOS 5
- Related log if you're reporting an issue: error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
====

Hi to All,

I've been struggling solving this problem but nothing work. someone please HELP me....

after a power outage on our office when I turned on our email server wont receive and send emails;

here's the maillog:

[root@sulat ~]# tail -f /var/log/maillog
Aug 25 15:24:21 sulat postfix/smtpd[2335]: warning: problem talking to service rewrite: Success
Aug 25 15:24:21 sulat postfix/smtpd[2921]: connect from unknown[74.125.82.177]
Aug 25 15:24:28 sulat postfix/smtpd[2922]: connect from unknown[91.211.241.86]
Aug 25 15:24:41 sulat postfix/smtpd[2925]: connect from unknown[98.139.91.193]
Aug 25 15:24:43 sulat roundcube: MDB2 Error: unknown error (-1): _doConnect: [Error message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)] [Native code: 2002] [Native message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]
Aug 25 15:24:43 sulat roundcube: [25-Aug-2012 15:24:43 +0800]: DB Error: _doConnect: [Error message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)] [Native code: 2002] [Native message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]  ** mysqli(mysqli)://roundcube:xxx@localhost/roundcubemail in /var/www/roundcubemail-0.3.1/program/include/rcube_mdb2.php on line 100 (GET /?_task=mail&_action=keep-alive&_t=1345879996046&_remote=1&_=1345879996046&_unlock=0)
Aug 25 15:24:48 sulat postfix/smtpd[2927]: connect from unknown[98.139.52.246]
Aug 25 15:24:54 sulat postfix/smtpd[2928]: connect from unknown[209.255.203.135]
Aug 25 15:24:58 sulat roundcube: MDB2 Error: unknown error (-1): _doConnect: [Error message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)] [Native code: 2002] [Native message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]
Aug 25 15:24:58 sulat roundcube: [25-Aug-2012 15:24:58 +0800]: DB Error: _doConnect: [Error message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)] [Native code: 2002] [Native message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)]  ** mysqli(mysqli)://roundcube:xxx@localhost/roundcubemail in /var/www/roundcubemail-0.3.1/program/include/rcube_mdb2.php on line 100 (GET /?_task=mail&_action=check-recent&_t=1345880015170&_list=1&_quota=1&_remote=1&_=1345880015173&_unlock=1)

-------------------------------------------------------------------------------------------------------------------------------------------------
[root@sulat ~]# tail -f /var/log/mysqld.log
0x3ea852
0xd1a1fe
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/using … trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
120825 15:07:10  mysqld ended

----------------------------------------------------------------------------------------------------------------------------------------------------
I checked all services but Mysql wont work:

[root@sulat ~]# /etc/init.d/mysqld status
mysqld is stopped
[root@sulat ~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]

-----------------------------------------------------------------------------------------------------------------------------------------------------
Here's my /etc/my.cnf configuration

[mysqld]
#bind-address            = 127.0.0.1
port                    = 3306
default-character-set   = utf8
datadir                 = /var/lib/mysql
socket                  = /var/lib/mysql/mysql.sock
user                    = mysql

skip-locking
#skip-bdb
#skip-networking
query-cache-type    = 1
query-cache-size    = 64M
query_cache_limit   = 10M

thread_cache_size   = 8

set-variable = max_connections=1024
#set-variable = max_connect_errors=150
#ssl-ca =
ssl-cert = /etc/pki/tls/certs/iRedMail_CA.pem
ssl-key = /etc/pki/tls/private/iRedMail.key
ssl-cipher = ALL

[client]
default-character-set=utf8

[mysql.server]
user        = mysql
basedir     = /var/lib

[mysqld_safe]
log-error   = /var/log/mysqld.log
pid-file    = /var/run/mysqld/mysqld.pid
-------------------------------------------------------------------------------------------------------------------------------------------------------

I think this is the error:

[root@sulat log]# mysqladmin version
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!


Thank you in advance for those will help me...

Ruby Alberto

----

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

2

Re: /var/lib/mysql/mysql.sock missing

- Make sure MySQL is running.
- If it cannot start, check its log file to see what the problem is.

3

Re: /var/lib/mysql/mysql.sock missing

ZhangHuangbin wrote:

- Make sure MySQL is running.
- If it cannot start, check its log file to see what the problem is.

MySQL wont start....

[root@sulat config]# cd /
[root@sulat /]# service mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]

here's the log file /var/log/mysqld.log

[root@sulat /]# tail -f /var/log/mysqld.log
0xbd0852
0x6791fe
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/using … trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
120825 16:14:34  mysqld ended

4

Re: /var/lib/mysql/mysql.sock missing

rhalberto wrote:
ZhangHuangbin wrote:

- Make sure MySQL is running.
- If it cannot start, check its log file to see what the problem is.

MySQL wont start....

[root@sulat config]# cd /
[root@sulat /]# service mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]

here's the log file /var/log/mysqld.log

[root@sulat /]# tail -f /var/log/mysqld.log
0xbd0852
0x6791fe
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/using … trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
120825 16:14:34  mysqld ended


is it ok if i reinstall mysql and mysql-server?

5

Re: /var/lib/mysql/mysql.sock missing

Here's new log for MySQL


#less /var/log/mysqld.log
120825 17:50:22  mysqld started
InnoDB: Log scan progressed past the checkpoint lsn 0 2288780427
120825 17:50:22  mysqld started
InnoDB: Log scan progressed past the checkpoint lsn 0 2288780427
120825 17:50:22  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 0 2288781803
120825 17:50:22  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 120825 17:50:22 - mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=0
read_buffer_size=131072
max_used_connections=0
max_connections=1024
threads_connected=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 2228216 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=(nil)
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0xb20c53a8, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x818e628
0x842ec39
0x842f913
0x83f41c6
0x83f6148
0x83e1729
0x840e95b
0x8350748
0xb63852
0x2cf1fe
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://dev.mysql.com/doc/mysql/en/using … trace.html and follow instructions on how to resolve the stack trace. Resolved
stack trace is much more helpful in diagnosing the problem, so please do
resolve it
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
120825 17:50:22  mysqld ended

6

Re: /var/lib/mysql/mysql.sock missing

No idea at all. Please post to MySQL mailing list instead, there may be some other experts can help you. Sorry. sad

Some questions:

- Please show us your my.cnf. Did you modify it?
- How much is the hardware memory?

7

Re: /var/lib/mysql/mysql.sock missing

ZhangHuangbin wrote:

No idea at all. Please post to MySQL mailing list instead, there may be some other experts can help you. Sorry. sad

Some questions:

- Please show us your my.cnf. Did you modify it?
- How much is the hardware memory?

i did not modify my my.cnf
my hardware memory is 2GB

[root@sulat ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      451G  280G  148G  66% /
/dev/hda1              99M   38M   57M  40% /boot
tmpfs                 247M     0  247M   0% /dev/shm


Here's my /etc/my.cnf configuration

[mysqld]
#bind-address            = 127.0.0.1
port                    = 3306
default-character-set   = utf8
datadir                 = /var/lib/mysql
socket                  = /var/lib/mysql/mysql.sock
user                    = mysql

skip-locking
#skip-bdb
#skip-networking
query-cache-type    = 1
query-cache-size    = 64M
query_cache_limit   = 10M

thread_cache_size   = 8

set-variable = max_connections=1024
#set-variable = max_connect_errors=150
#ssl-ca =
ssl-cert = /etc/pki/tls/certs/iRedMail_CA.pem
ssl-key = /etc/pki/tls/private/iRedMail.key
ssl-cipher = ALL

[client]
default-character-set=utf8

[mysql.server]
user        = mysql
basedir     = /var/lib

[mysqld_safe]
log-error   = /var/log/mysqld.log
pid-file    = /var/run/mysqld/mysqld.pid


Any expert who can help please.....!!

Can you teach me how to migrate all settings and emails plus accounts to latest version of iRedmail....
I think thats my final option to get my email server running...

Thank you ZhangHuangbin for you replies...

8

Re: /var/lib/mysql/mysql.sock missing

ZhangHuangbin can i reinstall mysql and mysql-server? How to backup and restore it database?

Thank you again

9

Re: /var/lib/mysql/mysql.sock missing

Reference:
http://www.iredmail.org/wiki/index.php? … ail.Server