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

Use non-root MySQL password for sail mysql #45

Merged

Conversation

WaveHack
Copy link
Contributor

This is a small yet separate addendum to my other PR: #44

This PR changes the provided password for to the MySQL CLI on the sail mysql command from MYSQL_ROOT_PASSWORD to MYSQL_PASSWORD.

Context:

This is for custom Docker Compose setups from before Laravel Sail came out. Sail automatically sets the MYSQL_ROOT_PASSWORD env variable to .env's DB_PASSWORD.

When working with a Docker Compose configuration that have separate passwords between the MySQL root user and the MySQL working (i.e. non-root) user, sail mysql will throw the classic 'Access denied for user X (using password: YES)' MySQL error.

One could also argue that the current call to the MySQL CLI is erroneous since it combines MYSQL_USER (not root) and MYSQL_ROOT_PASSWORD.

This PR fixes this by using MYSQL_PASSWORD instead, as mentioned above. Tested with a fresh Laravel installation to make sure it didn't break.

@taylorotwell taylorotwell merged commit 90ff3e0 into laravel:1.x Jan 25, 2021
@WaveHack WaveHack deleted the feature/use-nonroot-mysql-password branch January 25, 2021 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants