skip to Main Content

django.db.utils.OperationalError when running MySQL/MariaDB in Docker: Lost connection to MySQL server at 'reading initial communication packet'

Running MySQL/MariaDB in a Docker container: docker run -p 3306:3306 --name $(DATABASE_NAME) -v /tmp/mysql:/var/lib/mysql -e MYSQL_DATABASE=$(DATABASE_NAME) -e MYSQL_USER=$(DATABASE_USER) -e MYSQL_ROOT_PASSWORD=$(DATABASE_PASSWORD) -d mariadb:latest > /dev/null And then running Django version 4 locally with: manage.py runserver 127.0.0.1:8000 Error django.db.utils.OperationalError: (2013, "Lost connection…

VIEW QUESTION

MySql and Docker com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

I want to put my spring rest api with database in mysql in Docker. application.properties file: server.port=8082 spring.datasource.url=jdbc:mysql://database:8083/schoolregistrationsystem spring.datasource.username=user spring.datasource.password=pwd spring.jpa.hibernate.ddl-auto=none spring.liquibase.change-log=classpath:/db/changelog/dbchangelog.xml spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER Next I created docker-compose.yml file in directory with project: version: "3.8" services: api: build: ./SchoolRegistrationSystem…

VIEW QUESTION
Back To Top
Search