无法从 mysql.proc 加载。表可能已损坏
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27918764/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Cannot load from mysql.proc. The table is probably corrupted
提问by ?amo
I know that it looks like duplicate, but the solutions which I found doesnt work for me.
I uninstalled mysql 5.1 and installed 5.6 and I would like to import previouse export sql file back. But there is some function which makes this error in that export file.
I found and run command:
../bin mysql mysql_upgrade -uroot -p --force
but if I understant, it works only when upgrade, not with install. Is there some solution for me?
我知道它看起来像重复的,但我发现的解决方案对我不起作用。我卸载了 mysql 5.1 并安装了 5.6,我想重新导入以前的导出 sql 文件。但是有一些函数会在该导出文件中导致此错误。我找到并运行命令:
../bin mysql mysql_upgrade -uroot -p --force 但如果我理解,它只在升级时有效,而不是在安装时有效。有什么解决办法吗?
Thanks!
谢谢!
EDIT:I 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:
编辑:我从导入文件中删除了函数定义并完成了导入。但是,如果我想手动重新定义该函数,它会显示相同的错误“无法从 mysql.proc 加载”。功能在这里:
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 ;
回答by ffeast
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-5.5.29 恢复到 mariadb-5.5.41 后遇到了类似的问题。mysql_upgrade 解决了这个问题
$ mysql_upgrade -u root -pxxx
According to the mysql manual,
根据mysql手册,
You should execute mysql_upgrade each time you upgrade MySQL.
每次升级 MySQL 时都应该执行 mysql_upgrade。
回答by knocte
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.
大多数遇到此问题的人都建议升级 MySQL。如果您像我一样处于这样的配置中,当您尝试设置一个从节点以从主节点复制时会发生这种情况,那么您真的不想弄乱版本。
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.
我的意思是,就我而言,我有一个 Windows MASTER 节点并且正在设置一个 Linux SLAVE 节点(因此,首先执行 mysqldump 舞蹈)。由于在 Linux 中升级 MySQL 有点棘手(或者更确切地说,实际上最好不要这样做,以享受 Linux 软件包的稳定性,例如,来自您的 LTS 发行版),这可能只是一个好主意,以确保您的 Windows 操作系统中的 MySQL 版本与 Linux 操作系统中的 MySQL 版本运行的版本相同。
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.
.
一旦我确定两个版本相同,mysqldump 和 restore 就可以工作了,我可以正确设置一个 SLAVE 节点而不会收到可怕的错误Cannot load from mysql.proc. The table is probably corrupted.
。
Hope this helps.
希望这可以帮助。