Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.96 KB | None | 0 0
  1. /*
  2.  After installing all stuff, php would not connect to mysql. I was getting message:
  3.  
  4.      mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.
  5.      
  6.  I read several places that I needed to re-save the password to use new hash.
  7.  However that was not working. It kept saving the password the same way as before.
  8. */
  9.  
  10. -- this was not working
  11. UPDATE mysql.USER SET PASSWORD=PASSWORD('password') WHERE USER='root';
  12.  
  13. -- neither this
  14. SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');
  15. SET PASSWORD FOR 'root'@'li247-25' = PASSWORD('password');
  16. SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('password');
  17.  
  18. FLUSH PRIVILEGES;
  19.  
  20.  
  21. -- So then I learned this. I set old_passwords = off and ran the above again. That fixed it.
  22. SHOW VARIABLES LIKE 'old_passwords';
  23. SET old_passwords = OFF;
  24. SELECT `User`, `Host`, LENGTH(`Password`) FROM mysql.USER;
  25. UPDATE mysql.USER SET PASSWORD=PASSWORD('password') WHERE USER='root';
  26. FLUSH PRIVILEGES;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement