LoginSignup
2
1

More than 5 years have passed since last update.

[Mysql][Error][Mac] テーブル一覧をShowできるが、Selectできない場合

Posted at

理由はわからないが、(電源切れによる突然の再起動か)
特定のDatabase ファイルが壊れたようだ。

mysql> SHOW TABLES;
+-----------------------+
| Tables_in_database    |
+-----------------------+
| TABLE_ONE             |
| TABLE_TWO             |
| TABLE_THREE           |
+-----------------------+
mysql> SELECT * FROM TABLE_ONE;
ERROR 1146 (42S02): Table 'database.TABLE_ONE' doesn't exist

mysqlcheck --all-databases --auto-repair
で原因を探ってみると

mysqlcheck -u root -p --all-databases --auto-repair 


mysql.user                                         OK
中略..
TABLE_ONE.table
Error    : Table 'teble_one.table' doesn't exist
status   : Operation failed

どうやら特定のデータベースのみ、壊れているようだ。

そこで、
今回はテスト環境で、データもたいしてなかったので
drop database して再度 Create しなおした。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1