Announcement

Collapse
No announcement yet.

MySQL Connection Failed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • MySQL Connection Failed

    This scenario has been described several times in the forum, and I've aready tried many of the solutions offered. Apparently there is something different here.

    I've had vBulletin installed and running flawlessly for a couple of weeks. It's installed on a RAQ4i at 450hz with 256 mb. It's a dedicated server, and this is the only site on the server. It has the latest version of PHP and MySQL.

    Today it just stopped working and instead offered up this error message:

    =====================

    Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/sites/site2/web/vforum/admin/db_mysql.php on line 40

    =====================

    My config.php looks like this:

    =====================

    // type of database running
    // (only mysql is supported at the moment)
    $dbservertype="mysql";

    // hostname or ip of server
    $servername="localhost";

    // username and password to log onto db server
    $dbusername="xxxx";
    $dbpassword="xxxx";

    // name of database
    $dbname="vbulletin";

    =====================

    Like I said, this configuration worked properly for two weeks, so there's little reason to suspect that it wasn't correct or that it is now the problem.

    I ran phptest.php and phpinfo.php and they both reacted correctly.

    My server farm just install a new router and rebooted the server earlier in the day, but I'm having difficulty connecting these events to the problem, especially considering that the site was operational for several hours afterwards.

    I used the ASP Server Admin to restart the server, to no avail.

    I checked the MySQL databases that were setup on the server. There are only two, which I added while testing the MySQL installation. Although they originally tested ok, they both, plus another one I added, now fail the RAQ testing procedure, with this error message:

    =====================

    HTTP Error 506
    506 ASP Not Available

    The ASP service is unavailable for this host. Please check the URL to ensure that the path is correct.

    Please contact the server's administrator if this problem persists.

    =====================

    However, I don't think this has anything to do with the problem, because it appears according to the config.php file that the vBulletin installation created it's own MySQL database "vbulletin". I find it strange that this DB isn't listed in the RAQ ASP Admin list.

    So what it this? A ChiliSoft failure? Did the database configuration get screwed up during the reboot? Is MySQL corrupted? Do I need to reinstall MySQL / ChiliSoft / vBulletin? Do I need to somwhow change my config.php settings even though they were working properly?

    My problem is that I don't see enough of this sort of thing to diagnose the problem, but then I guess that's why we have a forum.

    Thanks

  • #2
    try as root user in shell/telnet

    1. shutdown mysql
    2. cd to /tmp and type

    Code:
     ln -s /var/lib/mysql/mysql.sock mysql.sock
    3. restart mysql
    :: Always Back Up Forum Database + Attachments BEFORE upgrading !
    :: Nginx SPDY SSL - World Flags Demo [video results]
    :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

    Comment


    • #3
      Tried without success

      Hi,

      Thanks for your response. I tried the command you suggested with the following results:

      [root admin]# mysqladmin shutdown
      mysqladmin: connect to server at 'localhost' failed
      error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)'
      Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
      [root admin]# cd /tmp
      [root /tmp]# In -s /var/lib/mysql/mysql.sock mysql.sock
      sh: In: command not found
      [root /tmp]# mysqladmin start
      mysqladmin: connect to server at 'localhost' failed
      error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)'
      Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
      [root /tmp]#

      It appears that even my attempts to stop mysql failed to connect, although I ran the command line you suggested and then followed through in an attempt to restart mysql, all to no apparent success.

      What's next?

      Comment


      • #4
        are you running these commands as root user on the server ?
        :: Always Back Up Forum Database + Attachments BEFORE upgrading !
        :: Nginx SPDY SSL - World Flags Demo [video results]
        :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

        Comment


        • #5
          My knowledge of telnet is limited, but I logged in using the su command (su = superuser, right?)

          Logging in as a site administrator I get the [admin admin]$

          When I change to su, I'm in as [root admin]#

          I understand that this means that I'm correctly logged in as the server's superuser.

          Thanks,

          Comment


          • #6
            type

            su -

            and try
            :: Always Back Up Forum Database + Attachments BEFORE upgrading !
            :: Nginx SPDY SSL - World Flags Demo [video results]
            :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

            Comment


            • #7
              Hi,

              Thanks, with the "su -" command I was able to get into the server as [root /root]

              Ran your command, here's the results:


              [root /root]# ln -s /var/lib/mysql.sock mysql.sock
              ln: mysql.sock: File exists
              [root /root]#


              So what's next?

              I know we're 12 hours apart, but I'm up all night, especially if I can get my forum back on line. My forum gets 10,000 visitors a day (no kidding, that's the average count), so there's a lot of people who are waiting on me.

              Thanks

              Comment


              • #8
                Originally posted by jackson007
                Hi,

                Thanks, with the "su -" command I was able to get into the server as [root /root]

                Ran your command, here's the results:


                [root /root]# ln -s /var/lib/mysql.sock mysql.sock
                ln: mysql.sock: File exists
                [root /root]#


                So what's next?

                I know we're 12 hours apart, but I'm up all night, especially if I can get my forum back on line. My forum gets 10,000 visitors a day (no kidding, that's the average count), so there's a lot of people who are waiting on me.

                Thanks
                did you shut down mysql before running command ?
                :: Always Back Up Forum Database + Attachments BEFORE upgrading !
                :: Nginx SPDY SSL - World Flags Demo [video results]
                :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

                Comment


                • #9
                  Hi,

                  Yes, but not through telnet.

                  I tried to shut mysql down through telnet with the following results:

                  [root /root]# mysqladmin shutdown
                  mysqladmin: connect to server at 'localhost' failed
                  error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql
                  .sock' (111)'
                  Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' ex
                  ists!

                  Apparently I couldn't use the "mysqladmin shutdown" command through telnet, so I used the ASP admin screen of the cobalt server to shut mysql down. I got a message to that effect, so I went back to telnet and re-did everything:

                  [root /root]# mysqladmin shutdown
                  mysqladmin: connect to server at 'localhost' failed
                  error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql
                  .sock' (111)'
                  Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' ex
                  ists!
                  [root /root]# ln -s /var/lib/mysql.sock mysql.sock
                  ln: mysql.sock: File exists
                  [root /root]#

                  This is where I'm at now.

                  Thanks.

                  Comment


                  • #10
                    try

                    su -

                    then


                    /etc/rc.d/init.d/mysql stop

                    then run command
                    :: Always Back Up Forum Database + Attachments BEFORE upgrading !
                    :: Nginx SPDY SSL - World Flags Demo [video results]
                    :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

                    Comment


                    • #11
                      Hi,

                      Here's what I got:

                      [root /root]# /etc/rc.d/init.d/mysql stop
                      No mysqld pid file found. Looked for /home/mysql/cobalt5.vortechhosting.com.pid.
                      [root /root]#

                      I used my FTP to check the contents of this folder. Indeed, there is no file with the above name.

                      I don't know if this is relevant, but there IS a file named cobalt5.vortechhosting.com.err dated the same date and time as the forum's crash.

                      I do tech support for my own VBA software. My customers are construction contractors with sometimes limited computer skills, so I occassionally have to talk them through procedures like finding and emailing a file. Dealing with this problem, I get an understanding how they probably feel on the other end of my phone calls, sheepishly stumbling around in an unknown environment wishing they had better knowledge of what they were doing.

                      Thanks for your patience.

                      Comment


                      • #12
                        Still need help.

                        Hi,

                        Anybody out there? I could use some help because this problem isn't going away.

                        Thanks all,

                        Jackson007

                        Comment


                        • #13
                          i got your pm... check your pms
                          :: Always Back Up Forum Database + Attachments BEFORE upgrading !
                          :: Nginx SPDY SSL - World Flags Demo [video results]
                          :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

                          Comment

                          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                          Working...
                          X