Jump to content

Problem In Connecting With Mysql Data Base


Talent87
 Share

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)

Edited by talent87
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...