This guide is written for Ubuntu/Debian. If you run any other distribution of linux, this guide may not be for you.

MySQL 5.7 on linux 2015-05-29
A full guide on setting up MySQL version 5.7 on linux. Written by a human, for humans.

Installing MySQL is usually pretty straight-forward, but here's a guide on it anyway.

Dependencies

Before following this guide, there are a few tools you might not already have installed. To ensure all neccesary tools are installed, please enter these commands.

root
apt-get update
apt-get install -y wget

Installation

root
wget http://dev.mysql.com/get/mysql-apt-config_0.7.2-1_all.deb
dpkg -i mysql-apt-config_0.7.2-1_all.deb

After entering the second command, you will be prompted with a screen where you can select what is installed with mysql-server.
Change this to your liking, but for most people, selecting "Ok" and hitting Enter should be just fine.

Now that you've installed mysql-apt-config, you're able to install the latest version of MySQL.

root
apt-get update
apt-get install -y mysql-server

Soon after entering the very last command, you will be prompted to enter a password for the MySQL "root" user.
Because this is a user with full access to the MySQL installation, you will want to pick a very secure password.

By default, MySQL can have some insecure settings only intended for development environments. Luckily it also has a command to secure the installation for production use.

root
mysql_secure_installation

The first command simply ensures you have a root password set, removes anonymous users, disallows remote "root" login and removes a test database that is present in some MySQL versions. The second command will initialize the MySQL daemon.

Thanks for reading!

I hope you were able to follow the guide without any problems, if you have any questions please feel free to contact me!

 

Written by
Alexander Sagen