简体   繁体   English

无法从我的网络服务器连接到MySQL服务器,在我的个人盒子上使用完全相同的文件可以正常工作

[英]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.

相关问题 cURL无法在免费主机中连接,但在我的本地主机上可以正常工作 - cURL can't connect in a free host but works fine in my localhost 无法从PHP连接到服务器MySQL Server,但可以在phpmyadmin中使用 - Can't connect to the server MySQL Server from PHP, but it works in phpmyadmin 我尝试将 MQTTS 连接到我的 HTTPS 服务器,但没有成功。 它在 MQTTX 上运行良好,但在 PHP 上无法连接 - I tried to connect MQTTS with my HTTPS server but it didn't work. It works fine on MQTTX but with PHP it doesn't connect PHP $ _SESSION可以在WAMP上运行,但不能在服务器上使用完全相同的代码,为什么? - PHP $_SESSION works on WAMP but not on my Server with exact same code, why? 无法将我的Android Studio与在线服务器MySQL数据库连接 - Can't connect my android studio with MySQL database, the online server PHP页面无法在Bluemix上运行,但是在我的本地Web服务器上可以正常工作 - PHP page not working on Bluemix, but works fine on my local webserver 无法将MySQL表连接到我的PHP文件 - Can't connect MySQL table to my PHP file 无法使用我最近在MySQL中添加的用户连接到数据库 - Can't connect to database using my recently added user in MySQL 如果从ajax脚本访问zip文件,为什么不能在我的php模型中下载zip文件。 从PHP链接正常工作 - Why can't I download zip-file in my php model if acces it from ajax script. Works fine from php link 无法连接到我的棘轮/ WebSocket服务器 - Can't connect to my Ratchet / WebSocket Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM