How to allow remote connections to mysql from specific IPs only? I have a fresh install of mysql server 5.2.6 on a 64 bit Ubuntu running on a remote server with static IP. Is there anyway to allow Mysql remote connections to be made from pre-approved IPs only? 
I am looking for simple and elegant way to do this without doing too much OS related admin and just handle it with mysql.
You can use hostname in grant statements as well, as you are using shared ip then you can limit it with hostname specific grant such as below

grant all on db.* to 'user'@'hostname' identified by 'password';


To allow from all IP's/hosts

grant all on db.* to 'user'@'%' identified by 'password';


For localhost only

grant all on db.* to 'user'@'localhost' identified by 'password';