mysql> show create procedure year_on_job\G ERROR 1305 (42000): PROCEDURE year_on_job does not exist
时间: 2024-02-20 10:00:07 浏览: 139
如果您遇到了 "PROCEDURE does not exist" 的错误消息,则说明您指定的存储过程不存在。请确保您输入的存储过程名称正确,并且存储过程已经被创建。
如果您确认存储过程已经存在,那么可能是因为当前登录的用户没有权限访问该存储过程。请确保当前用户具有执行该存储过程的权限。
您可以使用以下命令来查看当前用户是否具有执行存储过程的权限:
```
SHOW GRANTS FOR user_name;
```
请将 "user_name" 替换为当前登录的用户名。如果您没有执行存储过程的权限,您需要联系数据库管理员授予您相应的权限。
相关问题
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION; Query OK, 0 rows affected (0.00 sec) mysql> show create procedure year_on_job \G ERROR 1305 (42000): PROCEDURE year_on_job does not exist mysql> show create procedure year_on_job\G
The correct syntax for showing the create statement of a stored procedure is:
```
SHOW CREATE PROCEDURE procedure_name;
```
So in this case, the correct command to show the create statement of the "year_on_job" stored procedure would be:
```
SHOW CREATE PROCEDURE year_on_job\G
```
Note that the "\G" at the end is optional, and is used to display the output in a vertical format.
SHOW CREATE PROCEDURE year_on_job\G ERROR 1305 (42000): PROCEDURE year_on_job does not exist
The error message "ERROR 1305 (42000): PROCEDURE year_on_job does not exist" indicates that the stored procedure "year_on_job" does not exist in the database or in the current schema.
If you are sure that the "year_on_job" stored procedure exists, then it is possible that you are running the command in the wrong schema. Make sure that you are connected to the correct database and schema where the stored procedure is created.
If the stored procedure does not exist, you can create it using the CREATE PROCEDURE statement. Here is an example:
```
CREATE PROCEDURE year_on_job()
BEGIN
-- stored procedure logic
END;
```
Replace the "-- stored procedure logic" with the actual SQL statements that you want the stored procedure to execute. After creating the stored procedure, you should be able to use the SHOW CREATE PROCEDURE command to display its create statement.
阅读全文