龍巖易富通網(wǎng)絡(luò)科技有限公司

龍巖小程序開(kāi)發(fā),龍巖分銷系統(tǒng)

mysqldump導(dǎo)出存儲(chǔ)過(guò)程實(shí)例

2016.08.15 | 1706閱讀 | 0條評(píng)論 | 數(shù)據(jù)庫(kù)

利用mysqldump導(dǎo)入導(dǎo)出數(shù)據(jù)是我們?cè)趍ysql數(shù)據(jù)備份中最常用的方法,但是mysqldump備份數(shù)據(jù)時(shí)不會(huì)備份存儲(chǔ)過(guò)程了,如果需要把存儲(chǔ)過(guò)程也備份出來(lái)我們需在mysqldump導(dǎo)出需要用參數(shù) -R 來(lái)指定

root@localhost bin]# mysqldump  -n -d -t -R -E -uroot -p -hlocalhost -P3306  DBName > procedure_name.sql

參數(shù)說(shuō)明:

-n: --no-create-db 只導(dǎo)出數(shù)據(jù),而不添加CREATE DATABASE 語(yǔ)句。

-d: --no-data 不導(dǎo)出任何數(shù)據(jù),只導(dǎo)出數(shù)據(jù)庫(kù)表結(jié)構(gòu)。

-t: --no-create-info 只導(dǎo)出數(shù)據(jù),而不添加CREATE TABLE 語(yǔ)句。

-E: 導(dǎo)出事件。

-R: --routines Dump stored routines (functions and procedures) 導(dǎo)出存儲(chǔ)過(guò)程以及自定義函數(shù)。


贊 (

發(fā)表評(píng)論