Create MySQL Instance on GCP:- Instance info
Step1. Go to GCP Portal:
— SQL
— Create Instance
— Choose MySQL
— Instance ID or Name
— Enter Passwords
— Database Version
— Choose a configuration to start with - Production
— Choose a Cloud SQL edition - Enterprise
— Region - asia-south1 (Mumbai)
— Zonal Availability - Single zone or Multiple zones (highly available)
— Specify Zones - asia-south1-a, asia-south1-b
Customize your instance:
Machine configuration:
— 1 vCPU, 3.75GB (Dedicated core)
Storage: Type SSD
— 500GB (Storage type SSD)
— Enable automatic storage increases as per tickets
Connections:
Instance IP assignment
— Private IP
— Network - production-vpc-2
Data protection:
— Enable Automate daily backups
— Number of backups - 7
— Backup window - 20:30 — 00:30
— Choose where to store your backups
— Region - asia-south2 (Delhi)
— Enable point-in-time recovery
— Days of logs - 7
Maintenance:
— Maintenance window - Any window
— Order of update -Any
— Deny maintenance period - Repeat every year
Flags: Leave it.
Query insights:
— Enable query insights (just tick mark ✅ if require from client end or as per tickets)
Labels:
— Owner
— Tickets
— Projects
— Units
Create Below two users:
Step2. Go to GCP Portal:
— SQL
— prod-in
— Click on Users
— + Add User Account
— User_Name — prod_user
— Password — 6xxxxxxxxxxxxxxxxxxxxxxxxxxxx
— Add
— User_Name — prod_byk_service_user
— Password — 9xxxxxxxxxxxxxxxxxxxxxxxxxxxx
— Add
Give below permissions
prod_user — READ, WRITE & LOAD DATA INFILE
prod_byk_service_user — READ_ONLY
Create Database:
Step3. Go to GCP Portal:
— SQL
— db-prod-in
— Database
— Create database
— Name — db_prod_in
— Create
++++++++++++++++++++++++++++++++++++++++
Command Line Interface:
Please run below commands
$ create user ‘prod_user’ IDENTIFIED BY '6YE18KJKAK8x0SG04K';
$ grant select on db_prod_in.* to "prod_user";
$ show grants for 'prod_user';
$ grant select, insert, update, delete, alter on db_prod_in.* to 'prod_user’@‘%’ IDENTIFIED BY '6xxxxxxxxxxxxxxxxxxx';
$ create user ‘db_byk_service_user’ IDENTIFIED BY '9xxxxxxxxxxxxxxxxxxxx';
$ grant select on db_prod_in.* to "db_byk_service_user";
$ show grants for 'db_byk_service_user';
$ create database db_prod_in;
$ use database db_prod_in;
$ show databases;
++++++++++++++++++++++++++++++++++++++++
-- Connect to MySQL and execute the following commands
$ create user ‘raghunath_user’@‘%’ IDENTIFIED BY ‘password12345’;
-- Create user
$ create database ’sql_prod’;
-- Create database
$ grant select on `sql_prod`.* to 'raghunath_user'@'%';
-- Grant read-only access to the user for the database
$ create user ‘raghunath_user’@‘%’ IDENTIFIED BY 'password12345'; -
- Create user
$ create database 'sql_prod';
-- Create database
$ grant select, insert, update, delete, alter on `sql_prod`.* to 'raghunath_user'@'%'; -- Grant full access to the user for the database
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ConversionConversion EmoticonEmoticon