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:
sudo apt update && sudo apt upgrade -y.sudo apt install mysql-server -y.auth_socket to mysql_native_password and then ran mysql_secure_installation.You can check out the full Vultr guide here: How to Install MySQL on Ubuntu 20.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.