Knowledge Essentials - 3Essentials Hosting

ERROR: SELECT command denied to user user@x for table proc

Article ID: 990

 Back to Search

Symptom/Error:

  • Receive the following error when users connect their MySQL database with MySQL .Net connector and try to create or call a stored procedure, MySQL will return the following error:
  • SELECT command denied to user 'user'@'x' for table proc
  • This may also present with other symptoms or errors... for instance, another customer, based on how his code was written to call the stored procedure and handle the return, received the following error:

    System.IndexOutOfRangeException: There is no row at position 0

Solution:

  • SHARED HOSTING customers:
    • The process attempts to perform a SELECT statement on the 'proc' table.  The 'proc' table is a system table which retains the procedures of all users on that mysql instance.  On shared hosting, allowing userA to see the procedures of userB, which would include information about table structure, etc., would be considered breach of security.
    • A workaround has been documented on several mysql resources which indicates this can be fixed by adding "Use Procedure Bodies=false;" to the connection string, i.e.:
    • "server=localhost; user id=dbuser; password=password; database=dbname; Use Procedure Bodies=false;"
  • DEDICATED / VIRTUAL SERVER customers:
    • For SERVER customers (DEDICATED or VIRTUAL), you can use the workaround above OR we can enable teh dbuser to have READ permissions to the proc table upon customer request, because the Mysql instance would be dedicated to just the single customer, and that customer would solely bear the risk associated with this. 
 
Downloads Associated With This Article
No downloads are currently associated with this article.