Homestead error: SSH team responded with unnecessary exit status

I get an error when I do homestead up --provisionon my homestead machine:

...[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.

Although I get this error, everything works fine except for one:

The databases that I defined in ~/.homestead/Homestead.yamlare not created in mysql. Therefore, I assume that this error is causing the problem.

Any help would be appreciated.

+4
source share
1 answer

I believe this is actually due to the fact that MySQL has a password expiration time, not forever. This seems to happen to me when I launch my old Laravel Homestead 5 instead of the new ones for Homestead 7+.

Please note that the following solution also fixes 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 .

+3

Source: https://habr.com/ru/post/1668000/


All Articles