Comments (18)
any news on this? i have the same issue
from mariadb-docker.
If your container has been initialized before you put sql dump in share volume of your docker-compose.yml you need to remove the volume and recreate the container to restart initialisation process:
docker volume ls
docker volume rm your_volume_name
from mariadb-docker.
+1 I've the same issue
from mariadb-docker.
I found the problem: As @florianajir correctly suggested: The files are only then read, when the container is created anew!
This solved the problem for me.
from mariadb-docker.
It has to be permissions on the files in the initdb directory. The only difference for this part between the mariadb and postgres entrypoint scripts is that postgres is still running as the root user when it runs the scripts while mariadb/mysql is running as the mysql
user in the container.
from mariadb-docker.
though you have to 777 it because it's owned by root, so @yosifkit might be right when he says its probably permissions...
from mariadb-docker.
@luandro, what are the permissions of that file and folder from inside the sql container? The scripts/sql files in /docker-entrypoint-initdb.d/
are run by the mysql
user of the container, so they need to be readable by that user.
Or possibly related to docker-library/postgres#203 (comment).
from mariadb-docker.
Hi there.
I had the same issue, and all I did was to give the full path to my local folder that I am mounting and it worked.
from mariadb-docker.
@jm-ds Files are converted to folders if the linux system that docker brings with it, is not able to locate the files correctly.
from mariadb-docker.
So, init-db
is a directory with a file ending in .sql
? Is the directory and file readable by user 999
(which is what the sql process runs as)?
from mariadb-docker.
Yes init-db is a directory with file endind in .sql ans .sh. this directory is readable by docker an mounter on container with root '770'.
For information this don't work on Mysql but work with postgres images
from mariadb-docker.
After than container is started and file is ignored, if i make this command, file is imported:
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < /docker-entrypoint-initdb.d/file.sql
The .sql file is read and imported on my database.
from mariadb-docker.
if you create your own dockerfile that use extend FROM this mariadb base image and use an ADD to copy the file into the images container it works... but it doesn't work when you load it as a volume
from mariadb-docker.
Having the same issue.
I'm not even able to achieve the solution provided by @waynetheisinger.
The only solution I found is to run a bash session within the image and inject my /docker-entrypoint-initdb.d/dump.sql
manually.
Is there another way ?
from mariadb-docker.
Closing old issue. (still think it is/was permissions)
from mariadb-docker.
Having the same issue... Should be a better explanation on how to use. Here's my docker-compose.yml
:
version: '2'
services:
wordpress:
image: wordpress:latest
restart: always
volumes:
- ./config/php.conf.uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
- ./wp-app:/var/www/html # Full wordpress project
environment:
WORDPRESS_DB_PASSWORD: '${DB_PASSWORD}'
mysql:
image: mariadb:latest
restart: always
volumes:
- ./wp-data:/docker-entrypoint-initdb.d
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
Inside ./wp-data/
there's a .sql
dump file.
from mariadb-docker.
I'm having this exact issue on win 7 with toolbox but not on the unbuntu 17 where the image is built. What's odd in my case is that the files appear to be converted to directories when moved from Ubuntu to windows. I just saved the image and reloaded on windows and then ran docker-compose up -d.
When I bash into the image and ls -l inside docker-entrypoint-initdb.d I get the following:
drwxrwxrwx 2 root root 40 Dec 5 23:04 OnPremise.sql
drwxrwxrwx 2 root root 40 Dec 5 23:04 mysql-setup.sql
======== UPDATE ========
I was able to get my instance to work by using COPY in a Dockerfile instead of using volume from within docker-compose.yml. There's definitely something not right now the volume mounts seeing as it converted my files to directories when moved from Ubuntu to windows. I am, however, on Win 7 using Docker toolbox.
from mariadb-docker.
I solved this by using an absolute path to the docker-entrypoint-initdb.d directory
from mariadb-docker.
Related Issues (20)
- Add option to explicitly set the uid and gid of the mysql user. HOT 15
- Healthcheck not working properly on a prior docker stack. HOT 5
- Dashes in username are not allowed HOT 3
- Aborted connection to db: 'unconnected' user: 'unauthenticated' host: 'xxx' (This connection closed normally without authentication) HOT 42
- [Question - help needed] My Master - Master setup stop working due to an error I can not solve HOT 2
- Add option to auto upgrade user tables HOT 7
- Latest Mariadb image has authentication issues HOT 3
- Server sent charset HOT 2
- Database failing after update to new latest image HOT 5
- Fields with names 'uuid' or '..._uuid' cannot be deleted HOT 1
- There is a strange error when trying to recreate a table after deleting it. HOT 1
- Yes it seems another: mysqld: io_uring_queue_init() failed with ENOMEM: try larger memory locked limit HOT 7
- .my-healthcheck.cnf permissions problems HOT 13
- Crash when entrypoint inits database and passing init-connect argument with whitespace HOT 2
- Why is there no 10.5.25 or 10.6.18 HOT 6
- Fresh container, fails tc.log and fails permissions HOT 3
- Issue with mounting a volume with `/*!999999\- enable the sandbox mode */ ` HOT 3
- Missing arm64 builds and wrong lts version HOT 4
- Default collation changed between 11.4.1 and 11.4.2 (latest) HOT 6
- MARIADB_AUTO_UPGRADE=1/mariadb-upgrade not workling if ssl is enabled HOT 28
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mariadb-docker.