Professional Web Applications Themes

Backup MySQL DB - PHP Development

On Tue, 15 Jul 2003 10:55:07 +0000, Frank wrote: > For a small DB is it oK just to copy the DB to another location ? for any size DB why not dump the database to a file using mysqldump or use mysql-hotcopy? example: mysqldump databaseName > file.sql (you will probably need the -u and -p options, and maybe the -h option. Also consider the --add-drop-table option) example 2: mysqldump -host my.database.host.com -u username -p --add-drop-table \ databaseName > dumpfile.sql (note the backslash indicating that the statement is really one line) It seems like this is probably safer than copying ...

  1. #1

    Default Re: Backup MySQL DB

    On Tue, 15 Jul 2003 10:55:07 +0000, Frank wrote:
    > For a small DB is it oK just to copy the DB to another location ?
    for any size DB why not dump the database to a file using mysqldump or use mysql-hotcopy?

    example:
    mysqldump databaseName > file.sql
    (you will probably need the -u and -p options, and maybe the -h option.
    Also consider the --add-drop-table option)

    example 2:
    mysqldump -host my.database.host.com -u username -p --add-drop-table \
    databaseName > dumpfile.sql
    (note the backslash indicating that the statement is really one line)

    It seems like this is probably safer than copying the binary data files if
    only because you don;t have to worry about shutting down the server or
    munging the data files.

    i've never used mysql-hotcopy, so I can't comment on it.

    --
    Jeffrey D. Silverman | jeffrey AT jhu DOT edu
    Johns Hopkins University | Baltimore, MD
    Website | [url]http://www.wse.jhu.edu/newtnotes/[/url]

    Jeffrey Silverman Guest

  2. #2

    Default Re: Backup MySQL DB

    Hi

    Frank wrote:
    > For a small DB is it oK just to copy the DB to another location ?
    Pass. But you could use mysqldump and then pipe the output into mysqld,
    which means you don't have to shut down the database. phpmysqladmin has
    functions to dump the database too.

    Regards,

    Luke

    Luke Ross Guest

  3. #3

    Default Re: Backup MySQL DB

    On Tue, 15 Jul 2003 10:55:07 +0000 (UTC), Frank MyPlace.Com (Frank) wrote:
    >For a small DB is it oK just to copy the DB to another location ?
    It's OK for any size database, so long as the datafiles aren't being changed
    whilst you do it.

    So lock all the tables first.

    mysqlhotcopy does this for you. [url]http://www.mysql.com/doc/en/mysqlhotcopy.html[/url]

    --
    Andy Hassall (andyandyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
    Space: disk usage ysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
    Andy Hassall Guest

  4. #4

    Default Re: Backup MySQL DB

    Is there anything similar that is NOT Perl ?

    Our Test Win2000 Server does not have Perl Support, and niether does
    our test linux box..

    Thanks

    On Tue, 15 Jul 2003 21:26:17 +0100, Andy Hassall <andyandyh.co.uk>
    wrote:
    >On Tue, 15 Jul 2003 10:55:07 +0000 (UTC), Frank MyPlace.Com (Frank) wrote:
    >
    >>For a small DB is it oK just to copy the DB to another location ?
    >
    > It's OK for any size database, so long as the datafiles aren't being changed
    >whilst you do it.
    >
    > So lock all the tables first.
    >
    > mysqlhotcopy does this for you. [url]http://www.mysql.com/doc/en/mysqlhotcopy.html[/url]
    >
    >--
    >Andy Hassall (andyandyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
    >Space: disk usage ysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
    Frank Guest

  5. #5

    Default Re: Backup MySQL DB

    On Wed, 16 Jul 2003 09:50:37 +0000, Frank wrote:
    > Is there anything similar that is NOT Perl ?
    >
    > Our Test Win2000 Server does not have Perl Support, and niether does our
    > test linux box..
    >
    <snip!>

    Well why the heck not? Perl is available and free of charge for both!

    --
    Jeffrey D. Silverman | jeffrey AT jhu DOT edu
    Johns Hopkins University | Baltimore, MD
    Website | [url]http://www.wse.jhu.edu/newtnotes/[/url]

    Jeffrey Silverman Guest

  6. #6

    Default Re: Backup MySQL DB

    Frank wrote:
    > Is there anything similar that is NOT Perl ?
    >
    > Our Test Win2000 Server does not have Perl Support, and niether does
    > our test linux box..
    >
    > Thanks
    >
    > On Tue, 15 Jul 2003 21:26:17 +0100, Andy Hassall <andyandyh.co.uk>
    > wrote:
    >
    > >On Tue, 15 Jul 2003 10:55:07 +0000 (UTC), Frank MyPlace.Com (Frank) wrote:
    > >
    > >>For a small DB is it oK just to copy the DB to another location ?
    > >
    > > It's OK for any size database, so long as the datafiles aren't being changed
    > >whilst you do it.
    > >
    > > So lock all the tables first.
    > >
    > > mysqlhotcopy does this for you. [url]http://www.mysql.com/doc/en/mysqlhotcopy.html[/url]
    > >
    > >--
    > >Andy Hassall (andyandyh.co.uk) icq(5747695) ([url]http://www.andyh.co.uk[/url])
    > >Space: disk usage ysis tool ([url]http://www.andyhsoftware.co.uk/space[/url])
    Can you just use mysqldump?

    Shawn
    --
    Shawn Wilson
    [email]shawnglassgiant.com[/email]
    [url]http://www.glassgiant.com[/url]


    Shawn Wilson Guest

Similar Threads

  1. MySQL Administrator Sheduler backup !
    By ParazaR in forum MySQL
    Replies: 4
    Last Post: June 13th, 02:37 PM
  2. backup mysql from Linux to Windows?
    By Ask Josephsen in forum MySQL
    Replies: 10
    Last Post: April 13th, 08:56 PM
  3. MySQL BackUp - Possible via cfm page?
    By Moss in forum Coldfusion Database Access
    Replies: 0
    Last Post: July 4th, 03:33 PM
  4. php Mysql Backup
    By Roger in forum PHP Development
    Replies: 0
    Last Post: January 5th, 06:22 PM
  5. MYSQL Backup & Restore using PHP ?
    By James in forum PHP Development
    Replies: 3
    Last Post: July 11th, 11:22 AM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139