Skip to content

Instantly share code, notes, and snippets.

@ebta
Last active January 17, 2022 07:09
Show Gist options
  • Save ebta/eccbe9c514aa6f3434a2878e2102fd7c to your computer and use it in GitHub Desktop.
Save ebta/eccbe9c514aa6f3434a2878e2102fd7c to your computer and use it in GitHub Desktop.
Install MySQL Server on Ubuntu 20.04 LTS

Installing MySQL

Update the package index on your server

sudo apt update && sudo apt upgrade -y

Install MySQL Server

sudo apt install mysql-server

Configuring MySQL

sudo mysql_secure_installation

When aks VALIDATE PASSWORD COMPONENT, just select N, then enter new root password. Remove Anonymous user and test database, Disallow root login remotely = N

Allow Login using old method (phpmyadmin/adminer/etc)

After running mysql_secure_installation, open mysql command prompt, using sudo mysql, then run the following query:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '<password>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment