Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Backing up your database from the command line

  1. #1
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default Backing up your database from the command line

    To backup your database from the command line, use the following commands:

    Code:
    mysqldump -u username -p aedating > aedating.sql
    username = your database username
    aedating = your aedating database name

    When you run the command, it will ask you for your password, perform the export, and then exit. You will then find the new sql file in the directory you ran the command from.

  2. #2
    rhettibus
    Guest

    Default Use the -Q option!!

    Hi all,

    When using the mysql dump, you need to use the -Q option because there is at least one table that uses a MySQL reserved word for a field name (GLParams has a description field named 'desc'). This option forces the SQL statements to have quoted table and field names. If you do not do this, you will receive a SQL syntax error when you try to import from the dump file.

    rock on,

  3. #3
    Nachtstern
    Guest

    Default

    Hi@all

    use for backup this command:

    mysqldump -a -c -e -Q databasename -u username -p > aedating.sql

    from backup:

    mysql -p -D databasename < aedating.sql

    best regards

  4. #4
    Sola
    Guest

    Default

    Nachtstern, I followed your instructions above and I was able to download and upload my tables without the problems I initially had. You're a lifesaver. Thanks.

  5. #5
    Nachtstern
    Guest

    Default

    Hi

    i am glad to help you

    best regards

  6. #6
    coracor
    Guest

    Default

    Is there any way to do this if a dump was not performed? For example, if there was a system failure and server had to be reimaged, but the old data files are still present.

    What files would I copy?

  7. #7

    Join Date
    Apr 2005
    Posts
    99

    Default

    How many times are you guys taking a backup? Is it only an SQLDump or also folders like id_img/wav/video?

    Are you using a third party software like SQLyog,navicat,...?

    just curious

  8. #8
    slimshady
    Guest

    Default

    use WHM.

    It backs up all my files (as a tar.gz) and dumps the database

    One copy is saved to my server hard drive.

    One copy goes to Smoge's server, by sftp.

    I have a daily, a weekly, and a monthly.

    Slim

  9. #9

    Join Date
    Apr 2005
    Posts
    99

    Default

    I tried to put

    mysqldump -a -c -e -Q databasename -u username -p > aedating.sql

    in the command line (cronjobs) but I always get that error:

    enter password: mysqldump: Got error: 1045: Access denied for user: 'username@localhost' (Using password: NO) when trying to connect

    How to make this cronjob work?

  10. #10
    Administrator Smoge's Avatar
    Join Date
    Mar 2005
    Posts
    6,634
    Blog Entries
    5

    Default

    Quote Originally Posted by raeyo
    mysqldump -a -c -e -Q databasename -u username -p > aedating.sql
    Hi,

    You need to put where it says databasename, the name of your database on your system, and where it says username, a mySQL user on your system that has rights to access that database.

    Smoge
    ModMySite Administrator

    Problems? Questions? Need modifications or other help with your site?

    Open A Ticket , Send Us An Email Or Give Us A Telephone Call +1 518-632-4152.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. header.inc.php on line 158
    By mrbear in forum General Troubleshooting
    Replies: 4
    Last Post: 11-29-2007, 12:53 PM
  2. on line 659 in my lang file is it wrong?
    By birkenstam in forum General Issues, Comments, Questions
    Replies: 2
    Last Post: 11-08-2006, 01:32 PM
  3. how delete some registration line's
    By seek_21 in forum Bugs Dolphin v5.2
    Replies: 2
    Last Post: 10-25-2006, 03:31 PM
  4. Backing Up Your Database
    By im5150 in forum FAQ & HOWTO
    Replies: 1
    Last Post: 12-25-2005, 09:45 PM
  5. Backing up your home directory from the command line
    By Smoge in forum Security / Server Administration
    Replies: 0
    Last Post: 03-12-2005, 10:53 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
  •