Unable to access MySql data table on local host

I am attempting to port an established web site with mysql backend to an intranet site.  To date I have established the database and web site, with tables and data, on a stand-alone Windows 7/Wamp setup.


      Internet:      MySQL 5.0, PHP 5, Apache on Linux Server

      Intranet:      MySQL 5.0.7, PHP 5.3.5, Apache 2.2.17, on Windows 7 (WampServer)

The intranet web site functions correctly.  I can access the database from phpmyadmin however, when I attempt to use the intranet form (php/html) to access the database I am getting the following errors:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'dbo386913170'@'localhost' (using password: YES) in C:\wamp\www\cfus_c712911\tik_cfus11.php on line 4

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in C:\wamp\www\cfus_c712911\tik_cfus11.php on line 5

The offending code is:

      1.  <?php
      2.  include("eCFUVars.inc");
      4.  $con = mysql_connect($host, $user,$passwd);
      5.  mysql_select_db($database, $con) or die ("Couldn't select database.");
      9. $result = mysql_query("SELECT * FROM c712911 ORDER BY Patrol ASC LIMIT
      11. ?>

The "include.inc" code is:

      1. <?php
      2. $host = "localhost";
      3. $user = "dbo386913170";
      4. $passwd = "xxxxxxx";
      5. $database = "db386913170";
      6. ?>

I am no expert nor am I a regular user of WampServer.  I know that I am missing the obvious, but I could use some assistance in resolving this issue.
Who is Participating?
dibrandtConnect With a Mentor Author Commented:
After many hours of searching through forums I found a workaround for this problem.

Assign access to all databases (there are nine involved) via “root” with no password.  This required changing a good number of html/php pages, but the localhost can now use the database.
Kim WalkerWeb Programmer/TechnicianCommented:
What is the URL of your intranet form? Are you using an intranet IP address to access the form on the WAMP server or an intranet computer name?
dibrandtAuthor Commented:
Intranet form is accessed via browser pojnted at  This opens the web site on the "localhost", and you drill down to the desired form.
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

Kim WalkerWeb Programmer/TechnicianCommented:
"localhost" is your local computer, not the server. If the website is opened on the "localhost" is it not opened on unless is the IP of the local computer.
dibrandtAuthor Commented:
As I said, I am a limited user of WampServer, and the semantics can be confusing.

WampServer is installed on a PC,, and WampServer documentation refers to this as “localhost.”

My understanding is that a request for a table must be pointed to the location of that table.  As the request is originating from the web site located on the PC at, my “assumption” was that it was the same as “localhost” (the database and the form requesting the table reside on the same PC.

Could you provide the correct terminology to use when describing the WampServer so that I will have it right in future discussions?
Kim WalkerWeb Programmer/TechnicianCommented:
That sounds correct. You are actually opening the website on The website would then be making a mysql request on localhost. If your browser address bar begins with "" you should be OK. That should work. I'll have to let someone more familiar with wamp on Windows continue from here.
dibrandtAuthor Commented:
The solution was arrived at before an of the experts attempted to address the issue.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.