473,568 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please Help! Can't connect to remote MySQL server using PHP

Hello,

I am trying to connect to a remote mysql server through php. Here's the
code:

mysql_connect(" my.hostname.edu ", "username", "password") or die
(mysql_error()) ;
mysql_select_db ("db_name") or die ("unable to select
db".mysql_error ());
$r1 = mysql_query('SE LECT * FROM table') ;

Using the mysql prompt on the remote server, the mysql -h -u -p works
just fine with the parameters i've specified here. According to the
user table I have the proper permissions. I just can't figure out what
could be preventing the connection here, although I am no expert...can
anyone help?!

BTW, I am using PHP 4.4.1 and mysql 5.0.

Thanks in advance...

May 23 '06 #1
4 2663
Carved in mystic runes upon the very living rock, the last words of
<co************ @gmail.com> of comp.lang.php make plain:
I am trying to connect to a remote mysql server through php.

Using the mysql prompt on the remote server, the mysql -h -u -p works
just fine with the parameters i've specified here. According to the
user table I have the proper permissions.


1) What does mysql_error() say?

2) Is your database configured to allow remote connections?

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 23 '06 #2
Hi,

My error (actually a warning):
Warning: mysql_connect() : Lost connection to MySQL server during query
in /cm/sums/data.php on line 23
Lost connection to MySQL server during query

I'm not sure if it is configured to allow remote connections...w here
would I look to find out?

Thanks :-)

May 24 '06 #3
Carved in mystic runes upon the very living rock, the last words of
<co************ @gmail.com> of comp.lang.php make plain:
My error (actually a warning):
Warning: mysql_connect() : Lost connection to MySQL server during query
in /cm/sums/data.php on line 23
Lost connection to MySQL server during query
That's weird. I've seen connections time out when I'm in the mysql
monitor, but not a script connection.
I'm not sure if it is configured to allow remote connections...w here
would I look to find out?


I'm afraid I don't know. MySQL administration is voodoo to me. I just
know such a setting exists.

You might be better off asking in a MySQL group.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
May 24 '06 #4
Voodoo...quite an accurate comparison, hehe.
Thanks anyway, have a great day!

May 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
2133
by: TrvlOrm | last post by:
OK. After much playing around, I managed to get my frame page this far.. see code below. BUT...there are still errors with it, and what I would like to have happened is this: 1) On the Left Frame (File LeftEx8_2.html) a series of buttons, which when clicked prompt the user to enter information for background color, text color, link...
1
1632
by: funfair | last post by:
HI,EVERY ONE first problem, i have create a database in access 2003 it worked fine untill i have format my laptop . now im working on office 2003 on windows xp and i have norton 2006 but im facing a problem in opening some forms from command button a message appear the openform action was canceled and when i open them from the database...
1
1334
by: KitKat | last post by:
With the help of kind, brilliant folks, I have been working on this program that uses a combo box selection to display six different jpgs. The jps are a time stamp, and the files are located in six different folders of camera views. HOWEVER, some of these folders do not have that certain timed jpg. So...I need to figure out how to show all the...
17
9978
by: cpptutor2000 | last post by:
Could some C guru please help me? I have a simple piece of code as: #include <stdio.h> #include <stdlib.h> #include <openssl/rand.h> int main(){ unsigned char temp; RAND_bytes(temp, 4);
5
1723
by: sandyw | last post by:
I need help in two areas: Both are at the bottom of my program where a client has two choice to make, 1. When the client enter "Y" it takes him to the begin of the program. I would like to know what this is done ie maybe at the part where it ask you do you want to enter a new product. 2. If the client enters the wrong value or then "Y" or "N"...
14
1445
by: helpfulmaid | last post by:
Hello, I want a function that when it detects the left mouse button is pressed down, will generate and cycle 5 random number/letter combinations as fast as it can in a printed space. If I let off the mouse button then it should stop, and it can re-start again when pressed, etc..... can someone help help? :-)
62
2676
by: vubaboota | last post by:
I HAVE SOME SERIOUS PROBLEM , HOW TO MAKE A PROGRAM IN C Q1: Write a program using malloc function. In which you take input from user and allocate memory equal to square of this number. Which multiply numbers and draw a table in the following format? Hint: User enters 3 then program allocates equal to 9 integer memories. Output:1
4
1822
by: cpptutor2000 | last post by:
Could someone please help me? I have the following C struct. typedef struct _FIREWALL_RULE_INFO { ULONG Precedence; BOOL bEnabled; BOOL bLoggingEnabled; BOOL bAllowFragments; BOOL bAllowInbound; /*...
3
1605
by: zabaladesign | last post by:
hello guys.. please help me i made a program for my thesis and i need a textbox which will only accept telephone number like this format (954)-854-2452 .. please... please help me guys i really dont know what the code is.. thank you thank you in advance..
0
7693
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7665
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.