Jump to content

mysql_connect error


corbin

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.
Link to comment
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");

Link to comment
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]
Link to comment
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
Link to comment
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.
Link to comment
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
Link to comment
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.
Link to comment
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 :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.