simulation of sql server on wamp server

Discussion of testing theory and practice, including methodologies (such as TDD, BDD, DDD, Agile, XP) and software - anything to do with testing goes here. (Formerly "The Testing Side of Development")

Moderator: General Moderators

Post Reply
finkel
Forum Newbie
Posts: 6
Joined: Sat Jan 10, 2009 2:57 am

simulation of sql server on wamp server

Post by finkel »

Hi , i have a a wamp server installed and want to try using the mysql functions .
i understood that i have to installed a sql server .
How do i do it ?
Does someone can give me a link to a good one .
And most importantly how does it work with the wamp server ??????


for the following code :

Code: Select all

 
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }if (mysql_query("CREATE DATABASE my_db",$con))
  {
  echo "Database created";
  }
else
  {
  echo "Error creating database: " . mysql_error();
  }mysql_close($con);
?>
 
i get the result:


Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'peter'@'localhost' (using password: YES) in c:\wamp\www\nisaion.php on line 2
Could not connect: Access denied for user 'peter'@'localhost' (using password: YES)
Last edited by Benjamin on Tue May 05, 2009 2:35 pm, edited 2 times in total.
Reason: Added [code=php]..[/code] tags.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: simulation of sql server on wamp server

Post by Chris Corbyn »

Hmmm... WAMP. Stands for Windows Apache MySQL PHP.

If you did install WAMP then you don't need to install anything else ;) I don't use WAMP so I'm not sure how you start the MySQL daemon running but there'll be an option to turn it on somewhere.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Re: simulation of sql server on wamp server

Post by Jenk »

mysql is running, you just haven't created an account for peter@localhost with whatever password it is you are trying to use.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Re: simulation of sql server on wamp server

Post by josh »

phpmyadmin shoudl come bundled, navigate to localhost, click the phpmyadmin link, login with root and a blank password, setup your tables, users and permissions
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: simulation of sql server on wamp server

Post by mikemike »

finkel,

Like everyone else has said MySQL (an SQL server) is already installed and running. You can connect to it with the 'root' username if I recall correctly:

Code: Select all

$link = mysql_connect('localhost', 'root', '');
It's been a long time since I used WAMP myself though and I'm doing this from memory so probably worth double-checking the online documentation. Oh and make sure there's no sensitive data on there and you're not sharing the web server with the Internet or you may leave yourself wide open :)
Post Reply