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 7988099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:20:15+00:00 2026-06-04T12:20:15+00:00

So i keep getting this error when trying to connect to my database remotely.

  • 0

So i keep getting this error when trying to connect to my database remotely. The strange thing is it works for like 1/2 query(s) a minute but then after those query’s it stops working and gives this error message. This just started happening randomly, before it used to work fine for many querys per second.

Details:

  • Im using xampp to host my database
  • The details to connect to the database are correct

Any ideas what might be happening?

Example of code (This is the code which I using to test the connection):

                $connection = mysql_connect('IP', 'DATABASE PASSWORD', 'PASSWORD', 'DATABSE NAME') or die(mysql_error());
                if (!$connection) 
                    die('Not connected : ' . mysql_error());

                $db_selected = mysql_select_db('DATABSE NAME', $connection);
                if (!$db_selected)
                    die ('Can\'t use : ' . mysql_error());

                $string = mysql_query("SELECT * FROM `characters` WHERE `name` LIKE 'gil'") or die(mysql_error());
                if($result = mysql_fetch_assoc($string))
                    echo $result['name'];

Full Error code:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'IP' (4) in /vhosts/DOMAIN/httpdocs/test.php on line 1
Can't connect to MySQL server on 'IP' (4)
  • 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-06-04T12:20:16+00:00Added an answer on June 4, 2026 at 12:20 pm

    You are specifying wrong parameters to mysql_connect:

    mysql_connect('IP', 'DATABASE PASSWORD', 'PASSWORD', 'DATABSE NAME')
    

    Should be:

    mysql_connect('server address', 'user name', 'password')
    

    See the docs for more info.

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

Sidebar

Related Questions

I'm trying to connect to SSIS through SSMS but i keep getting this error:
Keep getting this error after inserting a subdatasheet into a query and trying to
Im trying to use Date Formatters (NSDateFormatter), but I keep getting this error: Program
Trying to install pear package and keep getting this strange error. Can you shed
I am trying to use Selenium RC but i keep getting this error whenever
I'm trying to use slime from CVS (2009-01-05) but keep getting this error: LOAD:
Hi i'm trying to run Nant but keep getting this error when i tried
I'm trying to send SMTP e-mails using PHPMailer, but I keep getting this error
I'm trying to run a PHP script, but I keep getting this error whenever
I keep getting this error while trying to modify some tables. Here's my code:

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.