The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQLDump Broken

Discussion in 'General Discussion' started by feldon27, Jan 16, 2006.

  1. feldon27

    feldon27 Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    111
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Houston, TX
    Any time I run MySQLDump, no matter what parameters it puts, it gives me this bizarre error:

    Code:
    mysqldump: unknown option '--pico httpd.conf'
     
  2. feldon27

    feldon27 Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    111
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Houston, TX
    Not good!!

    mysql -u username -p dbname > file.sql
    doesn't work either!!!

    I do nightly MySQL backups and none of it has worked since CPAN changed/broke a few weeks ago!!!
     
  3. feldon27

    feldon27 Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    111
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Houston, TX
    Thank God for MySQLAdmin. That helps me backup my smaller DB but I also have a much bigger DB (400MB).
     
  4. feldon27

    feldon27 Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    111
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Houston, TX
    For some reason, the backup part of /etc/my.cnf changed from:

    Code:
    [mysqldump]
    quick
    max_allowed_packet = 16M
    to
    Code:
    [mysqldump]
    quick
    max_allowed_packet = 16M
    pico httpd.conf
    I guess there's always the possibility of fat-fingered typing.
     
    #4 feldon27, Jan 18, 2006
    Last edited: Jan 18, 2006
  5. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
  6. feldon27

    feldon27 Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    111
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Houston, TX
    No matter what I did, any time I typed mysqldump, regardless of parameters including something straightforward as:

    mysqldump --opt -u feldon23 -p feldon23_dbname > backup.sql
    or
    mysql -u feldon23 -p feldon23_dbname > backup.sql

    it would spit out the --pico httpd.conf error.

    Anyway, it was all a case of operator error. I'm very familiar with mysqldump (when it's not screwed up by a bad config) and I have automated backup scripts that backup, gzip, and then delete the backup from 2 days ago every night:

    Code:
    fname=forumbackup-`eval date +%Y-%m-%d`.sql
    echo "Backing up forum..."
    mysqldump --opt -quick -u feldon23 -p ******** feldon23_forum > /home/feldon23/backups/$fname
    echo "Gzipping..."
    gzip /home/feldon23/backups/$fname
    a=`eval date +%d`
    a=`expr $a - 2`
    fname=forumbackup-`eval date +%Y-%m-`$a.sql.gz
    rm /home/feldon23/backups/$fname
    fname=forumbackup-`eval date +%Y-%m-`0$a.sql.gz
    rm /home/feldon23/backups/$fname
    
     
    #6 feldon27, Jan 18, 2006
    Last edited: Jan 18, 2006
  7. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    OK!

    Before you backup your forum DB, run

    mysqlcheck -s -u root -p databasename

    To make sure that there's no corrupted tables. You may ignore HEAP tables like cp sessions and sessions table messages.

    Now, if there're corrupted tables, you can repair'em with the following command:

    mysqlcheck -q -r -u root -p DB_NAME
    then rerun
    mysqlcheck -s -u root -p DB_NAME

    When done, try this command and see what's gonna happen:
    mysqldump --quick --add-drop-table --add-locks --extended-insert --lock-tables --opt -uroot -pPASSWORD_HERE NAME_OF_DB > db-sqldump.sql

    If you wish to restore
    mysql -uroot -pPASSWORD_HERE NAME_OF_DB < db-sqldump.sql
     
  8. trparky

    trparky Well-Known Member

    Joined:
    Apr 23, 2003
    Messages:
    184
    Likes Received:
    1
    Trophy Points:
    0
    Try removing that "pico httpd.conf" line from your /etc/my.cnf and then try.
     
  9. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Very good point trparky ;) I thought feldon27 said that was a backup of /etc/my.cnf.
     
  10. feldon27

    feldon27 Well-Known Member

    Joined:
    Mar 12, 2003
    Messages:
    111
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    Houston, TX
    When I said the 'backup part' of my.cnf, I meant, of course, the [mysqldump] section of /etc/my.cnf. There isn't another MySQL config file I should be editing instead of /etc/my.cnf is there?

    Of course I have removed the pico httpd.conf part and resumed automated backups of all my databases and have already downloaded copies of all of the gzipped backups. It amazes me how few people do off-site backup to their PC.
     
Loading...

Share This Page