ubuntu – mysql:无法从mysql.proc加载.该表可能已损坏

前端之家收集整理的这篇文章主要介绍了ubuntu – mysql:无法从mysql.proc加载.该表可能已损坏前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
MysqL启动了:
/usr/bin/MysqLd_safe  --datadir=/srv/MysqL/myDB --log-error=/srv/MysqL/logs/MysqLd-myDB.log --pid-file=/srv/MysqL/pids/MysqLd-myDB.pid --user=MysqL  --socket=/srv/MysqL/sockets/MysqL-myDB.sock --port=3700

但是当我想要做某事时:

ERROR 1548 (HY000) at line 1: Cannot load from MysqL.proc. The table is probably corrupted

怎么解决

$MysqL -V
MysqL  Ver 14.14 Distrib 5.1.58,for debian-linux-gnu (x86_64) using readline 6.2

$lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 11.10
Release:        11.10
Codename:       oneiric

$sudo MysqL_upgrade -uroot -p<password> --force
Looking for 'MysqL' as: MysqL
Looking for 'MysqLcheck' as: MysqLcheck
Running 'MysqLcheck' with connection arguments: '--port=3306' '--socket=/var/run/MysqLd/MysqLd.sock'
Running 'MysqLcheck' with connection arguments: '--port=3306' '--socket=/var/run/MysqLd/MysqLd.sock'
MysqL.columns_priv                                 OK
MysqL.db                                           OK
MysqL.event                                        OK
MysqL.func                                         OK
MysqL.general_log
Error    : You can't use locks with log tables.
status   : OK
MysqL.help_category                                OK
MysqL.help_keyword                                 OK
MysqL.help_relation                                OK
MysqL.help_topic                                   OK
MysqL.host                                         OK
MysqL.ndb_binlog_index                             OK
MysqL.plugin                                       OK
MysqL.proc                                         OK
MysqL.procs_priv                                   OK
MysqL.servers                                      OK
MysqL.slow_log
Error    : You can't use locks with log tables.
status   : OK
MysqL.tables_priv                                  OK
MysqL.time_zone                                    OK
MysqL.time_zone_leap_second                        OK
MysqL.time_zone_name                               OK
MysqL.time_zone_transition                         OK
MysqL.time_zone_transition_type                    OK
MysqL.user                                         OK
Running 'MysqL_fix_privilege_tables'...
OK

$MysqLcheck --port=3700 --socket=/srv/MysqL/sockets/MysqL-my-env.sock -A -udata_owner -pdata_owner
<all tables> OK

UPD1:例如我正在尝试删除程序:

MysqL> DROP PROCEDURE IF EXISTS MysqL.myproc;
ERROR 1548 (HY000): Cannot load from MysqL.proc. The table is probably corrupted
MysqL>

UPD2:

MysqL> REPAIR TABLE MysqL.proc;
+------------+--------+----------+-----------------------------------------------------------------------------------------+
| Table      | Op     | Msg_type | Msg_text                                                                                |
+------------+--------+----------+-----------------------------------------------------------------------------------------+
| MysqL.proc | repair | error    | 1 when fixing table                                                                     |
| MysqL.proc | repair | Error    | Can't change permissions of the file '/srv/MysqL/myDB/MysqL/proc.MYD' (Errcode: 1) |
| MysqL.proc | repair | status   | Operation Failed                                                                        |
+------------+--------+----------+-----------------------------------------------------------------------------------------+
3 rows in set (0.04 sec)

这很奇怪,因为:

$ls -l /srv/MysqL/myDB/MysqL/proc.MYD
-rwxrwxrwx 1 MysqL root 3983252 2012-02-03 22:51 /srv/MysqL/myDB/MysqL/proc.MYD

UPD3:

