Dear all,
me new to PHP/ MySql.
I have the following code:
<?php
$con = mysql_connect("localhost","my_db","") or die('Could not connect: ' . mysql_error());
/*
// create Database
$qResult = mysql_query("CREATE DATABASE my_db",$con) or die('Database created...... '.mysql_error());
// echo "Database created";
*/
// Create table
mysql_select_db("my_db", $con) or die ("MySQL crapped out with:".MySQLErrNo()." ~ ".MySQLError);
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";
// Execute query
$qResult = mysql_query($sql,$con) or die ("Failed to create table: ".MySQLErrNo()." ~ ".MySQLError);
mysql_close($con);
?>
it gives the following error:
Could not connect: Access denied for user 'my_db'@'localhost' (using password: NO)
How to know the password of my database?
What willl be the default password for root?
Regards:
Muhammad Nadeem