Once you've created a Google Cloud Console account follow these steps to create a free DB:
- Create a project
- Go to the Market place and search for MYSQL Bitnami and select MYSQL packaged by Bitnami and click launch.
- Configure it with the cheapest possible options. Should be $5.65 if you select SSD for storage.
- 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
- Edit the file and change
bind-address=127.0.0.1
tobind-address=0.0.0.0
. This configures your MySQL installation to allow remote connections. - Restart the mysql server by running:
sudo /opt/bitnami/ctlscript.sh restart mysql
- Now we need a static IP address so go to VPC Networks -> External IP Addresses. For your MySQL deployment change the type from
Ephemeral
toStatic
. Fill the prompt and submit. - 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
- 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)