我一直在我的幼虫应用程序上收到这条消息
PDOException in Connector.php line 119:
SQLSTATE[HY000] [1862] Your password has expired. To log in you must change it using a client that supports expired passwords.
我试过像这样重设密码:
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('secret');
我收到回复
Query OK, 0 rows affected, 1 warning (0.00 sec)
但在我看来仍然出现错误时,我尝试使用 sequel pro 连接到数据库,但得到了同样的错误
MySQL said: Your password has expired. To log in you must change it using a client that supports expired passwords.
不知道我还能做什么,我在重置后尝试了 vagrant provision,但仍然得到同样的错误
最佳答案
我也遇到了同样的问题。我已经解决了修改宅基地文件的问题。 在 vendor/laravel/homestead/scripts/create-mysql.sh
mysql -uhomestead -psecret -e "CREATE DATABASE IF NOT EXISTS \`$DB\` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci";
这是给我带来问题的那一行。在此行之前,我使用 --connect-expired-password 选项重置了密码。我也必须重置 laravel bd 用户密码。假设 laravel bd 用户是 root 并且密码是 secret 的:
mysql -uhomestead -psecret -e "SET PASSWORD = PASSWORD('secret')" --connect-expired-password;
mysql -uroot -psecret -e "SET PASSWORD = PASSWORD('secret')" --connect-expired-password;
mysql -uhomestead -psecret -e "CREATE DATABASE IF NOT EXISTS \`$DB\` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci";
对我有用。
关于Mysql 密码过期,使用 Homestead Virtualbox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40476412/