MySQL PHP incompatibility

后端 未结 10 1847
天涯浪人
天涯浪人 2020-11-28 07:42

I\'m running WAMP locally, but connecting to a remote MySQL database. The local version of PHP is the latest 5.3.0.

One of the remote databases, being version 5.0.45

10条回答
  •  旧时难觅i
    2020-11-28 08:02

    I have been trying to find a simple fix for this problem. Try this approach. In MySQL type

    SELECT Host, User, Password FROM mysql.user;
    

    If your password is sixteen characters, this is because you have used OLD_PASSWORD on your user's or have been running an old version of MySQL. To update type in

    UPDATE mysql.user SET Password=PASSWORD('newpass')
      WHERE User='root' AND Host='localhost';
    FLUSH PRIVILEGES;
    

    swapping root, localhost and newpass for your user, host and pass respectively. Now when you re-type

    SELECT Host, User, Password FROM mysql.user;
    

    Your password should have changed. This fixed it for me.

提交回复
热议问题