69 questions
0 votes
0 answers
103 views
Error 1217 vs 1452: Still less verbose despite `GRANT_ALL`
On MySQL 8.0.34, errors 1217 and 1452 represent the same thing but provide less information in the former case by design. A user without the relevant grants should not see the information about a ...
2 votes
1 answer
3k views
MySQL Error Code: 1452. Cannot add or update a child row: a foreign key constraint fails
I am trying to insert values into the employee table but when I tried to execute the script, it gave me this error. What am I doing wrong? RESPONSE: Error Code: 1452. Cannot add or update a child row:...
-1 votes
1 answer
117 views
#1452 - Cannot add or update a child row: a foreign key constraint fails Policy_payment
enter image description hereI have created these tables in phpmyadmin Payment table DROP TABLE IF EXISTS Payment; CREATE TABLE IF NOT EXISTS Payment ( pay_id int(5) NOT NULL, number int(25) default ...
-2 votes
1 answer
2k views
How can i insert value into a table with foreign key?
I have this scheme for tables And i can't insert any value into a second or 3d table at all becouse of error 1452 (cannot add or update a child row.) How can i insert something? (not useing a SET ...
0 votes
0 answers
150 views
To create a trigger that if I insert a row in child table with null foreign key ,It inserts a new row in parent table with that criteria and new id
This is factors table: CREATE TABLE `factors` ( `id` int(11) NOT NULL AUTO_INCREMENT, `price_sum` int(11) NOT NULL, `date` datetime DEFAULT NULL, PRIMARY KEY (`id`)) And this one is ...
1 vote
1 answer
415 views
Insert with execute many, skipping rows that fail foreign key constraints
I am using Python mysql.connector . I have to make a lot of inserts. The data I am inserting is likely to have some rows that will fail the foreign key constraint and thus return the 1452 mysql error. ...
0 votes
1 answer
198 views
MySQL Error inserting a row in a one-to-one relationship - (1452) Cannot add or update a child row: a foreign key constraint fails
I'm creating a DB in MySQL Workbench. I created the schemas in an EER Diagram (in Windows), moved to Linux after that, and I did Forward Engineering for getting the SQL Script. Now I'm testing the DB, ...
0 votes
1 answer
102 views
MySQL Workbench Error 1452 suddenly stopped working
I have 2 tables (customers and cars with FK) and in the beginning everything was OK, I was able to insert data until ID 7 and then all of a sudden it just stopped working and gave me an error 1452. ...
-1 votes
1 answer
94 views
Why is error 1452 appearing when executing these tables? [duplicate]
I want to insert some data into some tables. However, upon reaching statistics_per_year, mysql shoots out error code 1452 and I do not know why this is. error: 17:54:58 INSERT INTO ...
1 vote
1 answer
437 views
Error 1452 MySQL Load Infile (but correct data)
I'm trying to load data from a .txt using LOAD DATA INFILE, the problem is that i get error 1452, but the foreign keys referred are present in my DB. Also other LOAD DATA are working, just can't solve ...
-1 votes
1 answer
21 views
Unable to add foreign key between two tables tables on fields signup (uid) and login (uid)
I can't add foreign key between the tables on fields signup and login because of getting error: #1452 - Cannot add or update a child row: a foreign key constraint fails (`cems`.`#sql-109c_1ab`, ...
0 votes
1 answer
119 views
Cannot add or update child row MySQL Error 1452
I am getting this error: ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (university.registration, CONSTRAINT registration_ibfk_2 FOREIGN KEY (section_id) ...
0 votes
1 answer
50 views
SQL Error 1452 while UPDATE non key columns
I have those two tables... CREATE TABLE `Mail` ( `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `sender` varchar(255) NOT NULL DEFAULT '', `receiver` varchar(...
4 votes
1 answer
12k views
Keep getting foreign key constraint failed message in My SQL
I tried to insert data into the table Bookratings, but I keep getting this error message. Is this because when I try to insert, it creates duplicates in the Bookratings table, which is not allowed by ...
0 votes
0 answers
194 views
Mysql Error 1452 - sqlMessage: "Cannot add or update a child row: a foreign key constraint fails [duplicate]
I am getting this error, I am trying to assign a a separate Pokemon ID to a type ID through a dropdown menu. Here is the full error "sqlMessage: "Cannot add or update a child row: a foreign key ...