Basic MySQL Setup on Ubuntu Server

Install MySQL on Ubuntu

It is pretty simple to install MySQL on Ubuntu:

sudo apt-get update
sudo apt-get install mysql-server
mysql_secure_installation

Access the Database

Login to the database

mysql -u root -p

Basic Usage

Show all the databases

SHOW DATABASES;

Create a database

CREATE DATABASE database_name;
SHOW DATABASES;
DROP DATABASE database_name;
USE database_name;
SHOW tables;