MySQL database server is the most popular database server used online today. It is used with the LAMP stack to power majority of the websites and blogs running online. This brief tutorial is going to show you how to install the latest community version of MySQL on Ubuntu 17.04.
Since Oracle purchased the previous parent company of MySQL, it has gone through multiple updates. There are basically two editions.. one is paid with full support from Oracle and the other is a community edition that’s released under GNU General Public License.
The community version is the one found in most Linux distributions. Without wasting any more of your time, let’s get going with installing MySQL latest community version.
Step 1: Add MySQL Repository
Before you can begin installing the latest community version of MySQL, you must first add its developer’s repository. This repository contains the latest packages for MySQL. To add it on Ubuntu systems, run the commands below to download the repository file.
cd /tmp && wget https://dev.mysql.com/get/mysql-apt-config_0.8.3-1_all.deb
Take notes of the highlighted version number in the file’s name. (0.8.3-1). This may change in the future when a newer version of the file is released.
After downloading the file, run the commands below to install it.
sudo dpkg -i mysql-apt-config_0.8.3-1_all.deb
During the repository package installation, you’ll be asked to select the MySQL to install. Leave the default and just select OK.
Step 2: Installing MySQL Community Edition
After installing the repository, run the commands below to install MySQL community edition.
sudo apt-get update sudo apt-get install mysql-community-server
During the installation, you’ll be prompted to create and confirm MySQL root users password. Please create and confirm a password to use whenever you wish to login to the database server.
When then installation is done, the latest version of MySQL should be installed and ready to use. The commands below shows new users and students how to stop, start and enable MySQL servers.
sudo systemctl stop mysql.service sudo systemctl start mysql.service sudo systemctl enable mysql.service
That’s it! This is how one installs MySQL latest community edition on Ubuntu 17.04
To logon to the MySQL server, run the commands below
sudo mysql -u root -p
Type the root user password and you should see MySQL welcome screen as shown below
Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 3 Server version: 5.7.18 MySQL Community Server (GPL) Copyright (c) 2000, 2017, 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>
This posts shows students and new users an easy way to get the latest community version of MySQL on Ubuntu systems. Since MySQL is the most popular database server in used today, you may certainly come across it, and if you do, this post will come in handy.
Until then, please stay tuned for our upcoming tutorials.
You may also like the post below: