简体   繁体   English

在Symfony3中找不到基表或视图:1146

[英]Base Table or View not found:1146 in symfony3

So I had some issues with my PC few days ago . 因此,几天前我的PC出现了一些问题。 I used the Sytem Restore to fix them. 我使用系统还原来修复它们。

Everything is ok now, but I have some issues with my symfony project. 现在一切都很好,但是我的symfony项目存在一些问题。

Indeed, some tables don't seem to "exist" anymore for symfony , and others are working perfectly. 确实,一些表似乎不再存在于symfony ,而其他表则运行良好。

I don't know why, but when I want to persist or use these tables I have this error : 我不知道为什么,但是当我要保留或使用这些表时,出现此错误:

SQLSTATE[42S02]: Base Table or view not found:1146 Table'Symfony.tablename'doesn't exist SQLSTATE [42S02]:未找到基本表或视图:1146表'Symfony.tablename'不存在

The Entity is still there and I can found the corrupted tables on mysql . 实体仍然存在,我可以在mysql上找到损坏的表。 How to fix it ? 如何解决? thanks 谢谢

错误2

在此处输入图片说明

Do these tables are listed in information_schema ? 这些表是否在information_schema中列出? I doubt they disappeared from it, but we never know / you can check that with this query : 我怀疑它们是否从中消失了,但我们永远不会知道/您可以使用以下查询来检查它:

SELECT table_name FROM INFORMATION_SCHEMA.TABLES;

You should also give a try to repair methods listed on this page . 您还应该尝试修复此页面上列出的方法。 Is the symfony mysql user in parameters the same than the one you use to access them from your GUI ? 参数中的symfony mysql用户是否与用于从GUI访问它们的用户相同? If not, have a look at your permissions too for the Symfony User. 如果不是,请查看您对Symfony用户的权限。

Dumping your database and importing it again should do the job in my opinion. 我认为,转储数据库并再次导入它应该可以完成这项工作。

Yo I know how to fix this issue now . 哟,我知道如何立即解决此问题。

This solution apply for those who are using symfony 3 (framework). 该解决方案适用于使用symfony 3(框架)的用户。

First you need to delete your table in mysql with this command (database = symfony) . 首先,您需要使用此命令(database = symfony)在mysql中删除表。

DROP TABLE yourtablename;

Now re-generate your entities again via this command 现在,通过此命令再次重新生成您的实体

php bin/console generate:doctrine:entities YourBundleNameBundle

Update your entities schema on mysql 在mysql上更新您的实体架构

php bin/console doctrine:schema:update --dump -sql

Now force the Schema and your tables should be back again 现在强制模式,您的表应该再次返回

php bin/console doctrine:schema:update --force

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

相关问题 Symfony2:找不到基表或视图:1146 - Symfony2: Base table or view not found: 1146 未找到基表或视图:1146 表 Laravel 5 - Base table or view not found: 1146 Table Laravel 5 Laravel 8:未找到基表或视图:1146 表 - Laravel 8: Base table or view not found: 1146 Table 找不到基本表或视图:1146表'username.gallery_images' - Base table or view not found: 1146 Table 'username.gallery_images' SQLSTATE [42S02]:找不到基表或视图:1146 - SQLSTATE[42S02]: Base table or view not found: 1146 未找到基表或视图:1146 表 'xyz.testimonials' 不存在(SQL:select * from `testimonials`) - Base table or view not found: 1146 Table 'xyz.testimonials' doesn't exist (SQL: select * from `testimonials`) LARAVEL - 未找到基表或视图:1146 表不存在(SQL: select * from ) - LARAVEL - Base table or view not found: 1146 Table doesn't exist (SQL: select * from ) 未找到基表或视图:1146 表 'aswakt.annonce_order' 不存在 - Base table or view not found: 1146 Table 'aswakt.annonce_order' does not exist Laravel Spatie 权限 - 未找到基表或视图:1146 表“my_database.models”不存在 - Laravel Spatie Permissions - Base table or view not found: 1146 Table 'my_database.models' doesn't exist Laravel 8 - 未找到基表或视图:1146 表“laravel8.brand”不存在 - Laravel 8 - Base table or view not found: 1146 Table 'laravel8.brand' doesn't exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM