HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Resolving issue with mysql.proc after upgrading MySQL from 5.0.* to 5.1.*

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
afterupgradingwithissuemysqlprocresolvingfrom

Problem

Like many others, we upgraded our instance of MySQL from 5.0.* to 5.1.49. Since then, we've been running into an error that repeats itself when we perform certain actions:

  • Attempting to view or run a stored procedure



  • Attempting to insert into a table after adding a trigger for ON INSERT actions



  • Executing SELECT LENGHT(description), id FROM table (with the misspelling... when LENGTH was spelled correctly, the error did not display)



The error in question:


Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted.

This has been reported as a bug (basically, lack of backwards compatibility), but there appears to be some confusion as to how to resolve the issue:

  • MySQL's documentation says the solution is to dump your stored procedures again after the upgrade to 5.1, then restore them again. The bug report I mentioned earlier shows that this has dubious results.



  • The bug report suggests running mysql_upgrade as a possible solution (albeit with some concerning warnings). However, it has been reported elsewhere that this solution doesn't always work.



I am in the unfortunate circumstance of not having a test box under which to test possible solutions as our development box is pending an OS upgrade to allow us to install the versions of MySQL we want to install. I am hesitant to try any solution on our production environment unless it has been verified as working by people who have encountered this issue.

What is the correct way to resolve this issue outside of waiting for an official patch or solution from MySQL?

While losing our stored procedures is not ideal, it is also a route we are willing to take to resolve the issue provided that there are no better alternatives and it will solve the issue cleanly.

Solution

I was having this issue, and thought I'd mention that running "mysql_upgrade --force" fixed it for me.

I upgraded from 5.0 to 5.1 to 5.5. The interesting this is that I had already run mysql_upgrade which is why I needed to add the --force option. Hope this helps someone.

Context

StackExchange Database Administrators Q#956, answer score: 7

Revisions (0)

No revisions yet.