sql = `update chapters set parent_id=112812 where id=112770;
    update chapters set parent_id=112766 where id=112771;`

err := w.GetWriteConnection().Raw(sql).Error

use Raw or Exec doesn't work. please advice, thank you

Comment From: xwjdsh

You need to set multiStatements to true in dsn.

https://github.com/go-sql-driver/mysql#multistatements

Comment From: nevernet

@xwjdsh i got error: 'panic: 初始化数据库连接失败: <省略了>?charset=utf8mb4&parseTime=True&multiStatements=True&loc=Local(Error 1193: Unknown system variable 'multiStatements')'

Comment From: nevernet

i have updated gorm and go-sql-driver, and everything goes well now :)