Skip to content

Commit 051cfdf

Browse files
committed
Add script for MySQL 8.0
1 parent 9221020 commit 051cfdf

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

run-mysql-8-0.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#! /usr/bin/env bash
2+
3+
SOURCE_DIR=`dirname "${BASH_SOURCE[0]}"`
4+
source "$SOURCE_DIR/common.sh"
5+
6+
set -euo pipefail
7+
8+
kill-existing mysql-8-0
9+
10+
docker run -p 3309:3306 \
11+
-e MYSQL_DATABASE=metabase_test \
12+
-e MYSQL_ALLOW_EMPTY_PASSWORD=yes \
13+
--name mysql-8-0 \
14+
--rm \
15+
-d mysql:8.0
16+
17+
cat <<EOF
18+
Started MySQL Latest on port 3309.
19+
20+
JDBC URL: jdbc:mysql://localhost:3309/metabase_test?user=root
21+
22+
env vars: MB_DB_TYPE=mysql MB_DB_DBNAME=metabase_test MB_DB_HOST=localhost MB_DB_PASS='' MB_DB_PORT=3309 MB_DB_USER=root MB_MYSQL_TEST_USER=root
23+
24+
Clojure CLI:
25+
26+
clj -J-Dmb.db-type=mysql -J-Dmb.db-port=3309 -J-Dmb.db.dbname=metabase_test -J-Dmb.db.user=root -J-Dmb.db.pass=''
27+
28+
or add a profile for it to your ~/.clojure/deps.edn:
29+
30+
{:profiles
31+
{:user/mysql-8-0
32+
{:jvm-opts
33+
["-Dmb.db-type=mysql"
34+
"-Dmb.db-port=3309"
35+
"-Dmb.db.dbname=metabase_test"
36+
"-Dmb.db.user=root"
37+
"-Dmb.db.pass="
38+
"-Dmb.mysql.test.port=3309"]}}}
39+
40+
Connect with the MySQL CLI tool:
41+
42+
mysql --user=root --host=127.0.0.1 --port=3309 --database=metabase_test
43+
44+
EOF

0 commit comments

Comments
 (0)