Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6954919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:40:11+00:00 2026-05-27T14:40:11+00:00

When I run the following page on my local development environment I’m getting a

  • 0

When I run the following page on my local development environment I’m getting a timeout error on the TCP connection. I’ve inherited this site recently from another developer. I’ve pulled all the files on the server and dropped them into my /Users/mycomputer/Sites/testsite.com folder on my MacBook Pro running Lion.

The code I’m running (obviously I’ve sanitized the code for posting here):

<?php
mysql_connect("mysqldb", "usernamehere", "passwordhere") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("test") or die(mysql_error());
echo "Connected to Database";
?>

And the error:

Warning: mysql_connect() [function.mysql-connect]: [2002] Operation timed out (trying to connect via tcp://mysqldb:3306) in /Users/mycomputer/Sites/testsite.com/dbtest.php on line 2
Warning: mysql_connect() [function.mysql-connect]: Operation timed out in /Users/mycomputer/Sites/testsite.com/dbtest.php on line 2
Operation timed out

Any ideas on where I’ve gone wrong? I’m pretty unskilled in the PHP world so, forgive my ignorance. If this were ColdFusion I would suspect a datasource problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:40:12+00:00Added an answer on May 27, 2026 at 2:40 pm

    Firstly, you need to check whether your website allows external IPs to connect to the DB. If they do, you might have to add your current IP to the list of allowed IPs.

    Then, you need to connect to the DB using their external db address. If you do all that correctly, this should work. You error shows that it can’t connect to the DB.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to run the following jquery code on every page in my website.
When I run the following script, the event always fires on page load. I
Following a MSDN web page, I am trying to manually run mstest within my
I run the following codes separately as my prompt unsuccessfully in .zshrc. This suggests
I am getting following error when i am trying to connect Production DB from
I get the following error in Chrome every time I try to run my
I am getting the following exception when trying to run my jar through java
I'm trying to run the following code, written on my local machine: http://www.jsfiddle.net/WShdx/3/ Functionality-wise
I'm getting the following error when trying to use JQuery with the JqSOAPClient plugin:
The situation is following. I have a local (development) PHP server (Win + IIS)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.