hi all,
assume my
web-site is http://www.my.com
ip address is 33.22.111.444
I created a database my_main and add an user my_user0 with password my_pswd0 to the database.
mysql_connect() function failed in php code bellow,
could u tell me why?
Thanks
php code
------------------------------------
$iphost="33.22.111.444";
$wbhost='http://www.my.com';
$dbuser='my_user0';
$psuser='my_pswd0';
//not working for both $wbhost and $iphost
$connection = mysql_connect($wbhost,$dbuser,$psuser);
if (!$connection)
{
echo(mysql_error()."\n");
die('Could not connect:');
}
else
{
echo("good!!!!!!\n");
}
a stupid question about mysql database
Moderator: General Moderators
-
php12342005
- Forum Commoner
- Posts: 79
- Joined: Mon Mar 21, 2005 3:35 am
Code: Select all
$iphost="33.22.111.444";
$wbhost='http://www.my.com';
$dbuser='my_user0';
$psuser='my_pswd0';
//not working for both $wbhost and $iphost
$connection = mysql_connect($wbhost,$dbuser,$psuser);
if (!$connection)
{
echo(mysql_error()."\n");
die('Could not connect:');
}
else
{
echo("good!!!!!!\n");
}-
php12342005
- Forum Commoner
- Posts: 79
- Joined: Mon Mar 21, 2005 3:35 am
here is error code (by $iphost:
Warning: mysql_connect(): Access denied for user: 'my.com@venus.addaction.net' (Using password: YES) in /home/my/public_html/php/php00/test00.php on line 10
Access denied for user: 'my.com@venus.addaction.net' (Using password: YES)
Warning: mysql_connect(): Access denied for user: 'my.com@venus.addaction.net' (Using password: YES) in /home/my/public_html/php/php00/test00.php on line 10
Access denied for user: 'my.com@venus.addaction.net' (Using password: YES)
your account 'my.com@venus.addaction.net' has no access to the database...
http://dev.mysql.com/doc/mysql/en/privilege-system.html
http://dev.mysql.com/doc/mysql/en/grant.html
http://dev.mysql.com/doc/mysql/en/privilege-system.html
http://dev.mysql.com/doc/mysql/en/grant.html
Code: Select all
GRANT ALL ON mymain.* TO 'my.com'@'venus.addaction.net'Try different user name
It seems that you have no access in your database with that user name. Supply a valid user name with valid password and see the magic 
-
php12342005
- Forum Commoner
- Posts: 79
- Joined: Mon Mar 21, 2005 3:35 am
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US