Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 423
  • Last Modified:

PHP/MySQL 5.1 Server Connection problem

Hello.  I'm running WAMP, MySQL & Apache Server services are started.  I created a folder on the desktop to place the ".AMP" installation information.  I created a MySQL user with the appropriate permissions.  However, when I run the mysql_connect("localhost", "user", "password") or die( "foo" ), I get the server connection error.  

What am I missing?

Thanks,

Cameron.
0
VDOGamer
Asked:
VDOGamer
  • 6
  • 5
1 Solution
 
Dave BaldwinFixer of ProblemsCommented:
Details needed because it is probably a detail that is causing the issue.  What OS are you running?  Do you have IIS running?  Is it a 64-bit machine?  64-bit machines sometimes define 'localhost' as '::1' which is the IPV6 version.  MySQL wants to see '127.0.0.1' which is the IPV4 version.
0
 
VDOGamerAuthor Commented:
Sorry about that.  I'm running win7 64 and I do have IIS 6 running.  I stopped IIS 6, but the problem is the same.
0
 
Dave BaldwinFixer of ProblemsCommented:
You may have to un-install IIS to get WAMP's Apache to work on port 80.  Or put Apache on another port like 8080.  Try using mysql_connect("127.0.0.1", "user", "password") .  You can look in Task Manager to see if 'mysqld', the MySQL daemon, is running.  If not, go to the WAMP control Icon in the task bar and start it.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
VDOGamerAuthor Commented:
Okay.  IIS was uninstalled and I used the mysql_connect("127.0.0.1:8080", "user", "password")
mysqld is running.
...now something is running.......forever
0
 
VDOGamerAuthor Commented:
I didn't use the WAMP installation package.  I installed Apache, MySQL, PHP, then phpMyAdmin.
0
 
Dave BaldwinFixer of ProblemsCommented:
I would have recommended the WAMP or XAMPP packages because they do all the set up for you.  Installing them separately means that you have to do the set up that is required.  If you decide to go back and use WAMP or XAMPP, you will need to completely uninstall Apache, MySQL, and PHP so there won't be any conflicts.
0
 
VDOGamerAuthor Commented:
Okay.  Do I have to enable Apache, MySQL, and PHP access through the firewall?
0
 
Dave BaldwinFixer of ProblemsCommented:
You will if you want to access them remotely or by the machine's IP address.  Is phpMyAdmin currently working on your machine?
0
 
VDOGamerAuthor Commented:
Yes it is.
0
 
Dave BaldwinFixer of ProblemsCommented:
Then PHP and Apache are working.  I don't know why your connection 'runs forever'.  Except that... MySQL is on port 3306.

mysql_connect("127.0.0.1:3306", "user", "password")
0
 
VDOGamerAuthor Commented:
Switching to the WAMP installation package now.
0
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.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 6
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now