I'm trying to set up a database with a table inside a docker container. For correct working of DB, I need to run the following command:
--default-authentication-plugin=mysql_native_password
ps: I don't understand what this command exactly is for, but it prevents some strange logs by setting the DB up.
For set up, I use docker-compose as follow:
db:
image: mysql
command: >
bash -c "--init-file /pictureapi_mydb_response.sql
&& --default-authentication-plugin=mysql_native_password"
volumes:
- ./pictureapi_mydb_response.sql:/pictureapi_mydb_response.sql
restart: always
ports:
- 3307:3306
environment:
MYSQL_ROOT_PASSWORD: ${DB_MYSQL_PASS}
I'm getting the following errors:
bash: --: invalid option db_1 | Usage: bash [GNU long option] [option] ...
db_1 | bash [GNU long option] [option] script-file ...
db_1 | GNU long options:
db_1 | --debug
db_1 | --debugger\
How should I actually run two or more commands if "bash" instruction doesn't work?