I bought a dedicated server and installed MySQL
1. 3306 port is open
2. Remote administration in allowed

Now I wanna create a user to access a database in my server
I created a user like this
Code:
mysql> CREATE USER 'temp'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT SELECT PRIVILEGES ON mydb.* TO 'temp'@'localhost';
mysql> CREATE USER 'temp'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT SELECT PRIVILEGES ON mydb.* TO 'temp'@'%';
now how I am going to access the database remotely ? I wanna extract some
information using php

to connect I need details of the server ?
PHP Code:
$hostname = ;
$user 'temp';
$pass ='some_pass';
$db'mydb';

#connection code.... 
I am lil confused here that how my code will access the databse
without a proper host name ! I tried to give my dedicated server IP
but no use it din work !?

can any 1 advice me on how to configure ?