Problem with PHP and MySQL, mysql_connect fails.

This is a discussion on Problem with PHP and MySQL, mysql_connect fails. within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello! I have just installed Apache V2.0.52 with PHP V4.3.4 and MySQL V4.1.5 in ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-25-2004
Jon Lennryd
 
Posts: n/a
Default Problem with PHP and MySQL, mysql_connect fails.

Hello!

I have just installed Apache V2.0.52 with
PHP V4.3.4 and MySQL V4.1.5 in windows xp,
with service pack 2 installed.

Apache and PHP works fine together, and MySQL
works on it's own, I can create databases etc.
via dos.


Well, this is the php-code that does not work:

$ServerAdress = "194.47.214.66:3306";
$User = "JonLennryd";
$PassWord = "*******";
$DataBaseName = "mindb";

$conn=@mysql_connect($ServerAdress,$User,$PassWord )
or die (mysql_error());


The error that follows:

Access denied for user 'JonLennryd'@'194.47.214.66' (using password: YES)



The account JonLennryd exists, and the root account also exists.
A friend said that this was a problem caused by php v4.x, he had
installed an older version and that solved the problem.
That is not what I want though..



Thank's for any help!
Jon Lennryd






Reply With Quote
  #2 (permalink)  
Old 10-25-2004
Daedalus
 
Posts: n/a
Default Re: Problem with PHP and MySQL, mysql_connect fails.

How did you configure MySQL server ?
Is it really listening to194.47.214.66:3306 ?
or is it in fact listening to 127.0.0.1:3306 ?

If it's listening to 127.0.0.1, then just use this in php: $ServerAdress =
"127.0.0.1:3306";

Dae


> I have just installed Apache V2.0.52 with
> PHP V4.3.4 and MySQL V4.1.5 in windows xp,
> with service pack 2 installed.
>
> Apache and PHP works fine together, and MySQL
> works on it's own, I can create databases etc.
> via dos.
>
>
> Well, this is the php-code that does not work:
>
> $ServerAdress = "194.47.214.66:3306";
> $User = "JonLennryd";
> $PassWord = "*******";
> $DataBaseName = "mindb";
>
> $conn=@mysql_connect($ServerAdress,$User,$PassWord )
> or die (mysql_error());
>
>
> The error that follows:
>
> Access denied for user 'JonLennryd'@'194.47.214.66' (using password: YES)
>
>
>
> The account JonLennryd exists, and the root account also exists.
> A friend said that this was a problem caused by php v4.x, he had
> installed an older version and that solved the problem.
> That is not what I want though..



Reply With Quote
  #3 (permalink)  
Old 12-02-2004
adrianc85
 
Posts: n/a
Default Re: Problem with PHP and MySQL, mysql_connect fails.


It seems like you do connect to the mysql server. Make sure you typed i
the password right. If you are new to Mysql get mysqladmin. It is a we
based mysql administration which is really easy. You can rese
passwords there. Otherwise google the password commands.
Sometimes the user might be user@127.0.0.1 and you are trying to d
user@194.47.214.66. That might give the wrong password.

Reset your password and try again first then check the other things
have mentioned above.

Good luck

Adrian

Daedalus wrote:
> *How did you configure MySQL server ?
> Is it really listening to194.47.214.66:3306 ?
> or is it in fact listening to 127.0.0.1:3306 ?
>
> If it's listening to 127.0.0.1, then just use this in php
> $ServerAdress =
> "127.0.0.1:3306";
>
> Dae
>
>
> > I have just installed Apache V2.0.52 with
> > PHP V4.3.4 and MySQL V4.1.5 in windows xp,
> > with service pack 2 installed.
> >
> > Apache and PHP works fine together, and MySQL
> > works on it's own, I can create databases etc.
> > via dos.
> >
> >
> > Well, this is the php-code that does not work:
> >
> > $ServerAdress = "194.47.214.66:3306";
> > $User = "JonLennryd";
> > $PassWord = "*******";
> > $DataBaseName = "mindb";
> >
> > $conn=@mysql_connect($ServerAdress,$User,$PassWord )
> > or die (mysql_error());
> >
> >
> > The error that follows:
> >
> > Access denied for user 'JonLennryd'@'194.47.214.66' (usin

> password: YES)
> >
> >
> >
> > The account JonLennryd exists, and the root account also exists.
> > A friend said that this was a problem caused by php v4.x, he had
> > installed an older version and that solved the problem.
> > That is not what I want though..



-
adrianc8
-----------------------------------------------------------------------
Posted via http://www.codecomments.co
-----------------------------------------------------------------------

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:28 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0