×
Create a new article
Write your page title here:
We currently have 3,189 articles on s23. Type your article name above or create one of the articles listed here!



    s23
    3,189Articles

    Mysql-backup: Difference between revisions

    Content added Content deleted
    imported>Hundfred
    (New page: using mysqldump with the command lock-tables doesn't lead to a consistent backup with innodb databases, and just works fine with myissam databases. this command you can use to get a consi...)
     
    imported>Hundfred
    No edit summary
    Line 1: Line 1:
    == mysql-backup ==

    using mysqldump with the command lock-tables doesn't lead to a consistent backup with innodb databases, and just works fine with myissam databases.
    using mysqldump with the command lock-tables doesn't lead to a consistent backup with innodb databases, and just works fine with myissam databases.


    this command you can use to get a consistent backup
    this command you can use to get a consistent backup
    <pre>
    <pre>
    C:\DOKUME~1\Admin> mysqldump -u root -p --skip-opt --single-transaction --add-drop-table --create-option --quick --extended-insert --set-charset --disable-keys --database testdbsm > backup.sql
    C:\DOKUME~1\Admin> mysqldump -u root -p --skip-opt --single-transaction --add-drop-table --create-option --quick --extended-insert --set-charset --disable-keys --database <DATABASE-NAME> > backup.sql
    Enter password: ******
    Enter password: ******


    C:\DOKUME~1\Admin>
    C:\DOKUME~1\Admin>
    </pre>
    </pre>

    with this '''stored-procedures''' are not included in that backup
    this can happen with this command
    <pre>
    C:\DOKUME~1\Admin>mysqldump -u root -p mysql proc > backup_all_stored_procedures.sql
    Enter password: ******
    C:\DOKUME~1\Admin>
    </pre>

    this will backup '''ALL stored procedures'''
    if you want just to backup stored procedures for a single database,
    then you can try this one here:
    <pre>
    mysqldump -u root -p --where='db=testdbsm' --no-create-info mysql proc > backup_stored_procedure_of_this_db.sql
    </pre>

    in the version 6 of mysql there will be an extra-tool for backup.

    tool:
    there is also a perl tool to do a mysql-backup
    [[http://www.mswanson.com/?f=software/mybackup/index.html]]

    Revision as of 08:10, 23 June 2009

    mysql-backup

    using mysqldump with the command lock-tables doesn't lead to a consistent backup with innodb databases, and just works fine with myissam databases.

    this command you can use to get a consistent backup

    C:\DOKUME~1\Admin> mysqldump -u root -p --skip-opt --single-transaction --add-drop-table --create-option --quick --extended-insert --set-charset --disable-keys --database <DATABASE-NAME> > backup.sql
    Enter password: ******
    
    C:\DOKUME~1\Admin>
    

    with this stored-procedures are not included in that backup this can happen with this command

    C:\DOKUME~1\Admin>mysqldump -u root -p mysql proc  > backup_all_stored_procedures.sql
    Enter password: ******
    C:\DOKUME~1\Admin>
    

    this will backup ALL stored procedures if you want just to backup stored procedures for a single database, then you can try this one here:

    mysqldump -u root -p --where='db=testdbsm' --no-create-info mysql proc > backup_stored_procedure_of_this_db.sql
    

    in the version 6 of mysql there will be an extra-tool for backup.

    tool: there is also a perl tool to do a mysql-backup [[1]]

    Cookies help us deliver our services. By using our services, you agree to our use of cookies.
    Cookies help us deliver our services. By using our services, you agree to our use of cookies.