Jump to content

Problem In Connecting With Mysql Data Base


Talent87

Recommended Posts

Hi, can any one help me with this , I have used this code to connect to mysql data base but it gives me the error message that I put it down the code, I have no named the login and password to MySQL data base the version of wampserver that I have installed is 2.0 thanks<?php$con = mysql_connect("localhost","","");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);?>-------------------------------------------------------------------Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\CreateDB.php on line 3Could not connect: Access denied for user 'root'@'localhost' (using password: YES)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...