Homestead error: The SSH command responded with a non-zero exit status
Homestead error: The SSH command responded with a non-zero exit status
我在我的 Homestead 机器上执行 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
从主机开始。
我在我的 Homestead 机器上执行 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
从主机开始。