Announcement

Collapse
No announcement yet.

"too many connections" error on forum on mysqldump

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

  • "too many connections" error on forum on mysqldump

    When I try to backup my database using SSH, I keep getting 'too many connections' errors on my site. I currently allow 500 connections at once, but before I increase that number, I'd like to find out if anybody knows whether I'm doing something wrong.

    Here is the command I'm using:

    Code:
     mysqldump --opt -Q -u [B]DATABASE USERNAME[/B] -p [B]DATABASE NAME[/B] < [B]/PATH/TO/THE/DATABASE/DUMP[/B]
    Thanks for any insight you may have.

  • #2
    That looks fine. You'll need to increase that setting.
    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


    • #3
      Just increased it to allow 1000 concurrent connections. Same error.

      I thought the mysqldump command would take only one connection.

      Comment


      • #4
        The 'mysqldump' command does take 1 connection. However, in order to get a consistent snapshot it needs to lock your tables.

        The result of that lock is that all other connection attempts after the first attempted write will need to wait until the dump is complete. If you get a decent amount of traffic then you will run out of available MySQL connections pretty quickly.

        In order to avoid that issue you should probably just disable httpd while you're backing up.
        Jason Litka - Utter Ramblings

        Comment


        • #5
          I just tried again, but I shut down my board first. No dice. All MySQL-driven sites on the server gave the error.

          There's got to be a way to do this without shutting down all sites, hasn't there??

          Comment


          • #6
            Use mysqlhotcopy, it is quicker. My 220Mb db takes just a few seconds. Read THIS.

            Bob

            Comment


            • #7
              Originally posted by biggazillakilla View Post
              I just tried again, but I shut down my board first. No dice. All MySQL-driven sites on the server gave the error.

              There's got to be a way to do this without shutting down all sites, hasn't there??
              Turning the site off in admincp isn't enough as there is still DB access. You would need to turn off httpd in order to keep the connections piling up.

              Originally posted by Bob Isaac View Post
              Use mysqlhotcopy, it is quicker. My 220Mb db takes just a few seconds. Read THIS.

              Bob
              I've never had luck getting mysqlhotcopy to work well. It was always slower than using mysqldump from the console with httpd turned off and I very rarely got a complete DB dump. However, if it works for you, great.
              Jason Litka - Utter Ramblings

              Comment


              • #8
                Wow, I just checked:

                Data Usage: ~ 400 MB
                Index Usage: ~ 100 MB
                Attachment Usage: ~ 400 MB (Attachments are currently being stored in the filesystem at attachments)

                Um, I'm still kind of a newbie for some of this stuff. How do I turn off httpd? Do I just open httpd.conf and do something there?

                Thanks again for the pointers.

                Comment


                • #9
                  Originally posted by biggazillakilla View Post
                  Um, I'm still kind of a newbie for some of this stuff. How do I turn off httpd? Do I just open httpd.conf and do something there?

                  Thanks again for the pointers.
                  What distro? On most distributions you can run "service httpd stop" (and then "start" once you're done). If that doesn't work, passing "stop" as an argument to the init script should work.
                  Jason Litka - Utter Ramblings

                  Comment

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