Solved

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

Posted on 2003-12-09
11
361 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
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://…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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