未找到基表或视图:symfony3中的1146

时间:2016-12-27 12:57:21

标签: php mysql symfony

所以几天前我的电脑出现了一些问题。我使用Sytem Restore来修复它们。

现在一切正常,但我的symfony项目存在一些问题。

事实上,有些表似乎并不存在" symfony以及其他人正在完美地工作。

我不知道为什么,但是当我想要坚持或使用这些表时,我有这样的错误:

  

SQLSTATE [42S02]:未找到基表或视图:1146   表' Symfony.tablename'不存在

实体仍在那里,我可以在mysql找到损坏的表格。怎么解决? 感谢

bug2

enter image description here

2 个答案:

答案 0 :(得分:1)

这些表是否在information_schema中列出?我怀疑他们从中消失了,但我们永远不知道/您可以通过此查询检查:

c2 = rad2deg(x-(b1*(x-c1))/b2) = 30°

您还应尝试修复this page上列出的方法。参数中的symfony mysql用户是否与用于从GUI访问它们的参数相同?如果没有,请查看Symfony用户的权限。

在我看来,转储你的数据库并重新导入它应该可以胜任。

答案 1 :(得分:1)

哟 我现在知道如何解决这个问题。

此解决方案适用于使用symfony 3(框架)的人。

首先,您需要使用此命令(database = symfony)删除mysql中的表。

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

现在通过此命令重新生成您的实体

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

更新mysql上的实体架构

diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [[ $? != 0 ]] ; then
    cat << EOM
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
EOM
    exit 1
fi

现在强制架构,你的桌子应该又回来了

[!] The `<project name> [Release]` target overrides the `ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES` build setting defined in `<.xcconfig location>'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.