Solved

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

Posted on 2003-12-09
11
364 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 

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
 

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

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xampp tool 12 60
Optimize the query 5 54
show child records separated by commas 12 36
Error in sql query statment. 21 51
Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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