$ls -la /srv/MysqL/myDB/MysqL
total 8930
drwxrwxrwx  2 MysqL root    2480 2012-02-21 13:13 .
drwxrwxrwx 13 MysqL root     504 2012-02-21 19:01 ..
-rwxrwxrwx  1 MysqL root    8820 2012-02-20 15:50 columns_priv.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 columns_priv.MYD
-rwxrwxrwx  1 MysqL root    4096 2012-02-20 15:50 columns_priv.MYI
-rwxrwxrwx  1 MysqL root    9582 2012-02-20 15:50 db.frm
-rwxrwxrwx  1 MysqL root    8360 2011-12-08 02:14 db.MYD
-rwxrwxrwx  1 MysqL root    5120 2012-02-20 15:50 db.MYI
-rwxrwxrwx  1 MysqL root      54 2011-11-12 15:42 db.opt
-rwxrwxrwx  1 MysqL root   10223 2012-02-20 15:50 event.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 event.MYD
-rwxrwxrwx  1 MysqL root    2048 2012-02-20 15:50 event.MYI
-rwxrwxrwx  1 MysqL root    8665 2012-02-20 15:50 func.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 func.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 func.MYI
-rwxrwxrwx  1 MysqL root    8700 2012-02-20 15:50 help_category.frm
-rwxrwxrwx  1 MysqL root   21497 2011-11-12 15:42 help_category.MYD
-rwxrwxrwx  1 MysqL root    3072 2012-02-20 15:50 help_category.MYI
-rwxrwxrwx  1 MysqL root    8612 2012-02-20 15:50 help_keyword.frm
-rwxrwxrwx  1 MysqL root   88650 2011-11-12 15:42 help_keyword.MYD
-rwxrwxrwx  1 MysqL root   16384 2012-02-20 15:50 help_keyword.MYI
-rwxrwxrwx  1 MysqL root    8630 2012-02-20 15:50 help_relation.frm
-rwxrwxrwx  1 MysqL root    8874 2011-11-12 15:42 help_relation.MYD
-rwxrwxrwx  1 MysqL root   16384 2012-02-20 15:50 help_relation.MYI
-rwxrwxrwx  1 MysqL root    8770 2012-02-20 15:50 help_topic.frm
-rwxrwxrwx  1 MysqL root  414320 2011-11-12 15:42 help_topic.MYD
-rwxrwxrwx  1 MysqL root   20480 2012-02-20 15:50 help_topic.MYI
-rwxrwxrwx  1 MysqL root    9510 2012-02-20 15:50 host.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 host.MYD
-rwxrwxrwx  1 MysqL root    2048 2012-02-20 15:50 host.MYI
-rwxrwxrwx  1 MysqL root    8554 2011-11-12 15:42 innodb_monitor.frm
-rwxrwxrwx  1 MysqL root   98304 2011-11-12 15:55 innodb_monitor.ibd
-rwxrwxrwx  1 MysqL root    8592 2012-02-20 15:50 inventory.frm
-rwxrwxrwx  1 MysqL root      76 2011-11-12 15:42 inventory.MYD
-rwxrwxrwx  1 MysqL root    2048 2012-02-20 15:50 inventory.MYI
-rwxrwxrwx  1 MysqL root    8778 2012-02-20 15:50 ndb_binlog_index.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 ndb_binlog_index.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 ndb_binlog_index.MYI
-rwxrwxrwx  1 MysqL root    8586 2012-02-20 15:50 plugin.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 plugin.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 plugin.MYI
-rwxrwxrwx  1 MysqL root    9996 2012-02-20 15:50 proc.frm
-rwxrwxrwx  1 MysqL root 3983252 2012-02-03 22:51 proc.MYD
-rwxrwxrwx  1 MysqL root   36864 2012-02-21 13:23 proc.MYI
-rwxrwxrwx  1 MysqL root    8875 2012-02-20 15:50 procs_priv.frm
-rwxrwxrwx  1 MysqL root    1700 2011-11-12 15:42 procs_priv.MYD
-rwxrwxrwx  1 MysqL root    8192 2012-02-20 15:50 procs_priv.MYI
-rwxrwxrwx  1 MysqL root 3977704 2012-02-21 13:23 proc.TMD
-rwxrwxrwx  1 MysqL root    8800 2012-02-20 15:50 proxies_priv.frm
-rwxrwxrwx  1 MysqL root     693 2011-11-12 15:42 proxies_priv.MYD
-rwxrwxrwx  1 MysqL root    5120 2012-02-20 15:50 proxies_priv.MYI
-rwxrwxrwx  1 MysqL root    8838 2012-02-20 15:50 servers.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 servers.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 servers.MYI
-rwxrwxrwx  1 MysqL root    8955 2012-02-20 15:50 tables_priv.frm
-rwxrwxrwx  1 MysqL root    5957 2011-11-12 15:42 tables_priv.MYD
-rwxrwxrwx  1 MysqL root    8192 2012-02-20 15:50 tables_priv.MYI
-rwxrwxrwx  1 MysqL root    8636 2012-02-20 15:50 time_zone.frm
-rwxrwxrwx  1 MysqL root    8624 2012-02-20 15:50 time_zone_leap_second.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 time_zone_leap_second.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 time_zone_leap_second.MYI
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 time_zone.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 time_zone.MYI
-rwxrwxrwx  1 MysqL root    8606 2012-02-20 15:50 time_zone_name.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 time_zone_name.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 time_zone_name.MYI
-rwxrwxrwx  1 MysqL root    8686 2012-02-20 15:50 time_zone_transition.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 time_zone_transition.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 time_zone_transition.MYI
-rwxrwxrwx  1 MysqL root    8748 2012-02-20 15:50 time_zone_transition_type.frm
-rwxrwxrwx  1 MysqL root       0 2011-11-12 15:42 time_zone_transition_type.MYD
-rwxrwxrwx  1 MysqL root    1024 2012-02-20 15:50 time_zone_transition_type.MYI
-rwxrwxrwx  1 MysqL root   10630 2012-02-20 15:50 user.frm
-rwxrwxrwx  1 MysqL root    5456 2011-11-12 21:01 user.MYD
-rwxrwxrwx  1 MysqL root    4096 2012-02-20 15:50 user.MYI
这很可能在运行MysqL升级时得到解决,因为这似乎是架构更改的结果.

MysqL_upgrade -u root -p

如果您的管理帐户的用户名不是root用户,请在上面的示例中进行更改.

原文链接:https://www.f2er.com/ubuntu/349022.html

猜你在找的Ubuntu相关文章