解决Mysql8.0不存在mysql.proc表

摘自MySQL8.0官方文档:

The parameters and routines data dictionary tables together supersede the proc table from before MySQL 8.0.

大概意思说,在mysql database中parameters表和routines数据字典表一起取代了MySQL 8.0之前的proc表。 MySQL 8.0中官方移除了proc表,MySQL 5.7版本中还是存在proc表的。

查询数据库中所有的procedures(存储过程):

select * from mysql.proc;

在mysql8.0.31中执行如下:

 替代方案

# 查询定义存储过程的所有参数
select * from information_schema.parameters;
# 查询指定数据库中的存储过程
SELECT * FROM information_schema.Routines WHERE ROUTINE_TYPE='PROCEDURE' AND ROUTINE_SCHEMA = '数据库名称';

注:查routines表与查parameters表相比,没有入参in和出参out的信息。

猜你喜欢

转载自blog.csdn.net/weixin_45719444/article/details/133700250
今日推荐