nystudio107 / craft-scripts

Shell scripts to manage database backups, asset backups, file permissions, asset syncing, cache clearing, and database syncing between Craft CMS environments

Home Page:https://nystudio107.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WSL: Host not being used

clarknelson opened this issue · comments

Describe the bug

A clear and concise description of what the bug is.

I am setting up the scripts on Windows with the WSL subsystem and Craft Nitro. The pull assets script works but I am having a problem pulling the database. I have this set in my env file:

LOCAL_DB_HOST="mysql-5.7-3306.database.nitro"

But when I pull the scripts:

mysqldump: Got error: 1044: Access denied for user 'nitro'@'%' to database 'mydatabase' when selecting the database

This works fine on Mac, I wonder if there is a problem with Nitro. I have no idea why it is using % I've tried on MySQL 5.7 and MySQL 8.0. Any direction or ideas would be much appreciated!

I'm not too familiar with Nitro, so it might be best to post an issue there or submit an issue to support@craftcms.com

The only thing I can think of is where you run the script matters. FWIW, here's what I use on my Docker setup:

https://github.com/nystudio107/craft/blob/craft-webpack/Makefile#L21

&&

https://github.com/nystudio107/craft/blob/craft-webpack/scripts/docker_pull_db.sh