Re: [SQL ] 請教一個資料庫複製指令

看板Database作者 (小惡魔)時間14年前 (2011/04/04 00:40), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
※ 引述《KarlJhan ()》之銘言: : 假設 A資料庫有資料表a : B資料庫目前無任何資料表 : 如何能讓資料表a,複製一份至B,只需欄位、格式、限制 : 而不用任何資料? : Database : MySql : 環境:Appserv : 謝謝各位 手邊目前沒有 Windows 環境,底下是 FreeBSD 7.1 環境 不過我想在 Appserv 操作模式也是一樣的 mysqldump --no-data -u root -p a > a.sql --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). Restore DB mysql -u root -p b < a.sql 這樣就可以了 -- PHP MVC CodeIgniter 繁體中文手冊: http://tinyurl.com/mduyv8 PHP MVC CodeIgniter 繁體中文討論區:http://tinyurl.com/yayzoz8 PHP MVC CodeIgniter 中文官方網站: http://tinyurl.com/yatds8n Appleboy Blog 電腦技術: http://blog.Wu-Boy.com -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 219.70.25.7
文章代碼(AID): #1DcAByPl (Database)
文章代碼(AID): #1DcAByPl (Database)