In a previous blog, I discussed how to pull, install and run MySQL 8.0 with Docker. I showed how to connect to the Docker daemon with MySQL.
Now I will show you how to connect to the same Docker instance using the MySQL Shell which is a tool to use Document Store and to create InnoDB Clusters.
Installing Docker, Starting MySQL, and Connecting using MySQL Shell
First, you grab Docker: https://docs.docker.com/install .
Then, you pull and run MySQL 8.0 (Linux) by running the following. Note that I’m not using a password which is just for testing a fleeting MySQL Docker container:
$ docker run –name mysql8 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -d mysql/mysql-server
Unable to find image ‘mysql/mysql-server:latest’ locally
Run the following command in bold to get the status of your MySQL container. Look for the word ‘healthy’ to know that it is running:
Now you login to your containerized server, connecting with MySQL Shell:
Creating a Classic session to ‘root@/var%2Flib%2Fmysql%2Fmysql.sock’
Please provide the password for ‘root@/var%2Flib%2Fmysql%2Fmysql.sock’:
Fetching schema names for autocompletion… Press ^C to stop.
Your MySQL connection id is 13
Server version: 8.0.12 MySQL Community Server – GPL
No default schema selected; type \use to set one.
MySQL localhost JS >
That’s it! You are now ready to use the MySQL 8.0 Shell to set up your InnoDB Cluster.
To connect with the MySQL 8.0 Shell to use Document Store, connect to the mysqlx daemon:
For more information on MySQL 8.0 Shell, please check here: https://dev.mysql.com/doc/mysql-shell/8.0/en/ .
“The statements and opinions expressed here are my own and do not necessarily represent those of the Oracle Corporation.”
-Kathy Forte, Oracle MySQL Solutions Architect