---
title: "Discussion on \"How to Set up a MySQL Server on Ubuntu 20.04\" | Hashnode"
description: "Discussion on \"How to Set up a MySQL Server on Ubuntu 20.04\". MySQL, a Relational Database Management System (RDBMS), is one of the four open-source building blocks (LAMP) used to set up most web applications. It makes use of the Structured Query Language to manipulate, process, and organise data into useful in..."
url: "https://hashnode.com/posts/how-to-set-up-a-mysql-server-on-ubuntu-2004/637c1dd82b0382694ed642e7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Set up a MySQL Server on Ubuntu 20.04](https://funmifagoyinbo.hashnode.dev/how-to-set-up-a-mysql-server-on-ubuntu-2004?utm_source=hashnode&utm_medium=feed)

MySQL, a Relational Database Management System (RDBMS), is one of the four open-source building blocks (LAMP) used to set up most web applications. It makes use of the Structured Query Language to manipulate, process, and organise data into useful in...

Nov 22, 2022 · 4 min read · funmifagoyinbo.hashnode.dev  
Read the article

-   [#mysql](https://hashnode.com/tag/mysql)
-   [#ubuntu](https://hashnode.com/tag/ubuntu)
-   [#linux](https://hashnode.com/tag/linux)
-   [#linux-for-beginners](https://hashnode.com/tag/linux-for-beginners)
-   [#linux-basics](https://hashnode.com/tag/linux-basics)

## Written by

[Funmilayo Fagoyinbo](https://hashnode.com/@Adefunmilayo)

@Adefunmilayo · Greater Vancouver Metropolitan

  
[View profile](https://hashnode.com/@Adefunmilayo)

DevOps/Cloud Engineering

## Responses 3

Markdown supported · ⌘↵ to post

[Php\_Guider](https://hashnode.com/@phpguider)

[Nov 29, 2024](https://hashnode.com/posts/how-to-set-up-a-mysql-server-on-ubuntu-2004/637c1dd82b0382694ed642e7/comment/674a3b48e617401394bb38f9)

I had a tough time setting up MySQL on my Ubuntu 20.04 server and kept running into roadblocks. I followed a guide on installing MySQL on DigitalOcean, but there were some tricky steps, especially with securing the installation and configuring the root user authentication method.

The main challenge I faced was the authentication method, which uses `auth_socket` by default, and I couldn’t log in properly without changing it. I found the solution to this problem by setting a root password and switching the authentication to `mysql_native_password`. Afterward, I was able to run the `mysql_secure_installation` script to lock down the server's security settings.

Thankfully, I found a helpful guide on **Vultr** that not only clarified the process but also provided essential steps on how to install and secure MySQL on Ubuntu 20.04. The guide includes detailed instructions on setting up the server, including how to handle the root user authentication issues I encountered. It also walks you through creating a database and user with sudo privileges, which helped me finalize the setup.

Here's a summary of how I followed the **Vultr** guide:

1.  I first updated my system with `sudo apt update && sudo apt upgrade -y`.
2.  Then, I installed MySQL with `sudo apt install mysql-server -y`.
3.  Securing MySQL was tricky, but I followed the steps in the guide to change the default `auth_socket` to `mysql_native_password` and then ran `mysql_secure_installation`.
4.  Finally, I created a new database and user with the necessary privileges.

You can check out the full Vultr guide here: [How to Install MySQL on Ubuntu 20.04](https://docs.vultr.com/how-to-install-mysql-on-ubuntu-24-04).

Following this guide helped me set up MySQL securely and avoid the common pitfalls I initially encountered. If you're facing similar issues, I highly recommend this guide as it offers a clear and concise solution.

[Samuel Persis Oladejo](https://hashnode.com/@SPersis)

[Nov 23, 2022](https://hashnode.com/posts/how-to-set-up-a-mysql-server-on-ubuntu-2004/637c1dd82b0382694ed642e7/comment/637e16d0f223b9d332496763)

This is done well

[Goke Akingbade](https://hashnode.com/@Gokea)

[Nov 23, 2022](https://hashnode.com/posts/how-to-set-up-a-mysql-server-on-ubuntu-2004/637c1dd82b0382694ed642e7/comment/637dd2329710bcce88a0068d)

Very informative and educative. Kudos.

[Funmilayo Fagoyinbo](https://hashnode.com/@Adefunmilayo)

[Nov 23, 2022](https://hashnode.com/posts/how-to-set-up-a-mysql-server-on-ubuntu-2004/637c1dd82b0382694ed642e7/comment/637dd2329710bcce88a0068d#reply-637df2e4caae63ceadac0b0e)

Thank you so much, Goke.

[Abdul Barri Lawal](https://hashnode.com/@AbdulBarri)

[Nov 22, 2022](https://hashnode.com/posts/how-to-set-up-a-mysql-server-on-ubuntu-2004/637c1dd82b0382694ed642e7/comment/637ce66d61fd31c3b8e2ad49)

Nice. Very comprehensive.

[Funmilayo Fagoyinbo](https://hashnode.com/@Adefunmilayo)

[Nov 23, 2022](https://hashnode.com/posts/how-to-set-up-a-mysql-server-on-ubuntu-2004/637c1dd82b0382694ed642e7/comment/637ce66d61fd31c3b8e2ad49#reply-637df2ca9710bcce88a00b3f)

Thank you so much, Abdul.
