Menu

mysql problem

Help
2004-03-31
2004-04-23
  • Shawn Walker

    Shawn Walker - 2004-03-31

    i am getting repeated messages in my /var/log/messages log.

    Mar 31 14:54:03 megatron httpd: libnss-mysql: mysql_query failed: MySQL server has gone away, trying again (2)

    what is the cause of this and how would i fix it?

     
    • Shawn Walker

      Shawn Walker - 2004-03-31

      btw, i am able to login via ssh and imap. pop3 and ftp reject me. odd??

       
      • Ben Goodwin

        Ben Goodwin - 2004-04-01

        What software are you using for pop3 and ftp?  What OS/distro are you using?  Are there pam configs (e.g. /etc/pam.d/pop and /etc/pam.d/ftp) which aren't the same as they are for ssh/imap?

         
    • Ben Goodwin

      Ben Goodwin - 2004-04-01

      Those message are normal as the MySQL server times out an idle connection and libnss-mysql tries to run a query (to find the connection has been severed, and must reconnect).  Unless they're happening *really* frequently or it's causing problems, I wouldn't worry too much about it.  What's your idle timeout set to (if anything) in /etc/my.cnf?

       
    • Shawn Walker

      Shawn Walker - 2004-04-22

      i don't have an idle timeout set in my my.cnf file. this is the exten of my my.cnf file

      [mysqld]
      datadir=/var/lib/mysql
      socket=/var/lib/mysql/mysql.sock
      set-variable=wait_timeout=60                                                                                                                            
      [mysql.server]
      user=mysql
      basedir=/var/lib
                                                                                                                                  
      [safe_mysqld]
      err-log=/var/log/mysqld.log
      pid-file=/var/run/mysqld/mysqld.pid

      i think it may be causing some sort of problem. i have a short perl script in my httpd.conf file which connects to a mysql database to pull down vhost defs. this has stopped working and that message began popping up. this worked fine earlier today. i fixed all the problems i had been having prior.

       
      • Ben Goodwin

        Ben Goodwin - 2004-04-22

        This is your idle timeout setting:

        set-variable=wait_timeout=60

        If it's causing problems or lots of messages, try increasing it some - 600, or 3600 or more.. the default is 28800 which can be way too high, hence the recommendation for something a lot smaller.

         
        • Shawn Walker

          Shawn Walker - 2004-04-22

          well, i fixed the problem. i already increased my wait_timeout to 300 and the messages dropped in frequency. the perl problem turned out to be unrelated. btw, i want to thank you for this project. IMHO the largest single step to autonomously generated user accounts yet.

          a suggestion, could you modify it to work with the ssl that's in mysql4?

           
          • Ben Goodwin

            Ben Goodwin - 2004-04-22

            Glad to hear it!

            SSL does work - just make sure the client and server are properly configured outside libnss-mysql and that should do the trick.  If you need to specify ssl parameters to the mysql client, use /etc/my.cnf

             
            • Shawn Walker

              Shawn Walker - 2004-04-23

              wow. pimptastic.

               

Log in to post a comment.