Errore Can't open file: 'nomedatabase.MYI'. (errno: 145)

From RVM Wiki
Revision as of 16:34, 25 January 2006 by Gabriele.vivinetto (talk | contribs)
Jump to navigation Jump to search

Se durante una query o un mysqldump si ottiene l'errore 145, siginifica che la tabella del database è corrotta, a seguito di un problema con il filesystem.

E' possibile riparare la tabella in due modi:

  • Riparare la singola tabella, eseguendo un REPAIR table per ognuna delle tabelle contenute nel database:
mysql nomedatabase

mysql> show tables;
+------------------------+
| Tables_in_nomedatabase |
+------------------------+
| acct                   |
| acct_eth0              |
+------------------------+
2 rows in set (0.00 sec)

mysql> repair table acct;
+-------------+--------+----------+------------------------------------------------+
| Table       | Op     | Msg_type | Msg_text                                       |
+-------------+--------+----------+------------------------------------------------+
| pmacct.acct | repair | warning  | Number of rows changed from 2207385 to 2207356 |
| pmacct.acct | repair | status   | OK                                             |
+-------------+--------+----------+------------------------------------------------+
2 rows in set (2 min 13.69 sec)
.....

  • Riparare tutto il database con mysqlcheck:
mysqlcheck -r pmacct -u root -p