unhex(@network_start)а
SELECT CONV(@network_start, 16, 10), тогда после можно будет использовать inet_aton вместо inet6_aton. При чем тут VARBINARY(4) так и не понял, network_start при этом делаем bigint.
load data infile '/var/lib/mysql-files/GeoIP2-City-Blocks-IPv4-Hex.csv'
into table geoip2_network
fields terminated by ',' enclosed by '"' lines terminated by '\n' ignore 1 rows
(@network_start, @network_end, @geoname_id, @registered_country_geoname_id, @represented_country_geoname_id,
@is_anonymous_proxy, @is_satellite_provider, @postal_code, @latitude, @longitude, @accuracy_radius)
set network_start = unhex(@network_start),
network_end = unhex(@network_end),
geoname_id = nullif(@geoname_id, ''),
registered_country_geoname_id = nullif(@registered_country_geoname_id, ''),
represented_country_geoname_id = nullif(@represented_country_geoname_id, ''),
is_anonymous_proxy = nullif(@is_anonymous_proxy, ''),
is_satellite_provider = nullif(@is_satellite_provider, ''),
postal_code = nullif(@postal_code, ''),
latitude = nullif(@latitude, ''),
longitude = nullif(@longitude, ''),
accuracy_radius = nullif(@accuracy_radius, '');
select * from geolite2_network where inet_aton('146.243.121.22') between network_start and network_end limit 1
invalid URL prefix in "/Lw4goXlONftFoeN4iVmhptP4owbSJnA8mNslXg/V_mJ82Ytwbo.jpg"
location: /Lw4goXlONftFoeN4iVmhptP4owbSJnA8mNslXg/V_mJ82Ytwbo.jpg
$fp = fopen("/path/to/lock/file", "w+");
if (flock($fp, LOCK_EX | LOCK_NB)) { // do an exclusive lock
// do the work
flock($fp, LOCK_UN); // release the lock
} else {
echo "Couldn't get the lock!";
}
fclose($fp);