How do I fix my MySQL server

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.

Read More

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 FilesApache Software FoundationApache2.2htdocstest.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 FilesApache Software FoundationApache2.2htdocstest.php on line 2
Fatal error: Maximum execution time of 30 seconds exceeded in C:Program FilesApache Software FoundationApache2.2htdocstest.php on line 2

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

Related posts

Leave a Reply

2 comments

  1. Open notepad with administrative privileges by

    clicking Start > All Programs > Accessories

    Right click Notepad and select Run as administrator

    In notepad open your hosts file, which should be located in c:WindowsSystem32driversetchosts or somewhere similar
    You may need to change the file types from Text Documents (.txt) to All Files (.*) in the Open window in notepad Comment out the line

    127.0.0.1 localhost