Error is Error creating database: Access denied for user ''@'localhost' to database 'my_db'
Code is
{
<?php
$link=mysql_connect ("localhost", "cpuser_dbuser", "password") or die
('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("cpuser_db");
$sql = 'CREATE DATABASE my_db'; if (mysql_query($sql, $link)) {
echo "Database my_db created successfully\n"; } else {
echo 'Error creating database: ' . mysql_error() . "\n"; } ?> }
I have replaced all the credentials here.
Please help me solving this error.