I've got a database running on the server which my desktop program updates. My program is designed in C# and that i can connect all right while using Mysql Connector.

private void Initialize()
    {
        server = "xxx.com";
        database = "test01";
        uid = "user";
        password = "pass";
        string connectionString;
        connectionString = "SERVER=" + server + ";" + "DATABASE=" +
        database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";

        connection = new MySqlConnection(connectionString);
    }

I wish to have the ability to retrieve some data from the database having a PHP script on my small website, however i can't get a simple connection to utilize my database, with similar connection information. I'm not so acquainted with php, and I am wishing that I am just creating a stupid mistake :)

$con = mysql_connect("xxx.com","user","pass");
if (!$con)
{
  die('Could not connect: ' . mysql_error());
}

This just keeps dying... Could someone let me know that i'm doing something stupid and let me know how you can repair it?

Thanks ahead of time, LordJesus

EDIT: The mistake I keep getting is: Couldn't connect: Lost link with MySQL server at 'reading initial communication packet', system error: 110

EDIT #2: My 'user' already continues to be granted access on '%' that ought to cover all IP's. After I run phpinfo() I recieve lots of info together with a section known as mysql with info there.

SOLVED... OR Conflicting? OK, I believe I understand why it fails. This site is located at one.com, and talking and among their supporters I found that they don't allow connections to remote databases, just the one on my small domain. Which isn't things i want. And So I did not solve it, however i discovered why I acquired that error. Now I want to find away out to operate around that...

It may sound in my experience much like your atmosphere is the following: Your desktop having a C# program, your MySQL server situated on another machine and lastly and web server that's autonomous and never mounted on either of individuals systems. If this sounds like the situation, you have to grant permissions for your database on the internet server.

The next will grant choose permission for your webserver.

GRANT SELECT ON test01.* TO 'user'@'ip.of.the.webserver' IDENTIFIED BY 'pass';