当我这样做时出现错误homestead up --provision
在我的宅基地机器上:
...[success logs here]...
==> default: Running provisioner: shell...
default: Running: /var/folders/9j/bsvhbzdn2dx8hjwgnl7nrj7w0000gn/T/vagrant-
shell20170127-4343-1dyyzgz.sh
==> default: mysql:
==> default: [Warning] Using a password on the command line interface
can be insecure.
==> default: Please use --connect-expired-password option or invoke
mysql in interactive mode.
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
虽然我收到此错误,但一切正常,除了一个:
我定义的数据库~/.homestead/Homestead.yaml
不是在mysql中创建的。所以我猜这个错误会导致问题。
任何帮助,将不胜感激。
我相信这实际上是由于 MySQL 的密码有过期时间,而不是让它们永远有效。当我运行旧的 Laravel Homestead 5 盒子而不是 Homestead 7+ 的新盒子时,似乎会发生这种情况。
请注意,以下解决方案还修复了ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
从主机:
vagrant up
# ignore "SSH command responded with a non-zero exit status"
vagrant ssh
现在在客户端机器中:
# log into mysql (for Homestead your password is likely "secret")
mysql -h localhost -u homestead -p
SET PASSWORD = PASSWORD('secret');
-- A) set password to never expire:
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
-- or B) to change password as well:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password', 'root'@'localhost' PASSWORD EXPIRE NEVER;
-- quit mysql
quit
# exit back to host shell
exit
现在从主机:
vagrant up --provision
它应该有效。
但是,如果您现在看到==> default: createdb: database creation failed: ERROR: database "homestead" already exists
然后在客户端计算机中运行此行:
mysql -h localhost -u homestead -p -e "DROP DATABASE homestead"
然后运行vagrant up --provision
从主机上,然后就可以上路了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)