クラウドインフラ構築記

現在AWSの構築支援に携わっております。今注視しているのは、GKE、BigQuery、Google Dataflowなどサービスを展開しているGoolge Cloud Platformです。

CloudSQL Second Edition を試してみました。


Cloud SQL Second Editionの特徴から

  • On Demand activation policy サポートされていない。Always On/Off
  • IPv6 未サポート
  • Storage Engineは、InnoDB
  • GTID replication
  • MySQL 5.6/5.7 デフォルトは5.7
  • ディスク自動拡張

First Generationだと、UIからDBユーザを作成できたのですが、Second Editonではrootのパスワード変更以外DBユーザは作成できなくなっています。
For Second Generation instances, you cannot create and administer MySQL user accounts and databases from the console. You use the MySQL Client administration tool to manage users and databases.

x16 CPUを使用する場合、Amazon Auroraよりパフォーマンスが優れている結果も。

インスタンスを作成後、rootパスワードを設定

gcloud sql instances set-root-password [INSTANCE_NAME] --password [ROOT_PASSWORD]

Cloud Shellからだと、自動的に許可ネットワークに追加してくれます。

gcloud beta sql connect [INSTANCE_ID] --user=root
create database webdb default character set utf8

First Generationで使用していたユーザを作成する

create user cmsuser identified by 'passworsd'
grant all privideges on webdb.* to `cmsuser`@`%`

First Generationのデータベースをエクスポート

※エクスポートするデータベースを指定。指定しないとmysql等システムデータベースもインポートしようとします。

 

コメントは受け付けていません。