Comments (10)
This is possible today trivially with command-line flags, as noted/demonstrated in the image description: (https://github.com/docker-library/docs/blob/e72d96051254c263821f8fab32f05e0153221ed9/mariadb/README.md#configuration-without-a-cnf-file)
$ docker run ... mariadb --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
from mariadb-docker.
@visay You can use the command option to pass a command name and flag.
command: mysqld --flag --flag --flag
from mariadb-docker.
@tianon how to integrate these command flags into the docker-compose.yml?
from mariadb-docker.
Yes, that's one part for the charset but collation setting is still missing.
from mariadb-docker.
+1: docker-library/mysql#14 (comment)
from mariadb-docker.
I think this is similar to the feature-request for MySQL; docker-library/mysql#14
from mariadb-docker.
True! Just referring to that issue, so that (if possible), a single solution can be found for both MySQL and MariaDB 👍
from mariadb-docker.
@tanji ah yes, working as expected. thanks a lot :)
from mariadb-docker.
Did I miss something but doesn't work for me
MariaDB [(none)]> show variables like 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin1 |
| character_set_connection | latin1 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | latin1 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.001 sec)
mariadb:10.5
# docker inspect mariadb | jq .[].Config.Cmd
[
"mysqld",
"--character-set-server=utf8mb4",
"--collation-server=utf8mb4_unicode_ci"
]
docker-compose.yml
version: '3'
services:
mariadb:
network_mode: host
image: mariadb:10.5
container_name: mariadb
volumes:
- /opt/docker/mariadb/db-data:/var/lib/mysql
ports:
- 3306:3306
command: ['mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
environment:
- MARIADB_DATABASE=testdb
- MARIADB_USER=user
- MARIADB_PASSWORD=1234567
- MARIADB_RANDOM_ROOT_PASSWORD=true
from mariadb-docker.
@Alexhha commenting on old closes issues tends to get missed. Please open a new issue next time.
What exactly doesn't work? character_set_server gained the value you set.
$ podman run -d --rm -e MARIADB_DATABASE=testdb -e MARIADB_USER=user -e MARIADB_PASSWORD=1234567 -e MARIADB_RANDOM_ROOT_PASSWORD=true --name mdb105-issue-16-test mariadb:10.5 'mysqld' '--character-set-server=utf8mb4' '--collation-server=utf8mb4_unicode_ci'
3927be7d5acfb6a865fc86491e7a03fb135d17f812ca08111239262ef32ee71a
$ podman exec -ti mdb105-issue-16-test mysql -u user -p1234567 testdb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.11-MariaDB-1:10.5.11+maria~focal mariadb.org binary distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [testdb]> create table test (v varchar(300));
Query OK, 0 rows affected (0.012 sec)
MariaDB [testdb]> show create table test\G
*************************** 1. row ***************************
Table: test
Create Table: CREATE TABLE `test` (
`v` varchar(300) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
1 row in set (0.000 sec)
MariaDB [testdb]> show create database testdb\G
*************************** 1. row ***************************
Database: testdb
Create Database: CREATE DATABASE `testdb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */
1 row in set (0.000 sec)
The table and database are defined with your {character-set,collation}-server
server directives.
Where you expecting other character set system variables to change? Character sets are documented on the knowledge base.
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.