Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- After installing all stuff, php would not connect to mysql. I was getting message:
- mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication.
- I read several places that I needed to re-save the password to use new hash.
- However that was not working. It kept saving the password the same way as before.
- */
- -- this was not working
- UPDATE mysql.USER SET PASSWORD=PASSWORD('password') WHERE USER='root';
- -- neither this
- SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password');
- SET PASSWORD FOR 'root'@'li247-25' = PASSWORD('password');
- SET PASSWORD FOR 'root'@'127.0.0.1' = PASSWORD('password');
- FLUSH PRIVILEGES;
- -- So then I learned this. I set old_passwords = off and ran the above again. That fixed it.
- SHOW VARIABLES LIKE 'old_passwords';
- SET old_passwords = OFF;
- SELECT `User`, `Host`, LENGTH(`Password`) FROM mysql.USER;
- UPDATE mysql.USER SET PASSWORD=PASSWORD('password') WHERE USER='root';
- FLUSH PRIVILEGES;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement