MySQL is a database management system. A database is a collection of data. It can be anything from a simple grocery list to a picture gallery or the vast amounts of information in a corporate network. Its development process focuses on offering a very efficient implementation of the features most people need. This means that MySQL still has fewer features than its chief open-source competitor, PostgreSQL, or the commercial database engines.
Want uninterrupted development, integration, testing, deployment, and monitoring of enterprise data operations?
Our experts will help enhance data availability, reduce downtime, lower operations costs, and mitigate data risks.
The steps to migrate MySQL database to Google Cloud SQL are:
- Create a file from MySQL server for that login into MySQL server, and go to MySQL dump and then export the database to file with following instructions mysqldump — databases database_name-h localhost -u blog admin -p — hex-blob — skip-triggers — single-transaction — default-character-set=utf8mb4 >database_name.sql
- Now create a cloud storage bucket for that open cloud shell using the following command gsutil MB gs://[bucket-name] Note:bucket-name refers to a Unique Name we have to give.
- Now copy this file in GCP Bucket For that use following command gsutil cp ~/database_name.sql gs://[bucket-name]
- Now In GCP Console, navigate to SQL, click to Create an instance, then click on MySQL and Rename it. Generate the password and click on Create button.
- From the GCP bucket Import, the database into Cloud SQL for SQL Server Following are the steps for importing the database into Cloud SQL:
- Go to Cloud SQL From the GCP console.
- Click on the SQL instance name, then click on the Database tab.
- Create Database.
- Enter the database name, then click on Create.
- Navigate to the overview tab and click on Import.
- In the source field, browse the SQL file from the cloud storage bucket created already.
- Select the format of the file as SQL.
- In the destination field, select the database name which you created just now.
- Click on Import to start the process.