我有一个问题,搬到Mysql8在我的码头写作。
我想使用mysql_native_password身份验证插件,我想删除所有的sql_modes。
这是我的docker-compose.yml的相关部分。
services:
mysql-server:
platform: linux/x86_64
image: mysql:8.0.30
command: --default-authentication-plugin=mysql_native_password
command: --sql_mode=''
如果单独使用这些命令,这两条命令都可以工作。但是使用这两种方法都不起作用,它只设置一个值,而不设置另一个值。我尝试过各种方法来连接没有设置任何字符串的字符串。
当我尝试这个常见的解决方案时,我无法连接到mysql。
command: >
bash -c "--default-authentication-plugin=mysql_native_password
&& --sql_mode='NO_ENGINE_SUBSTITUTION'"
也试过
command: ["--default-authentication-plugin=mysql_native_password", "--sql_mode='NO_ENGINE_SUBSTITUTION"]
你知道我怎么能把这两样都设置好吗?
发布于 2022-08-16 20:00:30
最终,这似乎奏效了。
command: ["--default-authentication-plugin=mysql_native_password", "--sql_mode="]
也就是说,双引号中没有单引号。也许您可以转义单引号(特别是如果您想设置一个或多个模式).我没试过。
希望这能帮助别人像我一样把你的头撞在墙上。
https://stackoverflow.com/questions/73378144
复制相似问题