Page 1 of 1

simulation of sql server on wamp server

Posted: Sun Jan 11, 2009 1:20 am
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)

Re: simulation of sql server on wamp server

Posted: Sun Jan 11, 2009 2:00 am
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.

Re: simulation of sql server on wamp server

Posted: Fri Jan 16, 2009 7:27 am
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.

Re: simulation of sql server on wamp server

Posted: Wed Apr 01, 2009 4:52 am
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

Re: simulation of sql server on wamp server

Posted: Wed May 27, 2009 7:25 am
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 :)