我嘗試通過 docker exec api -> https://docs.docker.com/engine/api/v1.41/#operation/ContainerExec運行 mysql 陳述句
我的宣告看起來像這樣
{
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"DetachKeys": "ctrl-p,ctrl-q",
"Tty": false,
"Cmd": [
"bin/bash","-c", "mysql -uroot -ptesttest -e 'INSERT INTO `mandator_1`.`terminal` (`serialNumber`, `name`, `isActive`, `status`, `profileId`, `businessId`, `divisionId`, `ipAddress`, `groupId`, `setupVersion`, `macAddress`, `authType`) VALUES ('54321', '54321', '1', NULL, '1', '1', NULL, '172.45.17.197', '1', NULL, 'E4-F1-D3-FD', '2');' mandator_1"
]
}
但是當我運行該陳述句時出現錯誤
第 1 行的 ERROR 1064 (42000):您的 SQL 語法有錯誤;檢查與您的 MariaDB 服務器版本相對應的手冊,在第 1 行的“.17.197, 1, NULL, E4-F1-D3-FD, 2)”附近使用正確的語法
我認為我的逃避是錯誤的,但在哪一點?
uj5u.com熱心網友回復:
嘗試通過雙引號更改報價:
VALUES (\"54321\", \"54321\", \"1\", ...., \"2\");
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/349057.html
標籤:mysql
下一篇:MYSQL匯出資料及其列名
