Connect to an online MySQL database from localhost

后端 未结 5 2019
旧时难觅i
旧时难觅i 2021-01-19 02:06

I am trying to connect to my MySQL database on my online server via PHP on my localhost.

$con = mysql_connect(\"$hostname\", \"$username\", \"$password\");
i         


        
5条回答
  •  无人共我
    2021-01-19 02:43

    As the others say you need to allow that particular host (in this case your IP) to connect. This is in your user table in the mysql database. If you don't have access to this database (or don't have grant privileges) then you can't change this.

提交回复
热议问题