option is –add-drop-table. This option tells (Best web hosting) mysqldumpto include

option is –add-drop-table. This option tells mysqldumpto include a DROP TABLEcommandbefore each CREATE TABLEcommand. If you don t use–add-drop-table, the resulting script will fail iftablenamealready exists when you run the script(which is usually the case). You should also consider using the –alloption. –allwrites all the table options (character set, comment, row format, and so on) used when eachtable was originally created. If you don t use –all, you ll lose all those table options if you restore froman archive script. Table 44-1 lists the mysqldumpoptions that affect the format of the resulting archive. It s a good idea to use the –optoption inmost scenarios. –optproduces an archivethat saves all data (even the extra tableoptions normally saved with the –allflag) ina form that s optimized for quick restores. The –complete-insertoption is useful when yoususpect that you may restructure a table betweenthe time you create the archive and the time yourestore from that archive. Backing up multiple databasesTo archive all databases, add the –all-databasesoption to your command line when you create thearchive. Or you can archive a set of databases likethis: $ mysqldump –databases db1 db2 db3Compressing the archiveThe archive produced by mysqldumpcan getvery big very fast. Instead of storing the rawarchive on disc, you can compress the script thatmysqldumpproduces by using gzipor bzip2. Because mysqldumpwrites the script to its standardoutput stream, you can easily pipe the script into thestandard input stream of a compression tool, like this: $ mysqldump database | gzip > backup.sql.gz This command archives the given database, pipesthe resulting script to gzip, and saves the com- pressed script to backup.sql.gz. TABLE44-1: MYSQLDUMPARCHIVEOPTIONSOptionDescription–allForce mysqldumpto archive all table options (TYPE, COMMENT, and so on). –complete-insertInclude column names in every INSERTcommand. –extended-insertInsert multiple rows with a single INSERTcommand. –add-drop-tableInsert a DROP TABLEcommand before each CREATE TABLE. –add-locksLock each table for WRITEaccess before inserting new rows. –disable-keysUpdate indexes after all data has been inserted. –no-autocommitRestore each table in a single transaction. –no-create-dbDon t write CREATE DATABASEcommands to the script. –quote-namesQuote all column and table names in the script. Use this option only if you ve created atable (or column) whose name conflicts with a reserved keyword. –xmlProduce the archive in the form of an XML document rather than an SQL script. –where=where-clauseOnly archive rows that satisfy the where-clause. –optOptimize the archive for best restore performance.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Leave a Reply