0

I am trying to connect the mysql with PDO but having a problem.PDOException is throwing this problem :

PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password]

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

I have tried SET old_passwords = 0; But still not working.

  • Possible duplicate of [MySQL remote connection fails with "unknown authentication method"](http://stackoverflow.com/questions/14612551/mysql-remote-connection-fails-with-unknown-authentication-method) – miken32 Jan 23 '16 at 05:05

1 Answers1

0

You're close, but in the absence of any modifier, you were only setting a session variable.

To set a global variable, try this:

SET GLOBAL old_passwords=0

Or, better yet, edit your config file with old-passwords=0 and restart.

If you have old accounts with the old password format set, you'll need to upgrade them as well.

miken32
  • 42,008
  • 16
  • 111
  • 154
  • How can i restart?I am using remote server.Not local one –  Jan 23 '16 at 04:51
  • Well that's a whole separate question. If this isn't your database you should be talking to your database administrator about that. – miken32 Jan 23 '16 at 04:54
  • thi error comes `#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation` when i use `SET GLOBAL old_passwords=0` –  Jan 23 '16 at 05:02