Home > Archive > PHP Language > December 2004 > Problem with PHP and MySQL, mysql_connect fails.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Problem with PHP and MySQL, mysql_connect fails.
|
|
| Jon Lennryd 2004-10-24, 8:55 pm |
| 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
| |
| Daedalus 2004-10-25, 3:56 am |
| 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..
| |
| adrianc85 2004-12-02, 4:51 pm |
| It seems like you do connect to the mysql server. Make sure you typed in the password right. If you are new to Mysql get mysqladmin. It is a web based mysql administration which is really easy. You can reset passwords there. Otherwise google the password commands.
Sometimes the user might be user@127.0.0.1 and you are trying to do user@194.47.214.66. That might give the wrong password.
Reset your password and try again first then check the other things i have mentioned above.
Good luck
Adrian
quote: Originally posted by Daedalus
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..
|
|
|
|
|