MySQL export table structure

Source: Internet
Author: User
Document directory
  • Mysqldump-u use the primary name-P password to name the database table> *. SQL
Mysqldump-u use the primary name-P password to name the database table> *. SQL
1. Export all table structures of the database. mysqldump-uuser-ppasswd Database Name> data. SQL; // (data. SQL is the generated SQL script) 2. Export the structure of a table in the database mysqldump-uroot-ppasswd database name Table Name> data. SQL; 3. Import a database table mysql-uroot-ppasswd database name <data. SQL

 

-- Add-drop-Table option will add the drop table if exists statement before each table. This ensures that errors will not occur when importing data back to the MySQL database, check whether the table exists. If yes, delete the -- add-locks option and bind a lock table and unlock TABLE statement to the insert statement. This prevents other users from operating the-C or-complete_insert option on the table when these records are re-imported to the database, so that the mysqldump command adds the column (field) name to each insert statement. This option is useful when exporting data to another database. -- Delayed-insert: add the delay option-f or-flush-logs to the INSERT command to use this option. The log of the MySQL server will be refreshed before the export is executed. -f or-force uses this option, even if an error occurs, continue to export the -- full option and add the additional information to the create table statement-l or-lock-tables. The server will lock the table when exporting the table. The-T or-no-create-Info option makes the mysqldump command do not create the create table statement. This option is convenient when you only need data and do not need DDL statements. -D or-no-Data: The mysqldump command does not create an insert statement.

Reference: http://www.duote.com/tech/5/12180.html? PID = 3 & ptid = 0 & tid = 3 # pjhash

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.