Table 'mysql.proc' doesn't exist

Anargh V 1 Reputation point
2022-09-09T07:06:58.603+00:00

MySql Client always throws the error "Table 'mysql.proc' doesn't exist", when a stored procedure is being executed. The weird thing is this error is thrown only in our Production server which is running on "General Purpose" pricing tier. Our staging server which runs on "Basic" pricing tier does not have this issue. Both production and staging is running under Single Server configuration.

There is a solution posted for this under https://learn.microsoft.com/en-us/answers/questions/25786/table-mysqlproc-doesnt-exist.html
however I want to understand why this issue exist in General Purpose tier and not Basic tier.

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
986 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 29,542 Reputation points Microsoft Employee Moderator
    2022-09-09T13:32:07.37+00:00

    Thanks, @Anargh V for confirming the version

    This error 'Table 'mysql.proc' doesn't exist' occurs when you migrate the database from version 5.6/5.7 to version 8.0.

    In most cases, the Gateway returned version should not impact anything when using Azure MySQL server. However, in some cases when calling a stored procedure from an application, such as CommandType.StoredProcedure in .Net, version 5.6.42 will be detected and then will lookup mysql.proc to fetch relevant stored procedure information. But, MySQL 8.0, does not have the table mysql.proc anymore, which is why the above error is reported.

    In MySQL Ver.8, stored procedure information will be stored in the mysql.routines and mysql.parameters tables, which are part of the data dictionary. You cannot access these tables directly. Instead, query the INFORMATION_SCHEMA ROUTINES and PARAMETERS tables

    You can also try the following two workarounds from the application end to mitigate the issue:

    • Specifying CheckParameters=false in application connection string.
    • Specifying in the application connection string the port 3309 instead 3306. More information you can find here

    Please let me know if you are looking for any additional information.
    Regards
    Geetha

    Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.