MySql資料庫插入或更新報錯:Cannot add or update a child row: a foreign key constraint fails
具體報錯資訊:
Cannot add or update a child row: a foreign key constraint fails (`xxx`.`AAA`, CONSTRAINT `tb_competitionmsg_ibfk_2` FOREIGN KEY (`organizerid`) REFERENCES `BBB` (`id`))
報錯資訊分析:
XXX資料庫中的 AAA表 中的 organizerid欄位 是BBB表中的id的外來鍵,但是要插入的organizerid值在id中沒有匹配成功。
解決:
檢查插入的資料是否正確
在BBB表中的id欄位中新增上所要插入的值。
相關推薦
MySql資料庫插入或更新報錯:Cannot add or update a child row: a foreign key constraint fails
具體報錯資訊: Cannot add or update a child row: a foreign key constraint fails (`xxx`.`AAA`, CONSTRAINT `tb_competitionmsg_ibfk_2` FOREIGN KEY (`organizerid`) R
使用 ThinkPHP 框架,mysql 報錯:1364:Field xx doesn't have a default value,laravel 卻沒有報過
1364:Field 'sex' doesn't have a default value [ SQL語句 ] 1364:Field 'sex' doesn't have a default value [ SQL語句 ] 錯誤解決方法: 關閉MySQL的strict
【Mysql】 解決MySQL8.0報錯:Unknown system variable 'validate_password_policy'
author:咔咔 wechat:fangkangfk 問題所在一個是 _ 連線的一個是 . 連線的 一、問題描述 1、在安裝MySQL8.0時,修改臨時密碼,因密碼過於簡單(如:123456),
Xcode10更新報錯:library not found for -lstdc++.6.0.9
由於iPhone X Max 及iOS12系統的到來,必須升級xcode10了,剛升級完執行就報錯了,一臉悶逼。 library not found for -lstdc++.6.0.9 報錯原
解決python3向資料庫插入日期字串報錯的問題
[Err] 22007 - [SQL Server]從字串轉換日期和/或時間時,轉換失敗。 插入的日期字串(日期字串是從檔案中讀取的,將檔案中的資料轉存到關係型資料庫中): '2017/04/10' 字串看著沒問題,我用len(str)檢視長度,發現長度為11,多出了一個字元
MySQL Workbench批量修改資料報錯:Error Code: 1175. You are using safe update mode and you tried to update a t
批量修改資料SQL:update sys_menu set menu_extralink = true 錯誤資訊: Error Code: 1175. You are using safe update mode and you tried to upd
oracle資料庫插入時間戳報錯;匯入dmp檔案亂碼
產生原因: 資料庫字符集跟電腦客戶端環境變數字符集不一致會導致時間戳插入報錯; 資料庫字符集跟電腦客戶端環境變數字符集不一致會導致使用PL_SQL工具匯入的sql檔案中的資訊在資料庫亂碼 解決辦法: 檢視資料庫字符集 select * from nls
Navicate遠端連線資料庫(linux Centos7) 報錯 2003 cannot connect mysql on( 10060)
今天在上傳一個小專案的時候資料庫連接出錯,弄得我頭大一開始是出現這種錯誤 2003 cannot connect mysql on( 10060) 網上很多方法都試過就是不行,最後通過設定埠的防火牆成功連線 先設定埠的防火牆 /sbin/iptables -I INPUT -p tc
MySql的Blob欄位報錯:Data truncation: Data too long for column 'CONTENT' at row 1
總結來說,Data truncation: Data too long for column 'CONTENT' at row 1問題的出現主要是以下幾個原因: 1、可能
ClickOnce 自動更新報錯:部署標識與預訂不匹配
一、遇到的問題 最近的專案採用的是VS自帶的部署工具ClickOnce部署檢測更新。開始並沒有什麼問題,但是最近一兩次經常遇到:伺服器更新版本後,客戶端升級會出現以下錯誤: 執行此操作期間檢測到下列錯誤。* [28.12.2017 18:16:17
mysql資料庫報錯 sql 1452 Cannot add or update a child row:a foreign key constraint fails
其實這句話的意思就是你新增一個值是一個外來鍵,但是這個外來鍵不在關聯的資料庫中的主鍵中,這樣就導致了新增失敗了,解決辦法就是新增對應關聯資料庫的主鍵的值,不過我要提醒一下!(也就是我採的坑!)一定要看清
在vs2015中提交或更新時報錯:Exception throw in progress runner thread
原因:我在本機打開了pdm檔案,有同事對該pdm進行了修改,並且提交了。 我在未關閉該檔案的前提下在本機的vs2015中使用AnkhSVN進行專案更新操作,結果SVN報錯Exception throw in progress runner thread
mysql 安裝壓縮包,報錯:服務無法啟動解決方法!!!
1.安裝MySQL mysqld install,執行命令後MySQL安裝成功。 2.啟動MySQL服務。 net start mysql將啟動MySQL服務。ps:到這一步報錯,無法啟動服務!!!! 網上找了很多,多少都比較麻煩,其實解決起來很簡單: 在執行第二布命
安裝mysql報錯:cannot create windows service for mysql.error:0
安裝安裝mysql-5.1.46時報錯,cannot create windows service for mysql.error:0。 錯誤原因: 多數是由於重新安裝mysql或者對mysql升級,使用MySQL Configuration Wizard而產生。 解決方法1
MySQL 執行SQL檔案,報錯:”Got a packet bigger than 'max_allowed_packet' bytes“
開發十年,就只剩下這套架構體系了! >>>
spriing boot 啟動報錯:Cannot determine embedded database driver class for database type NONE
.class sre 5.0 sin via cor pan cep can 最近在學習使用spring boot。使用maven創建好工程,只引用需要用到的spring boot相關的jar包,除此之外沒有任何的配置。 寫了一個最簡單的例子,如下所示: 1 pa
spring boot 啟動報錯:Cannot determine embedded database driver class for database type NONE
info for bubuko 報錯 spring free 增加 .com control 錯誤原因:spring boot默認會加載org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfigurati
Ant design 項目打包後報錯:"Menu(or Flex) is not defined"
方式 查找 item back TP mob -m flex alt 我的項目使用了ant-design 和 ant-design-mobile,在測試環境上沒問題,但是打包發布之後控制臺報錯 Menu is not definedFlex is not defined
命令行可以執行python腳本,jenkins裏執行報錯:cannot find Chrome binary
重新 jenkins HR message pytho ann 命令 web AD “selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome bina
Python_報錯:TypeError: Tuple or struct_time argument required
line 元祖 recent ror color time 但是 -c fcc 報錯:TypeError: Tuple or struct_time argument required 原因:時間戳和格式化處理時間不能直接使用會報錯 上代碼: import time t