Jump to content

Archived

This topic is now archived and is closed to further replies.

corbin

mysql_connect error

Recommended Posts

So, I'm trying to connect to my MySQL server on my computer from my remotely hosted site... I'm connecting with a script like:

[code]mysql_connect($db_host, $db_user, $db_pass) or die(mysql_error());
mysql_select_db($db_database);[/code]

and I'm getting the error "Client does not support authentication protocol requested by server; consider upgrading MySQL client".  I would appreciate it if someone could tell me what is causing that error and if its possible to fix it.

Thanks to anyone who helps.

Share this post


Link to post
Share on other sites
This to me sounds like you have not got the password and username set in the mysql root.

Intresting.

are you using a provider for hosting or your own setup.



try like this ok

mysql_connect("localhost") or die(mysql_error());
mysql_select_db("database_name");

Share this post


Link to post
Share on other sites
I never ran into this problem myself, but....

a quick search found this result from another forum.

[color=navy]This will fix it.  you need to run this at the mysql command prompt because
of the different password authentications


SET PASSWORD FOR 'zoooz'@'some_host' = OLD_PASSWORD('mypass');

zoooz is the username
some_host is the host
mypass is the password you want[/color]

Share this post


Link to post
Share on other sites
Drumminxx is that code used in the command prompt msdos root of mysql admin


example
mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password');

Share this post


Link to post
Share on other sites
[quote author=redarrow link=topic=99151.msg390326#msg390326 date=1151812220]
Drumminxx is that code used in the command prompt msdos root of mysql admin


example
mysql> SET PASSWORD FOR root@localhost=PASSWORD('new_password');
[/quote]


yes

Share this post


Link to post
Share on other sites
Thank you.

was only for my self to properly understand cheers.

grate help mate.

Share this post


Link to post
Share on other sites
Connecting to my own computer from a hosted site... Its not a wrong password.... its not a wrong host... My router is set up right... Its something wrong on the hosted side I think... I'm not sure though.

Share this post


Link to post
Share on other sites
dont understand connected to my computer to a hosted site?

if you run your own server then whats the hosted site got to do with anythink you should be the hoster ok.

one or the other .

you can not controll a hosting service via your pc ok you goto the providers online hosting controlls ok.

any mysql for the hosting company should be uploaded to there site not yours.

unless you are the hosting company and tellnetting in via msdos.

I get the inpression that your trying to setup a dynamic ip address linking to your computer but thats not a php problam sorry.

Share this post


Link to post
Share on other sites
You just may have the right password but a newer version of mysql uses a different password authentication so you need to tell mysql to use the old password authentication

SET PASSWORD FOR 'zoooz'@'some_host' = [b]OLD_PASSWORD[/b]('mypass');

of course this is only good if you have that kind of access otherwise you'll need to contact your hosting provider

here is some more info on this matter
http://dev.mysql.com/doc/refman/5.0/en/old-client.html

Share this post


Link to post
Share on other sites
[quote author=Drumminxx link=topic=99151.msg390361#msg390361 date=1151817804]
You just may have the right password but a newer version of mysql uses a different password authentication so you need to tell mysql to use the old password authentication

SET PASSWORD FOR 'zoooz'@'some_host' = [b]OLD_PASSWORD[/b]('mypass');

of course this is only good if you have that kind of access otherwise you'll need to contact your hosting provider

here is some more info on this matter
http://dev.mysql.com/doc/refman/5.0/en/old-client.html

[/quote]

Did it.  Same error.

Share this post


Link to post
Share on other sites
hhmm...
did you restart mysql?

here is some more info

http://www.phplivesupport.com/documentation/viewarticle.php?aid=72

sorry if this doesn't help

Share this post


Link to post
Share on other sites
[quote author=Drumminxx link=topic=99151.msg390372#msg390372 date=1151819956]
hhmm...
did you restart mysql?

here is some more info

http://www.phplivesupport.com/documentation/viewarticle.php?aid=72

sorry if this doesn't help
[/quote]

That worked! Thanks :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.