简体   繁体   中英

Cannot create Stored Procedure on remote MySQL server

I am using a web service to execute SQL queries on my remote MySQL server and it is working just great when I execute normal SQL queries of Select/Update/Delete/Drop/etc. But when I try to create a Stored Procedure using following query it fails.

DELIMITER $$

CREATE
    
    PROCEDURE `GetAllCategory`()
    BEGIN
    SELECT * FROM category;
    END$$

DELIMITER ;

My MySQL remote server supports SP as I can create them in PhpMyAdmin but now through the web service.

I am getting following error from the web service I am using: HTTP/1.1 500 Internal Server Error Connection: close X-Powered-By: PHP/5.6.40 Content-Type: text/html; charset=utf-8 Server: LiteSpeed

Please guide as to how to solve this problem.

TIA

DELIMITER $$
DROP PROCEDURE IF EXISTS `GetAllCategory`$$
CREATE  PROCEDURE `GetAllCategory`()

BEGIN
     SELECT * FROM category;
END$$

DELIMITER ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM