DELIMITER in mysql does not work -
the below code works correctly when use command line (mysql.exe) execute, incorrect when use sql query in phpmyadmin or using scriptrunner (java) execute. the error: error syntax execute delimiter $$ how can solve problem? -- procedures -- delimiter $$ create definer=`root`@`localhost` procedure `upload_photo`( in owner_id int, in photo_name text, in photo_url text, in thumbnail text ) begin declare inserted_id int unsigned default 0; insert photo(`owner_id`, `photo_name`, `photo_url`, `thumbnail`) values(owner_id, photo_name, photo_url, thumbnail); set inserted_id = last_insert_id(); select * photo photo_id = inserted_id; end$$ -- delimiter ; phpmyadmin uses mysqli doesn't support delimiter. see if delimiter needed @ all. running script multiple rows , mysql runs of them semicolons delimiters.