Nvm i found how to do it

on creating any database user there is 3 feilds

User:
Password:
Host:

by putting the ip of server2 in Host this binds this user to this ip thus it cannot be accessed from any other ip than provided

an easy way to do this is by using mysqlcc (Mysql control center) if you are using Windows server

Thanks