This repository contains the packaging metadata for creating a rock of MySQL built from the official ubuntu MySQL package from the Ubuntu repository and further installs mysql-shell. For more information on rocks, visit the rockcraft repository.
The steps outlined below are based on the assumption that you are building the rock with the latest LTS of Ubuntu. If you are using another version of Ubuntu or another operating system, the process may be different.
git clone https://github.com/canonical/mysql-rock.git
cd mysql-rocksudo snap install rockcraft --classic --edge
sudo snap install docker
sudo snap install lxdsudo usermod -aG docker $USER
sudo lxd init --autorockcraft pack
rockcraft.skopeo --insecure-policy copy oci-archive:mysql*.rock docker-daemon:<username>/mysql:<tag>
docker run --rm -it --name mysql-container -p 30306:3306 -e MYSQL_ROOT_PASSWORD=myS3cr3tp@ss <username>/mysql:<tag>From inside the container (using socket):
docker exec -it mysql-container mysql --socket=/var/run/mysqld/mysqld.sock --user=root --password=myS3cr3tp@ssFrom outside the container:
sudo apt install -y mysql-client
mysql -h 127.0.0.1 --password=myS3cr3tp@ss --port=30306 --user=rootTroubleshooting:
docker exec -it mysql-container pebble logs
docker exec -it mysql-container pebble services
docker exec -it mysql-container pebble restart postgresUsing Spread:
rockcraft test # run all tests
ls -la spread/tests/ # list all tests
rockcraft test -- spread/tests/smoke # run one test suite
rockcraft test --debug # to open shell for failed test
rockcraft test --shell-after # to open shell after each stepThe MySQL rock is free software, distributed under the Apache Software License, version 2.0. See LICENSE.