Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Installation fails when root user has password, still claims success #555

Closed
3 tasks done
Leland opened this issue Dec 29, 2020 · 2 comments
Closed
3 tasks done
Labels
Bug Bugs Needs review Tickets that need review

Comments

@Leland
Copy link
Contributor

Leland commented Dec 29, 2020

  • I've checked the issue queue and could not find anything similar to my bug.
  • I'm on the latest version of valet-plus (valet --version): Valet+ 2.1.0
  • I've run valet fix and valet install after updating and before submitting my issue/feature.

What is the problem?
When a user has a password already set on MySQL, valet install will always fail. Note that #468 is around the same topic, but there's clearly more work to be done here, both in terms of messaging and documentation.

To be clear: Right now, Valet+ only installs when the root password is blank.

  1. $ mysqladmin -u root password 'foo'
    mysqladmin: [Warning] Using a password on the command line interface can be insecure.
    Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
    
$ valet install
Password:
[nginx] Stopping
[mysql@5.7] Stopping
[devtools] Installing tools
[wp-cli] Installing
[pv] Installing
[geoip] Installing
[zlib] Installing
[binaries] Installing binaries
[nginx] Installing
[valet-php@7.1] Installing
[BREW TAP] henkrehorst/php already installed
[PECL] Updating PECL channel: pecl.php.net
[PECL] Installing extensions
	apcu is already installed, skipping...
	apcu is already enabled, skipping...
	geoip is already installed, skipping...
	geoip is already enabled, skipping...
	yaml is already installed, skipping...
	yaml is already enabled, skipping...
[PECL-CUSTOM] Installing extensions
[dnsmasq] Installing
[mysql@5.7] Installing
[mysql@5.7] Stopping
[mysql@5.7] Configuring
[mysql@5.7] Restarting
[redis] Installing
[mailhog] Installing
Setting password for root user failed. 

Valet installed successfully!

What is the solution?
A workaround is thus: mysqladmin -u root -p password ''

If you don't know your password, you can use sudo to login. See: https://stackoverflow.com/questions/3032054/how-to-remove-mysql-root-password

But better solutions entail getting setRootPassword() to be more helpful here.

  • Allow user-entry of their existing DB password
  • Better documentation – "failed" gives the user no next steps. In reality, all they need to do is just change their password.
  • install should not be returning a success message when the DB config fails, this is definitely a failure condition
@Leland Leland added Bug Bugs Needs review Tickets that need review labels Dec 29, 2020
@clnt
Copy link

clnt commented Apr 16, 2021

@Leland This is usually caused by having mysql@5.7 missing from your $PATH prior to running valet install, not documented anywhere but one of the things I have found prevents this issue during an install.

@mischabraam
Copy link
Member

Added information when this happens in https://github.com/weprovide/valet-plus/releases/tag/3.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bugs Needs review Tickets that need review
Projects
None yet
Development

No branches or pull requests

3 participants