problems installing mysql and phpmyadmin to localhost
Posted
by Joel
on Server Fault
See other posts from Server Fault
or by Joel
Published on 2010-05-17T05:20:07Z
Indexed on
2010/05/17
5:30 UTC
Read the original article
Hit count: 291
Hi guys, I know there have been many similar questions, but as far as I can tell, most of the other people have gotten further than I have...
I'm trying to get a WAMP setup happening.
I've got PHP and Apache running and talking to each other. PHP is in c:\PHP Apache is in it's default program files folder. mySQL is in it's default install location. I have localhost setup at D:\public_html\
I'm able to navigate to localhost and see html and php files.
But I have a simple mySQL test file:
<?php
// hostname or ip of server (for local testing, localhost should work)
$dbServer='localhost';
// username and password to log onto db server
$dbUser='root';
$dbPass='';
// name of database
$dbName='test';
$link = mysql_connect("$dbServer", "$dbUser", "$dbPass") or die("Could not connect");
print "Connected successfully<br>";
mysql_select_db("$dbName") or die("Could not select database");
print "Database selected successfully<br>";
// close connection
mysql_close($link);
?>
When I try and open this, I get "could not connect"
Now, I haven't even created a database yet, because I can't log into mySQL with phpmyadmin-so I think I've done something wrong in my mySQL install because they aren't talking to each other.
I guess my main question is how do I first create a database in mySQL to be sure I have even installed it correctly?
© Server Fault or respective owner