brunch

You can make anything
by writing

C.S.Lewis

by Master Seo Apr 26. 2022

183.Cloud SQL for Mysql생성(1/3)

<1> Cloud SQL for Mysql 생성하기

<2>  Cloud Shell 로 인증과 테이버 베이스 생성하기



<1> Cloud SQL for Mysql 생성하기


1

SQL > 인스턴스 만들기 > MySQL 선택

2

coin-gcp-mysql-dev

g102!


3

개발

서울

단일 영역

인스턴스 만들기

(10분 걸림)




<2>  Cloud Shell 로 인증과 테이버 베이스 생성하기


1

인증

gcloud auth list


프로젝트 확인

gcloud config list project



2

gcloud sql connect coin-gcp-mysql-dev --user=root

Y


Connecting to database with SQL user [root].Enter password:

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 33

Server version: 5.7.36-google-log (Google)

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>



3

CREATE DATABASE guestbook;


4

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!");




5

SELECT * FROM entries;


+--------------+-------------------+---------+

| guestName    | content           | entryID |

+--------------+-------------------+---------+

| first guest  | I got here!       |       1 |

| second guest | Me too!           |       2 |

+--------------+-------------------+---------+

2 rows in set (0.00 sec)

mysql>






다음 자료

https://brunch.co.kr/@topasvga/2399





https://brunch.co.kr/@topasvga/1842



https://brunch.co.kr/@topasvga/2401



감사합니다




매거진의 이전글 (몰아보기) GCP 3탄-1.실습VM,GKE,로드밸런서
브런치는 최신 브라우저에 최적화 되어있습니다. IE chrome safari