Installing MySQL 5.7 in Ubuntu 16.04LTS (Note: Things still break in Ubuntu, advisable to move to docker and setup volumes_)
sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.7 mysql-client-core-5.7
sudo rm -rf /etc/mysql /var/lib/mysql
Clean-up
sudo apt-get autoremove
sudo apt-get autoclean
Update-Upgrade
sudo apt update
sudo apt upgrade
sudo apt install mysql-server
sudo apt install mysql-client
sudo mysql_secure_installation
# Follow the questions and proceed accordingly
mysql -u root -p
# To login the first time
# Create a database and also create a user that we would be using to put in our Flask ORM
mysql> CREATE database <database>;
mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
mysql> FLUSH PRIVILEGES;
Relogin the mysql shell with
mysql -u newuser -p