[英]Cannot set database config variable from Doctrine
This does not work: 这不起作用:
bin/console doctrine:query:sql "SET FOREIGN_KEY_CHECKS=0" --env=test
I can execute the SQL part of the command via MySQL Workbench. 我可以通过MySQL Workbench执行命令的SQL部分。 On the console, it will just give me:
在控制台上,它只会给我:
/var/www/html/vendor/doctrine/common/lib/Doctrine/Common/Util/Debug.php:71:int 0
Which could possibly be the correct return value as no columns are affected. 这可能是正确的返回值,因为没有列受到影响。
But when I do SELECT @@FOREIGN_KEY_CHECKS
it is still set to 1
. 但是当我执行
SELECT @@FOREIGN_KEY_CHECKS
它仍然设置为1
。
To clarify: I use the same user to perform these operations via console as via MySQL client. 需要说明的是:我使用同一用户通过控制台(与通过MySQL客户端)执行这些操作。
似乎更改此设置仅适用于当前会话,该会话将在执行命令后立即关闭。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.