Stored procedure or function does not exist
ER_SP_DOES_NOT_EXIST (1305) is returned when a CALL or SELECT invokes a stored procedure or function that does not exist in the current database.
CALL non_existent_procedure();
expected output
ERROR 1305 (42000): PROCEDURE mydb.non_existent_procedure does not exist
Fix
Check the procedure exists in the correct database
WHEN When the procedure is expected to exist.
-- List all procedures in current database: SHOW PROCEDURE STATUS WHERE Db = DATABASE(); -- Check if it exists with a fully qualified name: CALL mydb.my_procedure();
Why this works
SHOW PROCEDURE STATUS lists all stored procedures. Always qualify the call with the database name if the current database may differ from where the procedure was created.
✕ Create the procedure in the wrong database
The current database at procedure creation time is baked into the routine — creating it without USE mydb will put it in the wrong schema.
MySQL 8.0 — 1305 ER_SP_DOES_NOT_EXIST
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev