views:

49

answers:

1

I use a local Apache server for many things, but I never really had a use for MySql. I recently decided to keep a local copy of Wordpress, so I installed MySql.

I tried to install PHPMYADMIN, but every time I tried to log on I got a blank screen. I tried with good and bad credentials and even the CONFIG mode. I even did the same thing without using the install script. When I gave up on PHPMYADMIN, I just used the console to make the database, which worked fine. When I put in all the information for wordpress to automatically make the setup file, I also got a blank screen.

I never entered the information for wordpress manually because I created a php document that looked like the one below to test it (Thanks to W3 SCHOOLS http://www.w3schools.com/php/php_mysql_create.asp ) All information I do not want you to see has been replaced.

<?php
$con = mysql_connect("localhost","USERNAME","PASSWORD");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

if (mysql_query("CREATE DATABASE test_databse",$con))
  {
  echo "Database created";
  }
else
  {
  echo "Error creating database: " . mysql_error();
  }

mysql_close($con);
?>

I got the following error message.

Warning: mysql_connect(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 2
Warning: mysql_connect(): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 2
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 2

I checked to make sure MySql was running as a service (which it was)

A: 

You need to check your my.cnf

This settings should be there:

[mysqld]
port            = 3306
# Local access only
bind-address           = 127.0.0.1

And please check your Windows Firewall - or Personal Firewall if there is one.

And a good package to start with apache, php and mysql on Windows can be found here: http://www.apachefriends.org/en/xampp.html

Andreas Rehm
All I could find was my.ini, but it looked similar.port = 3306 was already there and bind-adress = 127.0.0.1 didn't helpP.S. I tried XAMPP before and I didn't like it so I just downloaded everything seperately.
Eric
Did you check your firwall settings?
Andreas Rehm