This repository contains the necessary files to build a Docker image based on mysql:8.4-debian that includes the MeCab Full-Text Parser Plugin. This allows for Japanese full-text searching capabilities within MySQL.
git clone https://github.com/stupidloud/mysql-with-mecab.git
cd mysql-with-mecab
docker build -t mysql-mecab:latest .
You can use this image like any other MySQL image. Here's an example using docker run:
docker run --name some-mysql-mecab -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql-mecab:latest
Or in a docker-compose.yml file:
services:
db:
image: mysql-mecab:latest # Use the locally built image or replace with your published image (e.g., your-dockerhub-username/mysql-mecab:latest)
container_name: mysql_with_mecab
environment:
MYSQL_ROOT_PASSWORD: your_root_password
MYSQL_DATABASE: your_database
MYSQL_USER: your_user
MYSQL_PASSWORD: your_password
volumes:
- ./mysql_data:/var/lib/mysql
ports:
- "3306:3306"
restart: always
When MySQL service starts, the MeCab plugin is automatically loaded (via the plugin-load configuration). You can verify the installation by connecting to the MySQL instance and running:
SHOW PLUGINS LIKE 'mecab';
Dockerfile: Defines the multi-stage build process for the image.mecab.cnf: MySQL configuration file that uses the plugin-load parameter to automatically load the MeCab plugin when the server starts.Content type
Image
Digest
sha256:bc03661bf…
Size
277.2 MB
Last updated
25 days ago
docker pull kl3x/mysql-mecab