Results 1 to 2 of 2

Thread: MySQL connection difficulties.

  1. #1
    koalas is offline Junior Member
    Join Date
    Dec 2011
    Posts
    7
    Rep Power
    3

    Default MySQL connection difficulties.

    We have a Zimbra installation in a virtual environment. (CentOS)

    And to make a long story short we had some resource constraints that were giving the Zimbra server a hard time. I fixed the resource problem, but Zimbra was still acting weird, so I decided to reboot.

    During reboot, the system displayed a black screen that said "System is Restarting".

    I waited for quite some time before guessing that the system was hung, so I did a hard reboot.

    When the system came back up, some of the zimbra services weren't starting like the logwatch, and noticed that the connections to the database were failing.

    Assuming corruption, I started in trying to follow the database recovery steps, but the thing is... the database was starting but connections were being rejected.

    If I looked in the mysql log, the last line would read:


    120502 9:48:21 [Note] /opt/zimbra/mysql/libexec/mysqld: ready for connections.
    Version: '5.1.58-log' socket: '/opt/zimbra/db/mysql.sock' port: 7306 Source distribution


    Soo... the database is up?

    But if I would try to connect to the database, even using the zimbra tools, I would get the following message:


    [root@zimbra1 bin]# sudo -u zimbra ./zmmysqlstatus
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    Now, it's obvious that zimbra is trying to connect using a different socket than the database is actually listening on.

    Why? No clue.

    Looking in /opt/zimbra/conf/my.cnf

    the socket is clearly specified as /opt/zimbra/db/mysql.sock

    Why Zimbra now wants to use the /var directory is beyond me.

    So I went into /var/lib ... created a directory called 'mysql' and then made a symbolic link to mysql.sock in the /opt/zimbra/conf directory, and after a reboot, everything works again.

    Why would zimbra refuse to listen to it's own configuration and opt for something that never existed?

  2. #2
    justdave is offline Trained Alumni
    Join Date
    Nov 2008
    Location
    Grand Rapids, MI
    Posts
    123
    Rep Power
    6

    Default

    Quote Originally Posted by koalas View Post
    [root@zimbra1 bin]# sudo -u zimbra ./zmmysqlstatus
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    Now, it's obvious that zimbra is trying to connect using a different socket than the database is actually listening on.

    Why? No clue.

    Why would zimbra refuse to listen to it's own configuration and opt for something that never existed?
    Because you're using sudo, and it doesn't modify your environment correctly when you do that (zimbra user's profile scripts don't get run which do some environment setup)

    Try "sudo su - zimbra" first, then run zmmysqlstatus from that prompt.

    Or: sudo su - zimbra -c 'zmmysqlstatus'

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. ldap no connection
    By jjj0923 in forum Installation
    Replies: 2
    Last Post: 03-13-2011, 11:00 AM
  2. Zimbra fails after working for 2 weeks
    By Linsys in forum Administrators
    Replies: 10
    Last Post: 10-07-2008, 12:42 AM
  3. [SOLVED] Install Problem in Ubuntu 6.06 Server
    By xtimox in forum Installation
    Replies: 16
    Last Post: 03-27-2008, 09:36 AM
  4. DNS Questions and Trouble Installing
    By smurraysb in forum Installation
    Replies: 22
    Last Post: 03-14-2008, 03:27 PM
  5. Replies: 2
    Last Post: 02-12-2008, 11:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •