DEV Community

Emmanuel
Emmanuel

Posted on • Updated on

Create a Free DB on Google Cloud

Once you've created a Google Cloud Console account follow these steps to create a free DB:

  1. Create a project
  2. Go to the Market place and search for MYSQL Bitnami and select MYSQL packaged by Bitnami and click launch.
  3. Configure it with the cheapest possible options. Should be $5.65 if you select SSD for storage.
  4. Once the deployment is done take note of the Admin User and Password click SSH and enter the following command to edit your MySQL config: sudo nano /opt/bitnami/mysql/conf/my.cnf
  5. Edit the file and change bind-address=127.0.0.1 to bind-address=0.0.0.0. This configures your MySQL installation to allow remote connections.
  6. Restart the mysql server by running: sudo /opt/bitnami/ctlscript.sh restart mysql
  7. Now we need a static IP address so go to VPC Networks -> External IP Addresses. For your MySQL deployment change the type from Ephemeral to Static. Fill the prompt and submit.
  8. Next, we need to allow external IPs access our VM. So still under VPC Networks go to Firewall and Click Create Firewall rule. a. Enter the name and description b. For targets select All instances in the network c. For source IP ranges enter 0.0.0.0/0 d. For protocols and ports click Allow All e. Leave the rest as is and click Create
  9. Now we can test our MySQL Database connection using TablePlus. a. Host will be the static IP address from step 6 b. Port is 3306 c. User and Password will be the credentials from step 4

That's it! If everything goes right then we have a Free MySQL DB that should cost almost nothing till things get really serious.

Top comments (0)