mysqldump with Create DataBase

  Kiến thức lập trình

`mysqldump -u -p -B db_test tb_config > D:TestBcktb_config.sql

CREATE DATABASE /!32312 IF NOT EXISTS/ db_test /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci / /!80016 DEFAULT ENCRYPTION=’N’ */;

the -B option creates the row, but also all the tables in the database not only the one indicated (tb_config) in the command line

if I do not use -B the table tb_config is created but not CREATE DATABASE

mysqldump -u -p -B db_test tb_config > D:TestBcktb_config.sql

create line CREATE DATABASE but also dump all the tables

mysqldump -u -p db_test tb_config > D:TestBcktb_config.sql

dump single table but not line CREATE DATABASE

I look instead only the the line CREATE DATABASE and only table in command line

mysqldump -u -p -B db_test tb_config > D:TestBcktb_config.sql
mysqldump -u -p -B db_test tb_edit > D:TestBcktb_edit.sql
…other table
`

LEAVE A COMMENT