0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

An error has occurred, all later migrations canceled: Mysql2::Error: Table 'users' already exists というエラーの対処法

Posted at

問題

Rails s を実行するとマイグレーションをしろというエラーが出た後に、マイグレーションを実行した後
以下のエラーが発生しました。

An error has occurred, all later migrations canceled:
Mysql2::Error: Table 'users' already exists

エラー内容は「usersテーブルはすでにある」ということみたいです。
つまりusersテーブルが邪魔でエラーが発生しているということでしょうか。

そこで、usersテーブルを削除すればこのエラーは消えるのではと考えました。

解決策

Mysql を起動して以下のコマンドでusersテーブルを削除します。

drop table users;

予想通りusers テーブルを削除したら解決しました。
解決できて良かったです。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?