Skip to content

denartha10/comp30830-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The issue you're encountering where your init.sql script is not being executed and instead a database named name is being created might be due to several reasons. Here are some potential causes and solutions based on the information provided and common issues encountered with MySQL Docker containers:

  1. Volume Data Persistence: If the MySQL data directory (/var/lib/mysql) already contains data, the MySQL container will not execute the scripts in /docker-entrypoint-initdb.d because it assumes the database has already been initialized. This is a common issue when using persistent volumes. To resolve this, you can either delete the existing data in the volume or use a new volume that doesn't contain any data. This approach was suggested in one of the solutions [1].

To troubleshoot and resolve the issue, you can try the following steps:

  • Ensure the MySQL data directory is empty or use a new volume.