I've read through a lot of alternative solutions but I haven't found anything specific to my problem. I'm using Windows PowerShell, and I need to restore/populate my DB Docker container that I created using the following code below.
docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 -e MYSQL_DATABASE=DB -e MYSQL_USER=PASSWORD -e MYSQL_PASSWORD=PASSWORD -d mysql:8
Then to populate my DB (Restoring data from an sql dump file) I enter in the following code below to point my .sql file to the DB container I created.
p.s. I have to place in dbl quotes due to windows syntax. I also can't place in the following character '<' before entering in my path because it's improper syntax for Docker on Windows)
docker exec -i some-mysql sh -c "exec mysql -uroot -p "$root"" "C:/filePathHere/all-databases.sql"
After I hit enter I receive the fallowing error below
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Even after creating a new DB connection and adding in a new user/password, which I use root for both User/Pwd. I still get denied access.
Anyone know what I may be doing wrong ? It's important I populate my DB container this way and avoid manually restoring the dump file.