Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Mysql was started:

/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

but when I'm trying to do something:

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

How to fix it?

$ 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: for example I'm trying to remove procedure:

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)

This is strange, because:

$ 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
share|improve this question
    
What is the "something" that you're trying to do when you get that error? –  nickgrim Feb 20 '12 at 14:55
    
@nickgrim for example i'm trying to remove procedure. see example above. –  Alex Feb 21 '12 at 9:03
    
Stop the mysql service and run lsof. Does something have that file open? –  longneck Dec 7 '12 at 0:37
    
Can you also paste the log output which you see in the mysql logs, when you try to do something. –  GeekRide Jan 9 '13 at 5:34

3 Answers 3

This will most likely be solved when running a MySQL upgrade, as this seems to be a result of schema changes.

mysql_upgrade -u root -p

If your username for your administrative account is not root, please change it in the example above.

share|improve this answer
    
i needed to use mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow` with plesk, just in case someone has this problem with plesk –  Ties Oct 15 at 14:02

Perhaps the following will fix it?

mysql> REPAIR TABLE mysql.proc;
share|improve this answer
    
please, see upd2 –  Alex Feb 21 '12 at 10:28
    
Can you add the results of ls -la /srv/mysql/myDB/mysql ? –  nickgrim Feb 21 '12 at 17:06
    
sure. please, see UPD3 –  Alex Feb 22 '12 at 8:25

Repairing the table won't fix it. The table is not corrupted in the first place. Running mysql_upgrade definitely fixes the problem.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.