awk '
BEGIN{
    PROCINFO["sorted_in"]="@val_num_asc"
}
$5 ~ /3306/ {  
    ip_set[$5]=1;
    a[$6]++;
    cnt++;
}
END{
    print "TOTAL_IP", length(ip_set);
    for(x in a){ print x, a[x] };
    print "TOTAL_LINK", cnt
}'