Cloud SQL is a default choice for those OLTP or Online Transaction Processing workloads on Google Cloud.
gcloud sql instances create taxi \
--tier=db-n1-standard-1 --activation-policy=ALWAYS
gcloud sql users set-password root --host % --instance taxi \
--password Passw0rd
export ADDRESS=$(wget -qO - http://ipecho.net/plain)/32
gcloud sql instances patch taxi --authorized-networks $ADDRESS
MYSQLIP=$(gcloud sql instances describe \
taxi --format="value(ipAddresses.ipAddress)")
echo $MYSQLIP
mysql --host=$MYSQLIP --user=root \
--password --verbose
mysql --host=$MYSQLIP --user=root \
--password --verbose
Now you'll copy the New York City taxi trips CSV files stored on Cloud Storage locally. To keep resource usage low, you'll only be working with a subset of the data
gsutil cp gs://cloud-training/OCBL013/nyc_tlc_yellow_trips_2018_subset_1.csv trips.csv-1
gsutil cp gs://cloud-training/OCBL013/nyc_tlc_yellow_trips_2018_subset_2.csv trips.csv-2
mysqlimport --local --host=$MYSQLIP --user=root --password \
--ignore-lines=1 --fields-terminated-by=',' bts trips.csv-*
mysql --host=$MYSQLIP --user=root --password