Getting Started on Linux or Mac - domflannery/mysql-sandbox GitHub Wiki

After you've installed the software from the Required Software page and cloned or downloaded the mysql-sandbox repo, it's pretty easy to use.

First, you'd open a terminal and cd to the location of the sandbox. You'll want to ensure you're in the directory that contains the Vagrantfile. Once there, you can start, stop, destroy vm's as you wish.

Starting db1, db2 and ansible:

user@host ~/projects/mysql-sandbox $ vagrant up

The above command will start all vm's in the Vagrantfile that have autostart: true, which is the default when not specified. db3 is set to not autostart and therefore will not start automatically.

Starting only one vm:

user@host ~/projects/mysql-sandbox $ vagrant up db3

Destroying all vms:

user@host ~/projects/mysql-sandbox $ vagrant destroy

The above command will destroy all running vms. This means that any work or history you've saved on the machines will be gone forever.

Destroying only one vm:

user@host ~/projects/mysql-sandbox $ vagrant destroy db3

Stopping all vm's:

user@host ~/projects/mysql-sandbox $ vagrant halt

The above command will stop (shutdown) all vm's. Running vagrant up again will start them back up for you.

Checking status of VM's:

user@host ~/projects/mysql-sandbox $ vagrant global-status

The above command will tell you the status of VM's running on the host machine.

Accessing the vm's

To access the vm's, open as many terminal tabs as needed and cd to the same directory that the Vagrantfile is in and run the following commands, one for each tab.

user@host ~/projects/mysql-sandbox $ vagrant ssh db1
user@host ~/projects/mysql-sandbox $ vagrant ssh db2
user@host ~/projects/mysql-sandbox $ vagrant ssh ansible

If you did the above correctly, you should have 3 terminal tabs open to each of the three vm's. The db* vm's will be used to play around with MySQL. The ansible vm is used for the setup of MySQL. You're now ready to learn about how to use the special ansible vm to do the MySQL setup.