Skip to content

Commit dd6e5b3

Browse files
authored
Merge pull request #29 from metabase/nm-run-mariadb-10-2
2 parents d3a5be6 + 8e89324 commit dd6e5b3

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

run-mariadb-10-2.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#! /usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
echo "Removing existing container..."
6+
7+
docker kill maria-db-10-2 2>/dev/null || echo "Nothing to kill"
8+
9+
docker rm maria-db-10-2 2>/dev/null || echo "Nothing to remove"
10+
11+
docker run -p 3305:3306 \
12+
-e MYSQL_DATABASE=metabase_test \
13+
-e MYSQL_USER=root \
14+
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
15+
--name maria-db-10-2 \
16+
--rm \
17+
-d mariadb:10.2.23
18+
19+
cat <<EOF
20+
21+
Started MariaDB 10.2.23 on port 3305.
22+
23+
JDBC URL: jdbc:mysql://localhost:3305/metabase_test?user=root
24+
25+
env vars: MB_DB_TYPE=mysql MB_DB_DBNAME=metabase_test MB_DB_HOST=localhost MB_DB_PASS='' MB_DB_PORT=3305 MB_DB_USER=root MB_MYSQL_TEST_USER=root
26+
27+
Clojure CLI:
28+
29+
clojure -J-Dmb.db-type=mysql -J-Dmb.db-port=3305 -J-Dmb.db.dbname=metabase_test -J-Dmb.db.user=root -J-Dmb.db.pass=''
30+
31+
or add a profile for it to your ~/.clojure/deps.edn:
32+
33+
{:profiles
34+
{:user/mysql
35+
{:jvm-opts
36+
["-Dmb.db-type=mysql"
37+
"-Dmb.db-port=3305"
38+
"-Dmb.db.dbname=metabase_test"
39+
"-Dmb.db.user=root"
40+
"-Dmb.db.pass="]}}}
41+
42+
Connect with the MySQL CLI tool:
43+
44+
mysql --user=root --host=127.0.0.1 --port=3305 --database=metabase_test
45+
46+
EOF
47+

0 commit comments

Comments
 (0)