Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot load from mysql.proc. The table is probably corrupted

I know that it looks like duplicate, but the solutions which I found don't work for me. I uninstalled MySQL 5.1 and installed 5.6, and I would like to import a previously exported SQL file back. But there is some function which causes an error in that export file. I found and ran the command:

../bin mysql mysql_upgrade -uroot -p --force

but if I understand, it works only when upgrade, not with install. Is there some solution for me?

I also removed the function definition from import file and import is done. But if I want to redefine that function manually it shows me the same error "can not load from mysql.proc". Function is here:

DELIMITER $$

CREATE FUNCTION `randStr250`(length int) RETURNS varchar(250) CHARSET utf8
begin
  declare s varchar(250);
  declare i tinyint;
  set s="";
  if (length<1 or length>6) then
      set s="Parameter should be in range 1-6. Your value was out of this range.";
  else
    set i=0;
    while i<length do
        set s=concat(s,sha1(now()));
        set i=i+1;
    end while;
  end if;
  return s;
end $$

DELIMITER ;
like image 783
Čamo Avatar asked Jan 13 '15 09:01

Čamo


People also ask

Can not load from mysql proc?

I mistyped the name of an internal MySQL function in some code this morning and got back the error message "Cannot load from mysql. proc. The table is probably corrupted" which appeared to have no bearing on the actual error. The simple fix to this problem is to run the mysql_upgrade command.

What is mysql proc?

The mysql. proc table contains information about stored procedures and stored functions. It contains similar information to that stored in the INFORMATION SCHEMA.

Why can't I load a table from MySQL Proc?

The table is probably corrupted Cannot load from mysql.proc. The table is probably corrupted I mistyped the name of an internal MySQL function in some code this morning and got back the error message "Cannot load from mysql.proc. The table is probably corrupted" which appeared to have no bearing on the actual error.

How to resolve MySQL error code 1548 cannot load from MySQL?

How to Resolve MySQL Error Code: 1548 Cannot load from mysql.proc. The table is probably corrupted MySQL will sometimes return the error message “Cannot load from mysql.proc. The table is probably corrupted”. This happens due to schema changes required for different MySQL server versions.

How do I fix the mysql table is corrupted error?

The table is probably corrupted" which appeared to have no bearing on the actual error. The simple fix to this problem is to run the mysql_upgrade command. From the command line (you won’t be able to do this from a tool like phpMyAdmin) run the command line tool mysql_upgrade passing like so:

How to fix MySQL_upgrade not working in Windows 10?

The simple fix to this problem is to run the mysql_upgrade command from the command line. mysql_upgrade examines all tables across all databases for incompatibilities with the current version of MySQL Server. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added.


Video Answer


2 Answers

Had a similar issue after restorting a db dump from mysql-5.5.29 to mariadb-5.5.41. mysql_upgrade fixed the issue

$ mysql_upgrade -u root -pxxx 

According to the mysql manual,

You should execute mysql_upgrade each time you upgrade MySQL.

like image 50
ffeast Avatar answered Oct 23 '22 07:10

ffeast


Most people that have this problem are recommending upgrading MySQL. If you're in a configuration, like me, in which this happens when you try to set up a SLAVE node to replicate from a MASTER node, you don't really want to mess up with versions.

I mean, in my case I had a Windows MASTER node and was setting up a Linux SLAVE node (so, doing the mysqldump dance first). Since upgrading MySQL is a bit more tricky in Linux (or rather, it's actually better not to do it, to enjoy the stability of Linux packages that, for example, come from your LTS distribution), it's maybe just a good idea to make sure that the MySQL version that you have in your Windows OS is running the same version as your MySQL version in your Linux OS.

Once I made sure both versions were the same, the mysqldump and restore worked, and I could set up a SLAVE node properly without receiving the dreadful error Cannot load from mysql.proc. The table is probably corrupted..

Hope this helps.

like image 2
knocte Avatar answered Oct 23 '22 08:10

knocte