> For the complete documentation index, see [llms.txt](https://code.janardhanpulivarthi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://code.janardhanpulivarthi.com/google-cloud/cloud-sql.md). Agents can also search and read this documentation through its [MCP server](https://code.janardhanpulivarthi.com/~gitbook/mcp).

# Cloud SQL

## Whitelisting IP address in Cloud SQL

. `patching`.

```bash
gcloud sql instances patch $CSQL_NAME \
  --authorized-networks=$(gcloud compute instances describe $STRIIMVM_NAME --format='get(networkInterfaces[0].accessConfigs[0].natIP)' \
  --zone=$STRIIMVM_ZONE)
```

Cloud SQL provides relational database services for OLTP workloads, but not storage and retrieval of low-latency timeseries data.

## variables in sql

```sql
SET @ARR_DELAY_THRESH = 15;
SET @DEP_DELAY_THRESH = 20;
# Correct - true negative
select count(dest) from flights where arr_delay < @ARR_DELAY_THRESH and dep_delay < @DEP_DELAY_THRESH;
```

## mysqlimport

```bash
mysqlimport --local --host=$MYSQLIP --user=root --password \
--ignore-lines=1 --fields-terminated-by=',' bts flights.csv-*
```
