Skip to content
Follow
CMS Ubuntu Linux

How to Install MySQL or MariaDB on Google Cloud Server

Richard
Written by
Richard
Nov 27, 2021 Updated Jul 14, 2026 3 min read
How to Change Default Apps in Ubuntu
How to Change Default Apps in Ubuntu

Installing MySQL or MariaDB on a Google Cloud server running Ubuntu Linux sets up a powerful database for your website.

MySQL and MariaDB are widely used, free database systems that store your website’s changing information. Many websites, like those built with WordPress, need these databases to work correctly.

This guide helps you get either MariaDB, a popular alternative to MySQL, or MySQL itself running on your cloud server. You’ll learn how to make sure your website’s data is stored safely and managed well. MariaDB, for example, works exactly like MySQL, making the switch easy.

⚡ Quick Answer

Install MySQL or MariaDB on your Ubuntu Google Cloud server by connecting via SSH and using apt-get commands. Update package lists with sudo apt-get update, then install your chosen database with sudo apt-get install mysql-server or sudo apt-get install mariadb-server.

How to connect to the Google Cloud server

Connecting to Your Google Cloud Server. Connecting to your Google Cloud server is possible using the SSH tool built right into your web browser via the Google Cloud Console. This tool works with major browsers like Chrome, Firefox, Edge, and Safari, letting you access your server without needing to install any extra software.

SSH from the browser supports these web browsers:

  • Web browsers
    • The latest version of Google Chrome
    • Firefox
    • Microsoft Edge
    • Microsoft Internet Explorer 11 and later
    • Safari 8 and later. Note that Safari is not supported in private browser mode.
  • Virtual machine configurations
    • All Linux VM images are natively available in Google Cloud.

No additional software or browser extensions are needed. Log in to the Google Cloud Console and navigate to Menu > Compute Engine > VM instances.

In the list of virtual machine instances, click SSH in the row of the instance you want to connect to.

Establishing an SSH connection to a Google Cloud VM instance
establish ssh connection to vm instances

Alternatively, you can open an SSH connection to an instance by clicking its name and SSH from the instance details page.

An SSH terminal window with the Ubuntu Linux instance created in the series’s second post will open.

You should now be able to run commands in Ubuntu Linux created on the Google Cloud server.

Terminal window connecting to a Google Cloud server host instance
connect to google cloud instance host

How to install a database server on Google Cloud Servers

Installing a database server, such as MySQL or MariaDB, on your Google Cloud server is done using Ubuntu’s package manager. Once set up, you can store your website’s content in the database, which then works with your domain name to make your website function correctly.

How to install MySQL or MariaDB on Ubuntu Linux

Content can be stored within a database once a database server is installed and your domain name is pointing to your Google Cloud server.

A website uses a web server, PHP language, and database server to function online. These three components connect their tasks: the web server handles visitor requests, PHP processes dynamic content, and the database stores website information.

We’re now ready to configure our servers and packages to get the website going.

📝Good to Know
Please stay tuned and continue reading up on our previous posts.

Conclusion:

To wrap up, setting up a MySQL or MariaDB database on your Google Cloud Ubuntu server is a key step in building your website. Following the steps outlined in this guide, you can efficiently manage your database needs and ensure your content is stored securely. Here are the key takeaways:

  • Establishing a web and database server is essential for running dynamic websites and CMS platforms.
  • Google Cloud offers user-friendly SSH access to connect to your virtual machines.
  • MySQL or MariaDB can be installed easily using Ubuntu’s default repositories and apt-get commands.
  • Each step in this series builds on the previous one, culminating in a fully operational website.
📝Good to Know
Stay tuned for our next post, where we will delve deeper into configuring your servers and finalizing your website setup!

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Install Additional Software on Ubuntu
Ubuntu Linux How to Install Additional Software on Ubuntu
How to Setup WordPress with Nginx and Cloudflare on Ubuntu
CMS How to Setup WordPress with Nginx and Cloudflare on Ubuntu
How to Install Drupal with Nginx and Cloudflare on Ubuntu
CMS How to Install Drupal with Nginx and Cloudflare on Ubuntu
How to Use Microsoft Edge in Another Language
Windows How to Use Microsoft Edge in Another Language

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *