> For the complete documentation index, see [llms.txt](https://isaac-exe.gitbook.io/various-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://isaac-exe.gitbook.io/various-tutorials/tutorials/3.-mysql/3.5-monitoring-db-instances/deploy-mysql-instances.md).

# Deploy MySQL instances

Deploying three MySQL instances with the help of OCI CLI (for more details on how to proceed with OCI CLI creation for MySQL instance, review ["The basics OCI CLI"](/various-tutorials/tutorials/3.-mysql/3.2-the-basics-oci-cli.md) )

*`Each of the three database has been deployed in a different Availability Domain; Each of these three databases have the same compartmentID and subnetID`*

`Json file for deploying 1st DB database:`

```
root@deploymentmachine:/home/tests/mydb# more mydb1.json
{
  "adminUsername": "usertest",
  "adminPassword": "wildpassw0rd#",
  "compartmentId": "ocid1.tenancy.oc1..aaaaaaaafakecompartmentidfromhereonh3h3h3h3h3",
  "display-name": "MysqlSmallTest1",
  "availabilityDomain": "Aodz:EU-FRANKFURT-1-AD-1",
  "databaseEdition": "STANDARD_EDITION",
  "dataStorageSizeInGbs": 50,
  "dbName": "mysqlTest",
  "dbVersion": "19.6.0.0",
  "description": "Just a small mysql db test",
  "port": 3306,
  "port-x": 33060,
  "hostname": "mysqltest1",
  "listener-port": 1521,
  "node-count": 1,
  "maxWaitSeconds": 0,
  "shapeName": "MySQL.VM.Standard.E3.1.8GB",
  "subnetId": "ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaafakesubnetidfromhereonh3h3h3h3h3""
}
```

`Deploy 1st DB with command:`

```
root@deploymentmachine:/home/tests/mydb# oci mysql db-system create --from-json file://mydb1.json
```

`Json file for deploying 2nd DB database:`

```
root@deploymentmachine:/home/tests/mydb# more mydb2.json
{
  "adminUsername": "usertest",
  "adminPassword": "wildpassw0rd#",
  "compartmentId": "ocid1.tenancy.oc1..aaaaaaaafakecompartmentidfromhereonh3h3h3h3h3",
  "display-name": "MysqlSmallTest1",
  "availabilityDomain": "Aodz:EU-FRANKFURT-1-AD-2",
  "databaseEdition": "STANDARD_EDITION",
  "dataStorageSizeInGbs": 50,
  "dbName": "mysqlTest",
  "dbVersion": "19.6.0.0",
  "description": "Just a 2nd small mysql db test",
  "port": 3306,
  "port-x": 33060,
  "hostname": "mysqltest2",
  "listener-port": 1521,
  "node-count": 1,
  "maxWaitSeconds": 0,
  "shapeName": "MySQL.VM.Standard.E3.1.8GB",
  "subnetId": "ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaafakesubnetidfromhereonh3h3h3h3h3""
}
```

`Deploy 2nd DB with command:`

```
root@deploymentmachine:/home/tests/mydb# oci mysql db-system create --from-json file://mydb2.json
```

`Json file for deploying 3rd DB instance:`

```
root@deploymentmachine:/home/tests/mydb# more mydb3.json
{
  "adminUsername": "usertest",
  "adminPassword": "wildpassw0rd#",
  "compartmentId": "ocid1.tenancy.oc1..aaaaaaaafakecompartmentidfromhereonh3h3h3h3h3",
  "display-name": "MysqlSmallTest1",
  "availabilityDomain": "Aodz:EU-FRANKFURT-1-AD-3",
  "databaseEdition": "STANDARD_EDITION",
  "dataStorageSizeInGbs": 50,
  "dbName": "mysqlTest",
  "dbVersion": "19.6.0.0",
  "description": "Just a 3rd small mysql db test",
  "port": 3306,
  "port-x": 33060,
  "hostname": "mysqltest3",
  "listener-port": 1521,
  "node-count": 1,
  "maxWaitSeconds": 0,
  "shapeName": "MySQL.VM.Standard.E3.1.8GB",
  "subnetId": "ocid1.subnet.oc1.eu-frankfurt-1.aaaaaaaafakesubnetidfromhereonh3h3h3h3h3""
}
```

`Deploy 3rd DB with command:`

```
root@deploymentmachine:/home/tests/mydb# oci mysql db-system create --from-json file://mydb3.json
```

`If no output errors after running command "oci mysql db-system create", check the Oracle Cloud UI:`

![](/files/-MSY_hIUOoJLVfD-uNAZ)

![](/files/-MSYa6tyHtMVw3BqcbH8)

*`Do not forget the Ingress rules for MySQL services:`*

![](/files/-MSYb5MaVZofGvkUm0Sy)

`The  deployed instances have following private IPs:`

**`10.0.0.28, 10.0.0.30, respectively 10.0.0.32`**
