且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

复制数据库结构,不包含mysql中的数据(带有空表)

更新时间:2023-02-02 21:31:39

mysqldump -u user -ppass -d olddb | mysql -u user -ppass -D newdb

新数据库必须已经存在. mysqldump命令中的-d标志可防止复制数据.

The new database must already exist. The -d flag in the mysqldump command prevents copying of data.

标志-p与密码之间没有空格.

There's no space between the flag -p and the password.