If you need a database server to manage your data and share with your team, the server needs to be live. Google Cloud offers free $300 for each person for a year. Here are the steps for that.
- Create a Google Cloud account: Go to cloud.google.com. You will need to register for a payment method. As a student, you can use your student card (because it is a VISA card.) Google will deduct a dollar from your card and return it back, therefore you don’t have to pay anything.
- Google Console: Once your account is ready, go to Google Console and choose SQL from Storage category.
- MySQL or PostgreSQL: At the time I am writing this, PostgreSQL is still beta in Google Cloud, so let’s use MySQL. Now provide details about your database. When the details are completed, click on Create an Instance. Important information includes
- hostname must be unique.
- root password
- zone can just be left as default.
- It will take a while to create a VM and related resources (such as storage, network, etc) for you. The console will notify you once it is ready. A MySQL instance has an external IP address which can be used for connecting.
- Authorize the Network: By default, the machine cannot be accessed in anyway. You will need to authorize the allowed IP to access your instance. Providing 0.0.0.0/0 will allow anyone to connect to you. The only security measurement left is the password. Beware.
- Test connection: Launch Cloud Shell by clicking the button on the top blue toolbar. The shell is a temporary VM which you can use it to manage several stuff on Google Cloud.
Now enter this command
mysql -u root -p -h 184.108.40.206
where 220.127.116.11 is your MySQL IP address. You will be prompted for password. Enter the password to get into the instance and try some commands such as, show databases; to confirm that your MySQL is up and running just fine.
Google charges hourly; for a standard MySQL instance costs around $0.30 per hour. Therefore, stop the instance once you don’t use it.