niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » PHP
mysql_connect()
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
Author Message
Pankaj
*nix forums beginner


Joined: 11 May 2005
Posts: 18

PostPosted: Thu Jul 20, 2006 12:28 pm    Post subject: mysql_connect() Reply with quote

am trying to connect to a database. When I use the following syntax,
the connections works

$server=localhost
$username=myusername;
$password=mypassword

mysql_connect($server,$username,$password);

However, if I change the $server="server_ip", I get an error
"Access Denied for user user_name@" (using password:YES)

What could be wrong ? Is it some permission issue ?
Back to top
Laurent Duretz
*nix forums beginner


Joined: 20 Jul 2006
Posts: 2

PostPosted: Thu Jul 20, 2006 12:44 pm    Post subject: Re: mysql_connect() Reply with quote

Pankaj a écrit :
Quote:
am trying to connect to a database. When I use the following syntax,
the connections works

$server=localhost
$username=myusername;
$password=mypassword

mysql_connect($server,$username,$password);

However, if I change the $server="server_ip", I get an error
"Access Denied for user user_name@" (using password:YES)

What could be wrong ? Is it some permission issue ?


If you are using tour ISP IP, it could be wrong.
Try 127.0.0.1
Back to top
JDS
*nix forums Guru Wannabe


Joined: 01 Mar 2005
Posts: 226

PostPosted: Thu Jul 20, 2006 4:23 pm    Post subject: Re: mysql_connect() Reply with quote

On Thu, 20 Jul 2006 05:28:46 -0700, Pankaj wrote:

Quote:
am trying to connect to a database. When I use the following syntax,
the connections works

Please don't MULTIPOST!
--
JDS
Back to top
Dima Vidmich
*nix forums beginner


Joined: 21 Jul 2006
Posts: 1

PostPosted: Fri Jul 21, 2006 1:54 pm    Post subject: Re: mysql_connect() Reply with quote

Pankaj wrote:
Quote:
am trying to connect to a database. When I use the following syntax,
the connections works

$server=localhost
$username=myusername;
$password=mypassword

mysql_connect($server,$username,$password);

However, if I change the $server="server_ip", I get an error
"Access Denied for user user_name@" (using password:YES)

What could be wrong ? Is it some permission issue ?

Probably your mysql login was created with restrict on connection
address.
Try grant also username@server_ip as was granted username@localhost
or update your login entry in mysql.user with Host='%' to allow any
connection ip

WBR, Dima Vidmich
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
The time now is Sat Nov 22, 2008 9:22 pm | All times are GMT
navigation Forum index » Programming » PHP
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts mysql_connect problem WSteffen MySQL 2 Wed Jun 28, 2006 3:29 pm
No new posts PHP mysql_connect Jørn Dahl-Stamnes MySQL 5 Fri Jun 23, 2006 1:21 pm
No new posts mysql_connect problem ... dude PHP 8 Sun Jun 18, 2006 6:11 am
No new posts mysql_connect() losing connections from cmd line Jim Michaels PHP 3 Sun Mar 26, 2006 7:34 am
No new posts mysql_connect error avenpace@gmail.com PHP 7 Fri Mar 17, 2006 10:08 pm

ADHD Coach | Internet Advertising | Mobile Phone | Loans | Property Search
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3971s ][ Queries: 16 (0.2456s) ][ GZIP on - Debug on ]