简体   繁体   English

MySQL“表不存在”,但实际上确实存在

[英]MySQL “Table doesn't exist”, but it actually does

I've set up a new RDS MySQL instance and an EC2 instance on AWS. 我在AWS上设置了一个新的RDS MySQL实例和一个EC2实例。 When I run the Laravel migration, the database is set up correctly and the tables are created. 当我运行Laravel迁移时,正确设置了数据库并创建了表。 I can verify this by signing in and seeing the tables in the database in the terminal. 我可以通过在终端中登录并查看数据库中的表来验证这一点。 But when I try to run a signup request and create a new user, it returns with an error of "table does not exist". 但是,当我尝试运行注册请求并创建新用户时,返回的错误为“表不存在”。

The issue could be that the database is named "OrchidEats" and in the error, it states that "orchideats.users" does not exist. 问题可能是数据库名为“ OrchidEats”,并且在错误中指出“ orchideats.users”不存在。 But I am not sure why this could affect it. 但是我不确定为什么这会影响它。

Any help would be greatly appreciated. 任何帮助将不胜感激。

Check your table name user or users. 检查您的表名用户。

If user that time open User model file and add this line. 如果用户当时打开用户模型文件并添加此行。

protected $table = 'user';

Try this code 试试这个代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM