Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Magento 2 Cookbook

You're reading from   Magento 2 Cookbook Exploring Magento 2 in the form of recipes

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher
ISBN-13 9781785887062
Length 342 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. Installing Magento 2 on Apache and NGINX FREE CHAPTER 2. Magento 2 System Tools 3. Enabling Performance in Magento 2 4. Creating Catalogs and Categories 5. Managing Your Store 6. Creating a Magento 2 Theme 7. Creating Magento 2 Extensions – the Basics 8. Creating Magento 2 Extensions – Advanced Index

Installing MySQL

Throughout the following recipes, we will install the latest MySQL 5.7.x version on Apache and NGINX. The current MySQL version is a milestone in the open source world. Its new performance and scalability features will be a great benefit for every Magento website. This recipe will show you how to do it.

Tip

MySQL 5.7 is an extremely exciting new version of the world's most popular open source database, which is two times faster than MySQL 5.6 while also improving usability, manageability, and security.

Getting ready

For this recipe, you will need a preinstalled Apache or NGINX and PHP-FPM or HHVM setup. No other prerequisites are required.

How to do it...

Before we can install the latest MySQL version, we need to download the software in our local system. The official MySQL APT repository provides you with a simple and convenient way to install and update MySQL products. Always use the latest software package using apt-get.

  1. We will now install MySQL using the official vendor package. Run the following command from your root or home directory:
    wget http://dev.mysql.com/get/mysql-apt-config_0.5.3-1_all.deb
    
  2. To download the rest of the latest MySQL package, we first install the mysql-apt-config package. Run the following command:
    dpkg -i mysql-apt-config_0.5.3-1_all.deb
    

    During installation, it will ask which MySQL product you wish to configure. Select Server:

    How to do it...

    Next, it will ask which Server version you wish to receive. Select mysql-5.7:

    How to do it...

    In the next screen, click on Apply:

    How to do it...
  3. Now, we will update our Ubuntu system using the latest MySQL packages:
    apt-get update && apt-get -y install mysql-server
    
  4. During installation, it will ask you several questions. The first one will be to choose a new password for the MySQL root user. Always make sure to create a new dedicated user only for a database; using root is just an example and not advised on production.
  5. Once every MySQL package is installed, we can check whether everything is in order by running the following command on the shell:
    mysql --version
    

    The output of this command is as follows:

    root@mage2cookbook:~# mysql --version
    mysql  Ver 14.14 Distrib 5.7.9, for Linux (x86_64)
    

How it works…

Let's recap and find out what we did throughout this recipe. In steps 1 through 3, we download the official MySQL package and use a graphical interface to install the latest version. The whole process is pretty straightforward. Remember to use a dedicated user that has all the privileges instead of the root user.

There's more…

If you want to check whether MySQL is running fine, use one of the following commands:

service mysql status
netstat -anp | grep mysql

After the MySQL server installation is finished, you can log in on the shell using the following command:

mysql -u root -p
You have been reading a chapter from
Magento 2 Cookbook
Published in: Mar 2016
Publisher:
ISBN-13: 9781785887062
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image