- inside a docker folder at the root of the project add this to the docker-compose.yml file
- On VSCode with Docker extension, execute 'docker compose up' on docker-compose.yml
- Attach shell
- and use 'mysql -p' for database password
- Attach shell
- and use 'psql ' for access database
- use '\dt' for show all tables on database
- use '\d ' for show table structure
- if necessary run "docker compose up".
version: '3.1' services: db: image: mysql container_name: mysql-container command: --default-authentication-plugin=mysql_native_password restart: always environment: MYSQL_ROOT_PASSWORD: docker MYSQL_DATABASE: db_test volumes: - /var/lib/mysql ports: - '8080:3306'