Terriermon - Digimon

06. Cloud SQL for MySQL

2024. 11. 14. 07:55클라우드/GCP

 

Task 1. Create a Cloud SQL instance

 

 

gcloud sql operations list --instance=myinstance

작업상태 확인

 

 

Task 2. Connect to your instance using the mysql client in Cloud Shell

gcloud sql connect myinstance --user=root

 

Task 3. Create a database and upload data

 

CREATE DATABASE guestbook;

 

USE guestbook;

CREATE TABLE entries (guestName VARCHAR(255), content VARCHAR(255),

    entryID INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(entryID));

    INSERT INTO entries (guestName, content) values ("first guest", "I got here!");

INSERT INTO entries (guestName, content) values ("second guest", "Me too!");

 

 

 

SELECT * FROM entries;

 

 

 

 

 

 

 

 

 

참고:  https://www.cloudskillsboost.google/focuses/936?catalog_rank=%7B%22rank%22%3A1%2C%22num_filters%22%3A0%2C%22has_search%22%3Atrue%7D&parent=catalog&search_id=39487679

반응형

'클라우드 > GCP' 카테고리의 다른 글

08. Service Accounts and Roles: Fundamentals  (0) 2024.11.16
07. Cloud Shell and gcloud  (0) 2024.11.15
05. Cloud IAM  (0) 2024.11.13
04. VPC Networking Fundamentals  (0) 2024.11.12
03. Cloud Storage  (0) 2024.11.11