Bulk CSV Import to Email Black list(mw_email_blacklist) table in DATABASE Error

pradeep sharma

Active Member
Dear @twisted19

I Have a huge list of Email Blacklist around 265K Records as import via Backend was very slow then i tried to upload it to directly into table myprefix_email_blacklist(i made my table empty to avoid any confilct)
i have a csv file with all fields set and with no error..
I tried to upload in via MYSQL Consol in command line ...

mysql> LOAD DATA LOCAL INFILE '/home/mailapp_email_blacklist.csv' INTO TABLE mailapp_email_blacklist FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' (email_id, subscriber_id, email, reason, date_added, last_updated);

I got This error
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`dashboard01_zoikmail`.` mailapp_email_blacklist`, CONSTRAINT `fk_email_blacklist1` FOREIGN KEY (`subscriber_id`) REFERENCES `mailapp_l ist_subscriber` (`subscriber_id`) ON DELETE SET NULL ON UP)

How can i upload it directly to email blacklist table?? or any Command line Utility of call Import Command in CLI mode. or any best way to upload it in speedy manner..????

Does 'Queue Import' also Work in Importing to Email Blacklist..I find that it dont works!!

I recommend
if you can add this feature(Email-Blacklist Import via Command Line-queue-import) to next release!

My Support Pack is Expired.
We ll Upgrade our Support pack by this weekend as my Company Credit Card is Fully Exhausted and will be recharged by today evening or tomorrow morning.

For the subscriber_id column in your csv file, make sure that column is empty and it should work.
I tried many times still no success...
i have attached a file which is just a samle file with 2 records.
in my actual file i have 265K records


  • sample-db-import-blacklist.zip
    566 bytes · Views: 9
Even i tried with 2 records file Still have same error
FYI: My CSV file have no Commas(,), no semi commas(;) no inverted quotes(" ") as it creates a problem in CSV import..
i read it all wrong, never mind the last reply.
I think you have only two options:
1) Split the big file into multiple smaller files and upload one by one.
2) Create a separate database table using myisam engine, with the same columns as email_blacklist table, then import in that table directly. After the import is done, using phpmyadmin, copy the records from the table into the email_blacklist table.
recently imported a larger BL
with this file's structure
via backend and cron import
all went well
(just delete the .txt to get a csv file)
you can fix your other format with any good txt editor and it should work fine


  • sample-blacklist-wrx.csv.txt
    411 bytes · Views: 25
Last edited: