Results 1 to 8 of 8

Thread: Daily MySQL backups on a headless server

  1. #1
    turmoil is offline Member
    Join Date
    Aug 2010
    Posts
    16

    Default Daily MySQL backups on a headless server

    Hello,

    I'm running SugarCRM 5.5.4 on Ubuntu Server 10.04 32-bit, no GUI.
    I used the FastTrack installer and performed a fresh default installation.

    How can I perform daily MySQL database backups using the command line?

    Thanks.

  2. #2
    Join Date
    Sep 2009
    Location
    Delhi
    Posts
    10

    Default Re: Daily MySQL backups on a headless server

    use mysqldump command

  3. #3
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Daily MySQL backups on a headless server

    Quote Originally Posted by kuldeep.hudda81 View Post
    use mysqldump command
    and cron job
    Letrium ltd. - Only high quality service
    http://letrium.com

  4. #4
    turmoil is offline Member
    Join Date
    Aug 2010
    Posts
    16

    Default Re: Daily MySQL backups on a headless server

    Guys thanks for the replies, but when I type mysqldump in the system I get the following message:
    Code:
    The program 'mysqldump' can be found in the following packages:
     * mysql-client-5.1
     * mysql-client-5.0
     * mysql-cluster-client-5.1
    Try: sudo apt-get install <selected package>
    The other way I tried this is by navigating to "/opt/sugarcrm-5.5.4/mysql/bin" and typing "./mysqldump". Then I get a promising output:
    Code:
    Usage: mysqldump [OPTIONS] database [tables]
    OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
    OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
    For more options, use mysqldump --help
    However, when I type the following command in mysql/bin:
    Code:
    ./mysql -u [user] -p[password] [databasename] > [outputfile.sql]
    I get the following output:
    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

  5. #5
    AlexAv's Avatar
    AlexAv is offline Sugar Community Member
    Join Date
    Oct 2009
    Location
    Ukraine
    Posts
    922

    Default Re: Daily MySQL backups on a headless server

    Bad path to socket.

    HTML Code:
    ./mysql -u [user] -p[password] -s[NEW SOCKET PATH] [databasename] > [outputfile.sql]
    Letrium ltd. - Only high quality service
    http://letrium.com

  6. #6
    turmoil is offline Member
    Join Date
    Aug 2010
    Posts
    16

    Default Re: Daily MySQL backups on a headless server

    Thanks, but I tried your suggestion and this is what I get:
    Code:
    -bash: /home/erez/sugarcrm.sql: Permission denied
    I tried various other destinations and I get Permission Denied for all of them.

    I also tried the same command with the sudo prefix but I get the same error.

  7. #7
    turmoil is offline Member
    Join Date
    Aug 2010
    Posts
    16

    Smile Re: Daily MySQL backups on a headless server

    OK I found the answer
    Code:
    /opt/sugarcrm-5.5.4/mysql/bin/./mysqldump [databasename] -u [username] -p[password] -S /opt/sugarcrm-5.5.4/mysql/tmp/mysql.sock > /path-to-backup-file/backupfile.sql
    Thanks for your help guys!

  8. #8
    zilker is offline Member
    Join Date
    Jun 2010
    Posts
    10

    Default Re: Daily MySQL backups on a headless server

    Here's a great backup script...multiple features. You can configure & upload the two files to email backup, email errors only, store backup in folder of preference, and lots of other great features. You can add a cron job to complete the script for you.

    http://www.dagondesign.com/articles/...backup-script/

    Cheers!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Change PHPMyAdmin IP restriction on a headless server
    By turmoil in forum Installation and Upgrade Help
    Replies: 4
    Last Post: 2010-08-08, 04:12 AM
  2. Replies: 2
    Last Post: 2007-07-30, 02:58 AM
  3. Replies: 2
    Last Post: 2007-07-01, 09:55 PM
  4. Replies: 0
    Last Post: 2007-06-26, 11:38 AM
  5. Replies: 0
    Last Post: 2006-10-23, 10:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •