Solved

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

Posted on 2003-12-09
11
359 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Creating and Managing Databases with phpMyAdmin in cPanel.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

19 Experts available now in Live!

Get 1:1 Help Now