Blazor is a .NET web framework from Microsoft using C#/Razor and HTML that runs in the browser with Web Assembly. Blazor provides all the benefits of a client-side web UI framework using .NET on the client and optionally, on the server.
I have already written many articles on Blazor on C# Corner. If you are new to it, please refer to the below articles to get started with Blazor.
Create Google Cloud SQL instance with MySQL engine
You must create a Google Cloud account before starting it. Currently, Google provides a one-year free membership with $300 credits.
Log into Google Cloud console with your Google credentials.
Please select a project if you have any. Otherwise, you can click the “New Project” button to create a new project.
Choose a unique name for your project and click the “Create” button to start project creation.
Your project will be ready in a few minutes. You can choose the project and it will list the project details on the dashboard.
We can create the Cloud SQL instance now. Please choose the SQL tab from the left side menu.
Click the “Create Instance” button to proceed.
Currently, Google Cloud SQL supports MySQL and PostgreSQL engines. Here, we have selected the MySQL engine.
We can give a valid instance name and give a password to the “root” user. Please note this is a default user. We can later change the password if needed. We can also create multiple users on a later stage. Here, I have chosen “asia-south1” region. You can choose your convenient region.
It will take some time to create the instance. Before connecting this instance with MySQL workbench, you must add your local IP address to the Cloud SQL authorized networks. You can open the "Connections" tab to add your local IP address.
Add your local IP address and "Save".
Now, we can connect the instance from MySQL client. Here, we are using MySQL Workbench 8.0 Community Edition. It is a very good and free SQL Editor. We can give the instance details and test the connection.
Our connection is successful now.
Open the SQL editor and create a database and table in the Cloud SQL instance.
- CREATE DATABASE sarathcloudsql;
- USE sarathcloudsql;
- DROP TABLE IF EXISTS Book;
- CREATE TABLE Book
- (Id VARCHAR(50) PRIMARY KEY,
- Name VARCHAR(50),
- ISBN VARCHAR(50),
- Author VARCHAR(50),
- Price DECIMAL(18,8));