MySQL raises error 1305 (ER_SP_DOES_NOT_EXIST) when a stored procedure, function, trigger, or event you attempt to call cannot be found in the selected database.
MySQL Error 1305: ER_SP_DOES_NOT_EXIST means the server cannot locate the requested stored routine or trigger. Confirm the correct database, spelling, and privileges, then recreate or grant access to the object to resolve the issue.
%s %s does not exist
Error 1305 signals that MySQL cannot find the stored procedure, function, trigger, or event named in your CALL or EXECUTE statement. The server looks in the current database and the mysql.proc table; if no matching routine exists, it throws ER_SP_DOES_NOT_EXIST.
The error surfaces during runtime when you attempt to invoke a routine that was never created, was dropped, resides in another schema, or is hidden by insufficient privileges. It commonly emerges after migrations, refactors, or typos in routine names.
Unresolved, the error breaks application workflows that depend on stored routines, causing outages, failed deployments, and blocked data pipelines. Prompt resolution restores functionality and guards against cascading failures.
A single character mismatch between the CALL statement and the routine definition leads MySQL to believe the routine is absent.
If you switched databases or forgot a USE statement, MySQL searches the wrong schema and cannot find the object.
Deployment scripts that skipped or failed the CREATE PROCEDURE step leave no routine to execute, triggering error 1305.
Users without EXECUTE or TRIGGER privileges cannot see or run the routine, so MySQL responds as if it does not exist.
Raised when a referenced table is missing; similar root causes like wrong schema or dropped object.
Occurs when a specified database does not exist, often preceding error 1305 if the routine is in that missing schema.
Indicates MySQL cannot locate a user-defined function, paralleling ER_SP_DOES_NOT_EXIST for UDFs.
Yes. On Unix-like systems with lower_case_table_names=0, routine names are case-sensitive. A case mismatch will raise ER_SP_DOES_NOT_EXIST.
Yes. Prefix the call with the database name: CALL reporting.generate_kpi(); Make sure you have EXECUTE privileges on that routine.
CI pipelines may drop and recreate databases. Ensure migration scripts include CREATE PROCEDURE statements and run in the correct order.
Galaxy’s schema explorer and AI autocomplete surface existing routines in the active database, reducing typos and helping you select the right schema before execution.