找回密碼
 註冊
搜索
查看: 2477|回復: 0

[MySQL] Database 快速改名

[複製鏈接]
發表於 2017-12-14 11:53:29 | 顯示全部樓層 |閱讀模式
Use these few simple commands:
mysqldump -u username -p -v --routines olddatabase > olddbdump.sql
mysqladmin -u username -p create newdatabase
mysql -u username -p newdatabase < olddbdump.sql

Or to reduce I/O use the following as suggested by @Pablo Marin-Garcia:
mysqladmin -u username -p create newdatabase
mysqldump -u username -v --routines olddatabase -p | mysql -u username -p -D newdatabase

Reference: https://stackoverflow.com/questi ... -change-schema-name
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

Archiver|手機版|彩色筆小沛的知識庫

GMT+8, 2024-12-31 01:41 , Processed in 0.019883 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回復 返回頂部 返回列表