when you connect from a PHP-script (phpadmin or your own script) you connect from 'localhost' if the webserver/PHP subsystem is running on the same host as MySQL.
Most likely you will need to allow connection from 'remote hosts' in MySQL configuration.