远程备份MySQL数据库,例程失败

时间:2014-03-24 13:24:54

标签: mysql

mysqldump -u root --password=123456 -h 110.4.43.111 --databases db_shuttlebus --routines --lock-tables=true --result-file=D:\Server-Backup.sql
一切都已经备份,但是常规没有备份,为什么?我的命令有什么问题?

在例程中我有一个功能,但无法备份。

enter image description here

更新

DELIMITER ;;
/*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `GenerateRouteFare`(
pRoute_ID int
)
BEGIN
-- SET SQL_SAFE_UPDATES=0; 
-- DELETE FROM tbl_rate WHERE Route_ID = pRoute_ID;

INSERT INTO tbl_rate (Route_ID,From_LocationID,To_LocationID,Normal_Rate,Discounted_Rate)
select 
   a.Route_ID,  
   a.Route_LocationID from_loc_id, 
   b.Route_LocationID to_loc_id, 
   0,0

from tbl_route a 
inner join tbl_route b on a.Route_ID = b.Route_ID and a.Route_Seq < b.Route_Seq and a.Route_ID = pRoute_ID
inner join tbl_location la on la.Location_ID = a.Route_LocationID
inner join tbl_location lb on lb.Location_ID = b.Route_LocationID
WHERE NOT EXISTS(SELECT Rate_ID
                    FROM tbl_rate
                   WHERE tbl_rate.From_LocationID = a.Route_LocationID AND tbl_rate.To_LocationID = b.Route_LocationID AND Route_ID = pRoute_ID)
order by a.Route_Seq, b.Route_Seq;

-- DELETE 
DELETE 
  FROM tbl_rate 
 WHERE Rate_ID IN
(
  SELECT Rate_ID
    FROM
  (

select * from tbl_rate  WHERE Route_ID= pRoute_ID AND CONCAT(From_LocationID, ',', To_LocationID) 
NOT IN 
(select CONCAT(a.Route_LocationID,',', b.Route_LocationID) as Locname from tbl_route a 
inner join tbl_route b on a.Route_ID = b.Route_ID and a.Route_Seq < b.Route_Seq and a.Route_ID = pRoute_ID) 

  ) q
);
END */;;
DELIMITER ;

0 个答案:

没有答案