The Debian 8 default repositories contain MySQL packages. You can simply install MySQL on Debian 8 Jessie machine with few simple commands. But the default repositories don’t contain the latest MySQL version. So this tutorial will help to install MySQL on Debian 8 Jessie system with the latest version. Go through the step by step tutorial for the MySQL installation.
Step 1 – Prerequisites
Login to your Debian 8 system using shell access. For remote systems connect with SSH. The Windows desktop users can use Putty any other SSH client to connect their server.
Run below commands to upgrade the current packages to the latest version.
sudo apt update sudo apt upgrade
Step 2 – Setup MySQL PPA on Debian 8
Download the MySQL PPA configuration package from the official website of MySQL. The below commands will do the MySQL PPA setup on Debian 8 automatically.
wget http://repo.mysql.com/mysql-apt-config_0.8.9-1_all.deb sudo dpkg -i mysql-apt-config_0.8.9-1_all.deb
With the installation of above package, this will prompt to select MySQL version to install on your system. Select the MySQL 5.7 or 5.6 to install on your system.
Step 3 – Install MySQL on Debian 8
You are ready now for the MySQL installation on a Debian 8 Jessie machine. Execute the following commands to install MySQL on a Debian 8 machine.
sudo apt update sudo apt install mysql-server
The installation process will prompt for the root password to set as default. Input a secure password and same to confirm password window. This will be MySQL root user password required to log in to MySQL server.
Step 4 – Secure MySQL Installation
Execute the below command on your system to make security changes on your Database server. This will prompt some questions. The do the high security provide all answers to yes.
Step 5 – Connect MySQL
Your system is ready with the MySQL database server. Simply connect to the MySQL using command line client. This will require the root password configured in step 3 to connect database server.
mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.21 MySQL Community Server (GPL) Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>