Comments (14)
I see you're bind-mounting a directory (/srv/librenms/db
), is this the first time you run a container using this directory? Was the directory empty before running the container? (the image will only initialize the database if the data directory is empty; see this line in the entrypoint script; https://github.com/docker-library/mariadb/blob/cc686f56875aa84d135bb89de6ca50385211bdab/10.1/docker-entrypoint.sh#L36)
from mariadb-docker.
sorry, still checking this. It looks like database initialization take looooooong time, more than what i expected.
Anyway I hope it is usefull my comment to anyone facing this problem with little patience like me
from mariadb-docker.
I checked this solution and saved my life. He changed the volumn name and worked! The answer says it might the data layer might not be recreated.
Could you give some detailed info?
from mariadb-docker.
Ah thanks for pointing that out. The directory already existed as I ran the container earlier without the env variable set, so that's why it didn't get created on startup. I'll close this then, thanks again!
from mariadb-docker.
You're welcome!
On 10 Jul 2016, at 03:56, Ross Hettel [email protected] wrote:
Ah thanks for pointing that out. The directory already existed as I ran the container earlier without the env variable set, so that's why it didn't get created on startup. I'll close this then, thanks again!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
from mariadb-docker.
well no. It does not work.
In fact this is my composer:
services:
mariadb:
image: mariadb
volumes:
- ./dbdata:/docker-entrypoint-initdb.d
environment:
- MYSQL_ROOT_PASSWORD=rootte
- MYSQL_DATABASE=sswsuitecrm
- MYSQL_USER=sswsuitecrm
- MYSQL_PASSWORD=suitepwd
and
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.001 sec)
on first run
same when running with a void folder
from mariadb-docker.
Hello, I have the same problem, (And I think waited so much)
Here is my command:
docker run -d --name wp-mysql --network wp-network -v /data/wordpress/mysql:/var/lib/mysql -e MYSQL_USER=wordpress_user -e MYSQL_PASSWORD=wp_passmord -e MYSQL_DATABASE=wordpress -e MYSQL_RANDOM_ROOT_PASSWORD=1 mariadb
I deleted all /data/wordpress/mysql/* before, and still no database created !?
from mariadb-docker.
ok, I have to wait 30 min 👍
from mariadb-docker.
@LeDOC666, that sounds like #262.
from mariadb-docker.
Hi, my compose file is like:
version: "2"
services:
mariadb_local:
build:
context: ./src
dockerfile: mariadb-dockerfile
args:
MYSQL_DATABASE: dev
MYSQL_ROOT_PASSWORD: dev
container_name: mariadb_local
restart: always
ports:
- 3306:3306
volumes:
- ./mariadb/data:/data
environment:
MYSQL_DATABASE: dev
MYSQL_ROOT_PASSWORD: dev
and mariadb-dockerfile:
FROM mariadb
ADD dev.sql /docker-entrypoint-initdb.d
And I didn't see the dev DB created when I exec into mysql container.
P.S. I added build args because I see the doc says If your service specifies a build option, variables defined in environment are not automatically visible during the build. Use the args sub-option of build to define build-time environment variables.
but still have no specified MYSQL_DATABASE created.
What am I missing?
from mariadb-docker.
https://docs.docker.com/engine/reference/builder/#add
yes, probably it was this missing:
If
<dest>
does not end with a trailing slash, it will be considered a regular file and the contents of<src>
will be written at<dest>
so this line
ADD dev.sql /docker-entrypoint-initdb.d
should have been
ADD dev.sql /docker-entrypoint-initdb.d/
EDIT: the .
in documentation is meant as the end of the sentence, nothing to do with .
directory!
from mariadb-docker.
@danielecr Thanks!
You are right that I made a mistake forgot to add a slash in the end.
And another thing I think it is the build command in docker-compose file will only be executed at the first time when you do docker-compose up
. The image will not be rebuilt the second time you type the same command. So if the first time the config is wrong in your dockerfile, you input docker-compose up
then the wrong layer is added to the image. And the second time you will get same wrong result though you've changed the dockerfile.
So you should rebuild the image first and then up the container: type docker-compose build | docker-compose up
to explicitly tell the docker to rebuild the image. Then the docker image layer will be changed and you will probably get desired result.
It is just a guess. I didn't verify it.
from mariadb-docker.
yes, that is also true. A shorter version is docker-compose --build up
(all on doc https://docs.docker.com/compose/reference/up/ as usual)
from mariadb-docker.
I see you're bind-mounting a directory (
/srv/librenms/db
), is this the first time you run a container using this directory? Was the directory empty before running the container? (the image will only initialize the database if the data directory is empty; see this line in the entrypoint script; https://github.com/docker-library/mariadb/blob/cc686f56875aa84d135bb89de6ca50385211bdab/10.1/docker-entrypoint.sh#L36)
Thank you for this key piece of advice. I've been pruning volumes instead of fully removing them while trying to get a Nextcloud pod assembly script together. I found leftover gunk in my volume from an earlier attempt. Thank you so much!
podman volume rm <volumeName>
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.