[英]Can't connect to MySQL server from my webserver, works fine using the exact same file on my personal box
I have a godaddy server where I need site users to be able to enter in tracking numbers to see if we have it in the system. 我有一个Godaddy服务器,我需要站点用户能够输入跟踪号码以查看我们是否在系统中拥有它。 I coded it in php/pdo, and it works just fine hosted on my personal machine no matter where it is located (local or remote).
我用php / pdo编码,无论位于何处(本地或远程),它都可以很好地托管在我的个人计算机上。 I upload the exact same php file to the godaddy server, and all I get is a timeout and a mysql error saying that it can't connect.
我将完全相同的php文件上传到godaddy服务器,而我得到的只是一个超时和一个mysql错误,提示它无法连接。
change your connection string ip address to localhost . 将您的连接字符串IP地址更改为localhost。 It means your get infomation from the hosting server with this password and username.
这意味着您使用此密码和用户名从托管服务器获取信息。 The username and password and database is your own ofcourse.
用户名,密码和数据库是您自己的课程。 1 Question what program are you using to upload the file to the hosting server?
1问题您使用什么程序将文件上传到托管服务器?
$con=mysqli_connect("localhost","user","pass","my_db") or die(mysql_error());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.