Skip to content

Run MariaDB

Vincent Emonet edited this page May 17, 2019 · 6 revisions

Run MariaDB

docker run --rm --name mariadb -v /data:/data -e MYSQL_ROOT_PASSWORD=pwd -d mariadb

Connect to MySQL

docker exec -it mariadb mysql -uroot -ppwd

MySQL commands

SHOW DATABASES;
CREATE DATABASE database_name;
USE database_name;

SHOW TABLES;
SELECT * FROM table_name LIMIT 10;

Load scripts

docker exec -i mariadb mysql -uroot -ppwd database_name < /data/load_data.sql

JDBC URL

jdbc:mariadb://localhost:3306/DB?user=root&password=pwd