Install MySQL on Ubuntu 18.04

Run the following script to install MySQL on Ubuntu 18 LTS.


# we must be root to install packages
if [[ $EUID -ne 0 ]]; then
   echo "This script must be run as root" 1>&2
   exit 1

# prevent installer from asking questions
export DEBIAN_FRONTEND=noninteractive

# install mysql
apt-get -y install mysql-server python3-mysqldb