I know this is probably a faq but it is hard to search for this exact
problem.
When I put this on a php page:
<?
$link = mysql_connect("localhost", "cardini", "password")
or die("Could not connect : " . mysql_error());
echo "Connected successfully\n";
mysql_select_db("articles") or die("Could not select database");
$sql = 'CREATE TABLE image( id mediumint( 8 ) unsigned NOT NULL
AUTO_INCREMENT ,'
. ' masterid mediumint( 8 ) unsigned NOT NULL default \'0\','
. ' filedata blob NOT NULL ,'
. ' PRIMARY KEY ( id ) ,'
. ' KEY master_idx( masterid ) ) TYPE = MYISAM ';
mysql_query($sql);
db(mysql_error());
?>
This is the result:
Connected successfully
[Access denied for user: 'cardini@%' to database 'articles']
How can it connect successfully to the database, yet with the same user
and password, fail to connect ?
or maybe a better question would be: How did 'localhost' get changed to
'@%' ?