复制Mysql数据库的数据库结构 |
您所在的位置:网站首页 › mysql复制命令 › 复制Mysql数据库的数据库结构 |
百度翻译此文
有道翻译此文
问题描述
I am using MySql 5.1 Database. I have created a Project database. (Template Database) and want to Create a copy of the same database from the Application, every time, User Creates A new Project. How can I copy and Create a New Database of same structure? What is the Command to do so? 推荐答案If you only want to copy the table structure etc. from one db to the other you can use this single bash line: mysqldump -u user -ppass -d olddb | mysql -u user -ppass -DnewdbThe new database must exist already. The -d flag in the mysqldump command prevents copying of data. 其他推荐答案Dump the database with the -d option. To create a new copy, do a "create database new-database-name; use new-data-base-name;", then run the dump file as a sql script. 其他推荐答案Check out the SHOW CREATE TABLE command: https://dev.mysql.com/doc/refman/5.0/en/show-create-table.html It will return the create command used to create the given table. |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |