Block trolls by cookie, not by IP

If your troll has a dynamic IP address, send him a cookie and check for it in all subsequent page requests, something along the following lines:

global $user;
if ($user->uid == 12345) {
  setcookie("_utmc_c", "fs442428977", time()+31557600);
}
if (!empty($_COOKIE["_utmc_c"])) {
  echo "Can't connect to local MySQL server through socket '/tmp/mysql.sock";
  exit();
}