mysqldump data only

前端 未结 9 1214
傲寒
傲寒 2020-12-02 03:55

I am looking for the syntax for dumping all data in my mysql database. I don\'t want any table information.

9条回答
  •  余生分开走
    2020-12-02 04:58

     >> man -k  mysqldump [enter in the terminal]
    

    you will find the below explanation

    --no-create-info, -t

    Do not write CREATE TABLE statements that re-create each dumped table. Note This option does not not exclude statements creating log file groups or tablespaces from mysqldump output; however, you can use the --no-tablespaces option for this purpose.

    --no-data, -d

    Do not write any table row information (that is, do not dump table contents). This is useful if you want to dump only the CREATE TABLE statement for the table (for example, to create an empty copy of the table by loading the dump file).

    # To export to file (data only)
    mysqldump -t -u [user] -p[pass] -t mydb > mydb_data.sql
    
    # To export to file (structure only)
    mysqldump -d -u [user] -p[pass] -d mydb > mydb_structure.sql
    

提交回复
热议问题