- 給遠(yuǎn)程用戶授權(quán)
grant all privileges on . to 'root'@'%' identified by 'mysql' with grant option;
flush privileges;
- 查看數(shù)據(jù)庫的存儲(chǔ)過程, 函數(shù)
語法:select
name
from mysql.proc where db = '數(shù)據(jù)庫名稱' andtype
= 'PROCEDURE'; // 存儲(chǔ)過程
selectname
from mysql.proc where db = '數(shù)據(jù)庫名稱' andtype
= 'FUNCTION'; // 函數(shù)show function status;
例子:
selectname
from mysql.proc where type='FUNCTION' and db='auth';
- 導(dǎo)出存儲(chǔ)過程以及自定義函數(shù)
語法:
mysqldump -hhostname -uusername -ppassword -ntd -R databasename > prorandfunc.sql
-d 結(jié)構(gòu)(--no-data:不導(dǎo)出任何數(shù)據(jù),只導(dǎo)出數(shù)據(jù)庫表結(jié)構(gòu))
-t 數(shù)據(jù)(--no-create-info:只導(dǎo)出數(shù)據(jù)暇屋,而不添加CREATE TABLE 語句)
-n (--no-create-db:只導(dǎo)出數(shù)據(jù)攀唯,而不添加CREATE DATABASE 語句)
-R (--routines:導(dǎo)出存儲(chǔ)過程以及自定義函數(shù))
例子:
mysqldump -uroot -p -ntd -R auth > prorandfunc.sql