commands out of sync. did you run multiple statements at once

tech2025-08-08  13

执行gorm.open()开启db连接时提示commands out of sync. did you run multiple statements at once

一大会没找到原因,最后你猜怎么样?

代码所跑的机器和db服务所在的机器网络不通导致!!!换到可访问的机器上就ok了。

所以,千万别被提示迷惑了                  

 

最后附上访问mysql的格式:

用户名:密码@tcp(IP:端口)/库名?charset=utf8&parseTime=True&loc=Local

 

最新回复(0)