Steps To Create A MySQL DB With Cloud SQL ?
Step 1: Open your Google cloud Account
Step 2: In the Google Cloud Console, on the Navigation menu , click Databases > SQL.(encircled in red)
Step 3: Click create instance then If you see 3 database engines such as MySQL, PostgreSQL & SQLserver, choose MySQL.
Step 4: Fill up the space of Instance ID(an ID given to the database instance for identification that you are going to create) as per your choice. Read the rules that are mentioned above the box for maintaining them while giving your instance ID.Then set a root password of your choice else if you don’t know any you can also click the GENERATE option but don’t forget to copy it as for accessing your DB you will need it in the future . It is necessary for protecting your database from getting tampered.
Step 5: Select the presents from the dropdown as your preferred criteria
Step 6: Then choose the region which you find suitable for the best performance of your application , if the region is set by default for recommendation leave it unchanged.
Step 7: Click Show configuration options to expand the configuration options, if you want to configure your database else leave it as default.
Step 8: Under the Connectivity section ensure that Public IP box is checked. By checking this box, Google Cloud will create an IP address that you can use to connect your AppSheet account to the database instance.Then Click Add network.
Step 9: Then scroll down at the end of the page see CREATE option click that and wait until instance is created
Step 10: When you see the green tick as shown in the encircled part of the picture, this indicates that you MySQL instance is ready
Step 11: Click the Cloud Shell icon in the upper right corner.Click Continue.
Step 12: Enter the command used for letting the cloud shell connect your MySQL instance. In the picture below in place of myinstance you will enter your SQL instance name that you created earlier
Step 13: Then you will get the authorization notification,for that click AUTHOIZE .
The output will be like the below picture on the cloud shell screen. Enter the password that you generated or entered of your choice so that your instance can be accessed by the cloud shell.
But after entering the password the place where you entered it will appear black making you think whether it is some glitch or not but no worries passwords aren’t visible on the cloud shell screen
Step 14: Now something like this will appear.
Step 15:
here in place of guestbook you will give the name you want to give to your database or as you are instructed to.
Step 16: The output will be similar to the picture below
Step 17: This means that you are inserting data into the database . Texts In bracket are the entries made into the database you created in the earlier step.So the texts within the bracket are of your own choice , depending on what entry you want to make in the RDBMS.
Step 18: Enter the commands excluding the texts in bracket of the below picture. The texts within brackets are the data, but the data varies from project to project so the data will be of your own , don’t copy them blindly.
CREATE TABLE means creating a table with entries of the text in brackets, CONTENT means what the content will be , INSERT means inserting the data. All these are a part of SQL Commands which you need to learn.
Output:
Now exit the cloud shell and got to the left pane of the MySQL page, click DATABASE to view the database that you created.
How to Create a MySQL Database with Cloud SQL on Google Cloud Platform?
The collection of all the data used for the proper functioning of our product is called a need database (DB) and the system that manages the DB is called a need Database Management System(DBMS).