473,386 Members | 1,846 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

connection/permission problem

I have the following sitution...

MySQL version 3.23.47
PHP version 4.3.2
Redhat Linux version 7.1
Apache version 1.3.29

I have a MySQL user called 'user' that is set up with full rights for
localhost, 127.0.0.1, and the external IP address.

I can connect to the database using all three users from the command line...
../mysql --user=user --password=password --host=###.###.##.###
../mysql --user=user --password=password --host=127.0.0.1
../mysql --user=user --password=password --host=localhost

But in my php script running on the server, I can only connect using the
hostname localhost...
$DBConnection = mysql_connect("localhost","user","password");

the IP addresses don't work...
$DBConnection = mysql_connect("###.###.##.###","user","password");
$DBConnection = mysql_connect("127.0.0.1","user","password");

these give me the following error:
Warning: mysql_connect(): Can't connect to MySQL server on 'domain.com'
(111)

Is there anyone that's seen this and can point me in the right direction?

Thanks.
Jul 20 '05 #1
1 1420
I feel like quite the idiot... I specified the port # in the connection and
it works when using an IP address. Any insight into why localhost doesn't
need a port number, but an IP address does?

thanks.

"Bob Garbados" <bo*********@hotmail.com> wrote in message
news:10*************@corp.supernews.com...
I have the following sitution...

MySQL version 3.23.47
PHP version 4.3.2
Redhat Linux version 7.1
Apache version 1.3.29

I have a MySQL user called 'user' that is set up with full rights for
localhost, 127.0.0.1, and the external IP address.

I can connect to the database using all three users from the command line... ./mysql --user=user --password=password --host=###.###.##.###
./mysql --user=user --password=password --host=127.0.0.1
./mysql --user=user --password=password --host=localhost

But in my php script running on the server, I can only connect using the
hostname localhost...
$DBConnection = mysql_connect("localhost","user","password");

the IP addresses don't work...
$DBConnection = mysql_connect("###.###.##.###","user","password");
$DBConnection = mysql_connect("127.0.0.1","user","password");

these give me the following error:
Warning: mysql_connect(): Can't connect to MySQL server on 'domain.com'
(111)

Is there anyone that's seen this and can point me in the right direction?

Thanks.

Jul 20 '05 #2

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

Similar topics

5
by: SerGioGio | last post by:
Hello, I am going nuts. I am trying to connect to my local ORACLE instance using ODBC. It used to work few weeks ago, but it fails now. Connection with: - SQL*plus: connection works! -...
1
by: yma | last post by:
Hi, I tried to use a listbox to display a column in MS Access 2000 nwind.mdb by using ole DataAdapter, Connection and dataset controls. But I got "It is already opened exclusively by another...
6
by: RML | last post by:
Hi, I have an ASP.NET app which opens a MS Access database using the Het 4.0 OleDB provider. My development code abd database live on my D drive. Under .NET's Server Explorer I created a...
18
by: WStoreyII | last post by:
I am making a asp page that will run on my computer by iis. But the problem is the database in on a web server. I can not seem to get the connection to work for it though here his the connection...
5
by: Burton Roberts | last post by:
When using ASP.NET and an OleDBConnection control I get this error on CNN.Open: "The Microsoft Jet database engine cannot open the file 'C:\A2K\Backups\EdsBe2K.mdb'. It is already opened...
3
by: blue875 | last post by:
Ok, I've tried searching, and haven't found the answer, so it must mean everyone else but me already knows this. I have an Access 2000 form that I want to connect to an Access 2000 table in the...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
2
by: dc | last post by:
I have a baffling connection problem from my C# console app to a sql server express database. The console application opens the sql database using the following code:- vDataSource = "server =...
9
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.