I need to load a text file of IP addresses into a MySQL table.
The IP addresses are stored as datatype INT(4) in the table as that is how I created the table. The IP addresses in the text file are in regular IP address format (8.8.8.8). Below is the syntax that I've tried for Loading the data into my table but it throws this error:
Data truncated for column 'ip_address' at row 1
I'm not exactly sure what Data truncated means or why it's throwing this error. For reference I have two Columns in my table: Id, ip_address. Also my txt file of IP addreses is just a list of ip's on a new line. There's like 15,000 lines in that file so I'd really like to get this working.
LOAD DATA INFILE '/var/lib/mysql-files/default.blacklist'
INTO TABLE blacklist
(ip_address)
SET ip_address = INET_ATON(ip_address);