Changes between Version 13 and Version 14 of MySql


Ignore:
Timestamp:
06/20/11 16:15:15 (7 years ago)
Author:
joshuadf
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MySql

    v13 v14  
    1818}}} 
    1919 
     20== Basic dump and restore == 
     21 
     22{{{ 
     23MYDB=my_database_name 
     24mysqldump $MYDB > mydb.dump 
     25# destroy the database contents without dropping it to retain permissions 
     26mysql $MYDB -BNe "show tables" | awk '{print "set foreign_key_checks=0; DROP TABLE `" $1 "`;"}' | mysql $MYDB 
     27mysql $MYDB < mydb.dump 
     28}}} 
     29 
    2030== Editing a dump file == 
    2131 
    2232Sometimes it is handy to edit a database by editing the text dump file. 
    2333The `skip-extended-insert` dump format is easier to work with because  
    24 it puts one row on each line. Here is one way to do it: 
     34it puts one row on each line. However, note that it is also much slower to  
     35load than the default dump format. Here is one way to do edit a dump: 
    2536 
    2637{{{ 
     
    3243nano new.dump 
    3344# destroy the database contents 
    34 mysqldump --add-drop-table --no-data $MYDB |grep DROP | mysql $MYDB 
     45mysql $MYDB -BNe "show tables" | awk '{print "set foreign_key_checks=0; DROP TABLE `" $1 "`;"}' | mysql $MYDB 
    3546mysql $MYDB < new.dump  
    3647}}}