How to fix ERROR 1106: Unknown procedure in MySQL
ERROR 1106 occurs when MySQL cannot find the stored procedure you're trying to call. This happens when the procedure doesn't exist, hasn't been created in the current database, or the user lacks EXECUTE permissions.
Quick fix
Fixes 1106
SELECT * FROM information_schema.ROUTINES
WHERE ROUTINE_NAME = 'your_procedure_name'
AND ROUTINE_SCHEMA = DATABASE();- Verify the procedure exists in the current database
- Check the exact procedure name and spelling
- Verify the current database context
- Check user privileges for the procedure
SELECT * FROM information_schema.ROUTINESWHERE ROUTINE_NAME = 'your_procedure_name'AND ROUTINE_SCHEMA = DATABASE();ERROR 1106: Unknown procedure
What this error means
MySQL Error 1106 (ER_UNKNOWN_PROCEDURE) is raised when the database server cannot locate or access a stored procedure referenced in a CALL statement. The error message displays "Unknown procedure '%s'" where %s is the name of the procedure that couldn't be found or accessed. This is a SQL syntax error (SQLSTATE 42000) that indicates the procedure doesn't exist in the database, hasn't been created yet, or the calling user lacks the necessary EXECUTE privilege to invoke it.
Typical symptoms
- Application receives "ERROR 1106: Unknown procedure" when executing a CALL statement
- Database operation fails with SQLSTATE 42000
- Stored procedure invocation fails even though you're sure the procedure exists
- Application crashes or returns unexpected results after database migration or backup restore
- Different users or applications experience the error inconsistently
Common causes
- The stored procedure does not exist in the current database
- The procedure name is misspelled or uses incorrect casing
- The procedure was dropped or deleted from the database
- The user executing the CALL statement lacks EXECUTE privilege on the procedure
- The procedure exists in a different database or schema, and is not fully qualified
- After database migration or restore, procedures were not recreated or restored properly
- MySQL 8.0 specific: application is checking mysql.proc table which no longer exists in MySQL 8.0+
How to fix "ERROR 1106: Unknown procedure"
Run this query to check if the procedure exists:
SELECT * FROM information_schema.ROUTINES
WHERE ROUTINE_NAME = 'your_procedure_name'
AND ROUTINE_SCHEMA = DATABASE();If no results are returned, the procedure does not exist in the current database. You need to create it using a CREATE PROCEDURE statement.
MySQL procedure names are case-sensitive on Linux and case-insensitive on Windows by default. Verify:
SHOW PROCEDURE STATUS WHERE Db = DATABASE();This displays all procedures in the current database. Check that the procedure name matches exactly (including case) with what your application is trying to call.
Ensure you're connected to the correct database:
SELECT DATABASE();If procedures are in a different database, qualify the call with the database name:
CALL `database_name`.`procedure_name`(arguments);Verify the calling user has EXECUTE privilege on the procedure:
SHOW GRANTS FOR CURRENT_USER;Look for EXECUTE privilege. If missing, grant it using:
GRANT EXECUTE ON `database_name`.`procedure_name` TO 'username'@'hostname';
FLUSH PRIVILEGES;If the procedure is missing or corrupted, recreate it from your backup or source code:
DELIMITER //
CREATE PROCEDURE procedure_name (parameter_type parameter_name)
BEGIN
-- Your procedure logic here
END//
DELIMITER ;After creation, test with:
CALL procedure_name();If upgrading from MySQL 5.7 to 8.0, MySQL no longer uses the mysql.proc table. The data dictionary now stores procedure information in mysql.routines and mysql.parameters (not directly queryable).
If using a connector or ORM that checks mysql.proc, update your connection string with:
CheckParameters=falseFor example in JDBC:
jdbc:mysql://hostname:3306/database?CheckParameters=falseAdvanced notes
Database Migrations: When restoring from backups, ensure stored procedures are included in the dump. Some backup tools allow filtering out stored procedures, resulting in this error after restore.
Schema Qualification: Different MySQL versions and configurations handle schema/database qualification differently. Always use fully qualified names in production code: database.procedure_name.
Privilege Propagation: Changes to privileges require a FLUSH PRIVILEGES command. If privileges were just granted, ensure this was executed.
Cross-Database Calls: Procedures in one database calling procedures in another database must use fully qualified names and the calling user must have EXECUTE privilege on both procedures.
Prepared Statements: If using prepared statements with CALL, ensure the procedure name is not parameterized - procedure names must be literal.
Frequently asked questions
- What does "1106" mean?
- MySQL Error 1106 (ER_UNKNOWN_PROCEDURE) is raised when the database server cannot locate or access a stored procedure referenced in a CALL statement. The error message displays "Unknown procedure '%s'" where %s is the name of the procedure that couldn't be found or accessed. This is a SQL syntax error (SQLSTATE 42000) that indicates the procedure doesn't exist in the database, hasn't been created yet, or the calling user lacks the necessary EXECUTE privilege to invoke it.
- How do I fix "1106"?
- ERROR 1106 occurs when MySQL cannot find the stored procedure you're trying to call. This happens when the procedure doesn't exist, hasn't been created in the current database, or the user lacks EXECUTE permissions.
- What causes "1106"?
- The stored procedure does not exist in the current database The procedure name is misspelled or uses incorrect casing The procedure was dropped or deleted from the database
- Is the "1106" error serious?
- It is a medium-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐MySQL Official Documentation
- ๐MySQL 8.0 Error Reference(Official Docs)