i don't have a big knowledge in database so excuse me if there is bad syntax or bad description but i did my best :)
When i importing to child table it ignores foreign key though the parent table is empty and hasn't any data yet, i used the following command to dump the data without this parent table data
mysqldump --ignore-table --no-create-info old_database > data.sql
then i importing this data to new database I've created
mysql new_database < data.sql
then i dumped the parent row data only using this command
mysqldump --tab="\\uploads"
importing parent_data as below
mysqlimport "\\uploads\parent_data.txt" new_database
why MySQL accepts this and ignore the existing of foreign key ? and is there a way to force MySQL to not ignore FKs when importing ?
child table show create info
| child |
CREATE TABLE `child`
(
`id` bigint(19) NOT NULL,
`flag` int(10) NOT NULL,
PRIMARY KEY (`id`, `flag`),
KEY `FK72610D66B7AE7814` (`flag`),
CONSTRAINT `FK72610D66AFB765B8`
FOREIGN KEY (`id`) REFERENCES `parent` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
parent create info
| parent |
CREATE TABLE `parent`
(
`id` bigint(19) NOT NULL AUTO_INCREMENT,
...
) ;