Solved

mySQL, PHP, Apache running on XP - Can't access mySQL Remotely

Posted on 2003-12-09
11
360 Views
Last Modified: 2008-03-17
Hi There,

Thanks for stopping by and looking at my problem. I currently run a windows XP box, with Apache, PHP and MySQL. I use this as an intranet in my school and everythign is working fine within the network. However the problem arises when anyone tries to log in from home. We use a program called EasyLink, basically you have to log in to easylink first and then from their you can choose to view your 'My Work' folder or the Intranet. The kids need to view the Intranet from home to get updates on work, download materials etc. Anyway, when anyone tries to access the Intranet remotely the following errors appear:-

'Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in \\intranet-server\intranet\includes\top.inc'.

The conncet code is -

$db - mysql_connect("localhost", "root");
mysql_select_db("test",$db);

I have checked the permissions within mySQL and the user (%) should have access without any problems.

If anyone can help I would greatly appreciate it as my boss is breathing down my neck to get this sorted by the end of term (17th December). If you need me to post any more code or answer any question please ask away.

Thanks in advance for your help on this,
Paul Doherty
0
Comment
Question by:doconline
11 Comments
 
LVL 17

Expert Comment

by:Squeebee
ID: 9903891
Ok, some things to check:

Is the server running?
Does the user have the appropriate GRANT permissions?
Are you specifying the correct password?
Have you removed anonymous users from your GRANT tables?
0
 

Author Comment

by:doconline
ID: 9904068
Hi,

Thanks for responding.

The server is running (the system works fine on the local network).
I have set up the account (%) (I think this is all users?) to have the same permissions as administrator for now (I'll get it working before worrying about this).
There is no password for the account.
When you say have I removed anonymous users, is this as point 2 the % user? If so I haven't removed it.

I am using phpmyadmin to admin the mySQL. There is a table 'user' which looks like:-

host       ¦ user ¦ password
localhost¦ root  ¦
%         ¦ root  ¦
localhost¦   %  ¦
%          ¦   %  ¦

All passwords are blank (like I said I'll worry abuot security once it is working properly).

I hope this helps.
0
 
LVL 17

Expert Comment

by:Squeebee
ID: 9904161
I would say you should kill the wildcard users, set a root password, and create a web client user with a password. MySQL password combinations, while predictable, can interact in unexpected ways when you have wildcard users. And a wildcard user is a blank, not a %, you would want to login as user % for that entry.
0
 

Author Comment

by:doconline
ID: 9904346
OK, I have removed the (%) user and now have a mysql.user table as follows

host       ¦ user ¦ password
localhost¦ root  ¦ etc
%         ¦ root  ¦ etc
localhost¦   %  ¦ pass
%          ¦   %  ¦ pass

I am still getting the same error as before though. This is sending me square eyed :s
0
 
LVL 17

Expert Comment

by:Squeebee
ID: 9909532
I still see two % users. What are the users connecting through? A web interface?
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 

Author Comment

by:doconline
ID: 9910627
Sorry my mistake, I meant:-

host       ¦ user ¦ password
localhost¦ root  ¦ etc
%         ¦ root  ¦ etc
localhost¦ webclient  ¦ pass
%          ¦ webclient ¦ pass

The users do come through a web interface I think. We run a program called Easylink. Users log in here first and then through Easylink to the Intranet (they can also access there own share of the network server to access their mywork folder using this program.)
0
 
LVL 17

Expert Comment

by:Squeebee
ID: 9912047
If they connect through a web interface then it really should not matter where they are connecting from, since the client connection to mysql will always be from the web server. I would check again that top.inc is specifying the right username and password.
0
 
LVL 2

Expert Comment

by:holdenweb
ID: 9918348
You might also want to consider that your systems might not be correctly mapping the "localhost" address. Sometimes if you enter user root with a blank host, or with host 127.0.0.1, things suddenly start to work.

See http://forums.devshed.com/t98804/s762f3d2d1b82652a18cd72841415ae1a.html, or better still Google for "MySQL root localhost" and take your pick. There are known pitfalls, which I fell down so long ago I no longer command the details, so Google is your friend. Good luck :-)
0
 

Author Comment

by:doconline
ID: 9955677
Hi,

Thanks for your help on this one. In the end I have had to duplicate the Intranet on the IIS box which Easylink sits on, and run a script to copy over changed database tables and code everyday.

Thanks,
Paul
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12694492
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (http://dev.mysql.com/doc/refm…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now