- Install Desktop Docker, see
-
Get image from official source
-
Run new container
- create container with name 'mlrun-mysql', use image 'mysql:9.0.1' and open ports 3306:3306
docker run --name mlrun-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=jist -e MYSQL_DATABASE=test -e MYSQL_USER=testuser -e MYSQL_PASSWORD=testpwd -d mysql:9.0.1 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
- or create container with name 'mlrun-mysql', use image 'mysql:latest' and open ports 3306:3306
docker run --name mlrun-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=jist -e MYSQL_DATABASE=test -e MYSQL_USER=testuser -e MYSQL_PASSWORD=testpwd -d mysql:last --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
- NOTE:
- user
testuser
, passwordtestpwd
- user
- create container with name 'mlrun-mysql', use image 'mysql:9.0.1' and open ports 3306:3306
-
Test MySQL in container
- interactive access to the container
docker exec -it mlrun-mysql bash
- login to mysql under the user 'root'
mysql -u root -p
and passwordjist
- show list of users
SELECT user FROM mysql.user;
- show list of databases
show databases;
- switch to use database
test
use test;
- show list of tables
show tables;
- interactive access to the container
- Update
qgate-sln-mlrun.env
, change setting forQGATE_MYSQL
- format
QGATE_MYSQL = mysql+<dialect>://<username>:<password>@<host>:<port>/<db_name>
- see
QGATE_MYSQL = mysql+pymysql://testuser:testpwd@localhost:3306/test
- format
- Note
- List of Dialects
- SQLAlchemy based on MLRun extras see
pip install mlrun[sqlalchemy]
or dependencies.py in MLRun- it required
pip install sqlalchemy~=1.4
- it required
- Dialect pymysql
- it required
pip install pymysql~=1.1
- it required
- Cryptography support
- it required
pip install cryptography~=42.0
- it required
- NOTE
- these are versions valid for MLRun 1.6.2