ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails for existing tables
it seems there are some records in c_int table which their n_id
values are not available on cdn table.
I suggest two solution
first one disable constraint checking
SET FOREIGN_KEY_CHECKS = 0;ALTER TABLE c_int ADD FOREIGN KEY (n_id) REFERENCES cdb (n_id);
Second remove or update those data
delete FROM c_int WHERE n_id NOT IN (SELECT n_id FROM cdb)