ERROR 2006 at line 311: MySQL server has gone away

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Misteraven
    Member
    • Aug 2002
    • 46
    • 3.5.x

    ERROR 2006 at line 311: MySQL server has gone away

    I was trying to restore my messageboard from a mysqldump and get the following error:

    ERROR 2006 at line 311: MySQL server has gone away

    I searched the forums and saw a reference that I had read after a google search as well (http://www.vbulletin.com/forum/showt...265#post310265), but I'm afraid I still don't really understand what the deal is, or how to fix it.

    Here's what I get when I check the version:

    mysqladmin Ver 8.23 Distrib 3.23.49, for redhat-linux-gnu on i386
    Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
    This software comes with ABSOLUTELY NO WARRANTY. This is free software,
    and you are welcome to modify and redistribute it under the GPL license

    Server version 3.23.49-log
    Protocol version 10
    Connection Localhost via UNIX socket
    UNIX socket /var/lib/mysql/mysql.sock
    Uptime: 2 days 16 hours 22 min 27 sec

    Threads: 3 Questions: 6810561 Slow queries: 9 Opens: 738 Flush tables: 1 Open tables: 285 Queries per second avg: 29.388

    I guess I need to upgrade mysql as well, but before I screw things up further, I figured I'd seek some help first.

    Anyone know what any of this means and what to do to fix it?

    Thanks for any help.
  • Misteraven
    Member
    • Aug 2002
    • 46
    • 3.5.x

    #2
    Here's some more info I got from mysql:

    connect_timeout current value: 0
    max_allowed_packet current value: 16777216
    net_buffer_length current value: 16384
    select_limit current value: 1000
    max_join_size current value: 1000000

    Comment

    • Steve Machol
      Former Customer Support Manager
      • Jul 2000
      • 154488

      #3
      The link you posted in your first message is the most comprehenasive resource for this problem. I would start with the wait_timeout variable in your my.cnf file. What's it set to?
      Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
      Change CKEditor Colors to Match Style (for 4.1.4 and above)

      Steve Machol Photography


      Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


      Comment

      • Misteraven
        Member
        • Aug 2002
        • 46
        • 3.5.x

        #4
        Sorry, I'm not at all familiar with any of this. I guess that's why the other link wasnt making sense. Anyhow, here's my my.cnf file:

        # Example mysql config file for very` large systems.
        #
        # This is for large system with memory of 1G-2G where the system runs mainly
        # MySQL.
        #
        # You can copy this file to
        # /etc/my.cnf to set global options,
        # mysql-data-dir/my.cnf to set server-specific options (in this
        # installation this directory is /var/lib/mysql) or
        # ~/.my.cnf to set user-specific options.
        #
        # One can in this file use all long options that the program supports.
        # If you want to know which options a program support, run the program
        # with --help option.

        # The following options will be passed to all MySQL clients
        [client]
        #password = your_password
        port = 3306
        socket = /var/lib/mysql/mysql.sock

        # Here follows entries for some specific programs

        # The MySQL server
        [mysqld]
        port = 3306
        socket = /var/lib/mysql/mysql.sock
        datadir = /var/lib/mysql
        skip-locking
        set-variable = key_buffer=384M
        set-variable = max_allowed_packet=1M
        set-variable = table_cache=512
        set-variable = sort_buffer=2M
        set-variable = record_buffer=2M
        set-variable = thread_cache=8
        # Try number of CPU's*2 for thread_concurrency
        # set-variable = thread_concurrency=8
        set-variable = thread_concurrency=2
        set-variable = myisam_sort_buffer_size=64M
        log-bin
        server-id = 1

        # Point the following paths to different dedicated disks
        #tmpdir = /tmp/
        #log-update = /path-to-dedicated-directory/hostname

        # Uncomment the following if you are using BDB tables
        #set-variable = bdb_cache_size=384M
        #set-variable = bdb_max_lock=100000

        # Uncomment the following if you are using Innobase tables
        #innodb_data_file_path = ibdata1:2000M;ibdata2:2000M
        #innodb_data_home_dir = /var/lib/mysql/
        #innodb_log_group_home_dir = /var/lib/mysql/
        #innodb_log_arch_dir = /var/lib/mysql/
        #set-variable = innodb_mirrored_log_groups=1
        #set-variable = innodb_log_files_in_group=3
        #set-variable = innodb_log_file_size=5M
        #set-variable = innodb_log_buffer_size=8M
        #innodb_flush_log_at_trx_commit=1
        #innodb_log_archive=0
        #set-variable = innodb_buffer_pool_size=16M
        #set-variable = innodb_additional_mem_pool_size=2M
        #set-variable = innodb_file_io_threads=4
        #set-variable = innodb_lock_wait_timeout=50

        skip-innodb

        [mysqldump]
        quick
        set-variable = max_allowed_packet=16M

        [mysql]
        no-auto-rehash
        # Remove the next comment character if you are not familiar with SQL
        #safe-updates

        [isamchk]
        set-variable = key_buffer=256M
        set-variable = sort_buffer=256M
        set-variable = read_buffer=2M
        set-variable = write_buffer=2M

        [myisamchk]
        set-variable = key_buffer=256M
        set-variable = sort_buffer=256M
        set-variable = read_buffer=2M
        set-variable = write_buffer=2M

        [mysqlhotcopy]
        interactive-timeout

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

        [safe_mysqld]
        err-log=/var/log/mysqld.log
        pid-file=/var/run/mysqld/mysqld.pid

        Comment

        • Steve Machol
          Former Customer Support Manager
          • Jul 2000
          • 154488

          #5
          Edit my.cnf and under:

          # The MySQL server
          [mysqld]
          ...add this:

          set-variable = wait_timeout = 57600
          Then restart MySQL. If that doesn't work then you may need to get some help from your web hosting company.
          Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
          Change CKEditor Colors to Match Style (for 4.1.4 and above)

          Steve Machol Photography


          Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


          Comment

          • Misteraven
            Member
            • Aug 2002
            • 46
            • 3.5.x

            #6
            Steve,

            Unfortunately your suggestion didn't work. I'm still getting the same error. As far as talking to my webhosting company, there isnt any - It's my own server.

            Any other suggestions?

            Comment

            • Misteraven
              Member
              • Aug 2002
              • 46
              • 3.5.x

              #7
              As written in the post referenced above and from http://www.mysql.com/doc/en/Gone_away.html:

              "You can also get these errors if you send a query to the server that is incorrect or too large. If mysqld gets a packet that is too large or out of order, it assumes that something has gone wrong with the client and closes the connection. If you need big queries (for example, if you are working with big BLOB columns), you can increase the query limit by starting mysqld with the -O max_allowed_packet=# option (default 1M). The extra memory is allocated on demand, so mysqld will allocate more memory only when you issue a big query or when mysqld must return a big result row!

              You will also get a lost connection if you are sending a packet >= 16M if your client is older than 4.0.8 and your server is 4.0.8 and above, or the other way around. "

              The dump I'm trying to restore is roughly 680mb, so this certainly seems to be the issue. Though I'm not getting their solution. What exactly would I type from a command line?

              Comment

              • Steve Machol
                Former Customer Support Manager
                • Jul 2000
                • 154488

                #8
                Sorry but I've reached the limit of my knowledge on this issue.
                Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
                Change CKEditor Colors to Match Style (for 4.1.4 and above)

                Steve Machol Photography


                Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


                Comment

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