Welcome to the Linux community forum, interact with 2 million technical staff to enter the second do not log on to mysql with mysqldump command export file, the feeling is similar to the backup database, the command is as follows: mysqldump-Tpathdbnametable_name-uroot-ppath for export path, dbname is the table name in the database.
Welcome to the Linux community forum and interact with 2 million technical staff> log on to mysql and use the mysqldump command to export files. The command is similar to the backup database. The command is as follows: mysqldump-T path dbname table_name-u root-p path is the export path, and dbname is the database name table_name is the table name in the database.
Welcome to the Linux community forum and interact with 2 million technicians>
2. Do not log on to mysql
Using the mysqldump command to export files is similar to backing up a database. The command is as follows:
Mysqldump-T path dbname table_name-u root-p
Path is the export path, and dbname is the database name table_name is the table name in the database.
It can also be like select... The options for adding option to into outfile are as follows:
Mysqldump-T path dbname table_name-u root-p -- fields-terminated-by =, -- fields-enclosed-by = \ "-- fields-escaped-by =? -- Lines-terminated-by = \ r \ n
Use mysql commands to export Databases
Mysql-u root-p -- execute = "select statement" dbname> filename.txt
You can also use mysql to export html data and use the -- html option.
Mysql-u root-p -- html -- execute = "select statement" dbname> filename.html
Mysql-u root-p -- xml -- execute = "select statement" dbname> filename. xml
Use mysqlimport to import text files
Mysqlimport-u root-p db_name filename.txt
You can also include optional parameters such as mysqldump.
Mysqlimport-u root-p db_name filename.txt -- fields-terminated-by =, -- fields-enclosed-by = \ "-- fields-escaped-by =? -- Lines-terminated-by = \ r \ n
[1] [2]