Mysql2::Error: Table 'users' already existsエラーに遭遇
Mysql2::Error: Table 'users' already exists
ターミナルで以下のコマンドを実行
$ rails db:
すると
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 490
Server version: 5.6.47 Homebrew
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
mysql> SHOW TABLES;
+---------------------------+
| Tables_in_app_development |
+---------------------------+
| ar_internal_metadata |
| posts |
| schema_migrations |
| users |
+---------------------------+
ここからusersテーブルを消すために、次のコマンドを実行
mysql> drop table テーブル名;
今回はusersテーブルなので
mysql> drop table users;
Query OK, 0 rows affected (0.04 sec)
削除完了。 sequelProで中身を確認してところ、無事消えていた。
ターミナル上の操作はなかなか覚えられないが、こうした作業ができるのを知っておくのが大切かなと。