How to migrate an MySQL database to Cloud SQL

The steps to migrate MySQL database to Google Cloud SQL are:

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. 

Download our ebooks

Get directly to your inbox


The steps to migrate MySQL database to Google Cloud SQL are: 
  1. 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      
  1. 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.   
  1. Now copy this file in GCP Bucket For that use following command gsutil cp ~/database_name.sql gs://[bucket-name]   
  1. 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.  
  1. 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.    

iSmile technologies offers free consultation with an expert, talk with an expert now  

Get free consultation from our tech experts

Get free consultation from our tech experts

Schedule a discussion
Get free consultation from our tech experts
Get free consultation from our tech experts

Related articles you may would like to read

Connect With Us

Request a Consultation