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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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.. |
|
|||
|
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 ----------------------------------------------------------------------- |