How To Install MySQL on Ubuntu 16.04 LTS




MySQL DBA Online Training by Edureka
MySQL_install

In this post we will learn how to How To Install MySQL on Ubuntu 16.04 LTS. The same procedure can be used for installing MySQL  on Ubuntu 14.04 LTS.
But first lets see What is MySQL :

  • MySQL is a very popular, open source database.
  • Officially pronounced “my Ess Que Ell” (not my sequel).
  • Handles very large databases;  very fast performance.
  • Why are we using MySQL?
    • Free (much cheaper than Oracle!)
    • Each student can install MySQL locally.
    • Easy to use Shell for creating tables, querying tables, etc.
    • Easy to use with Java JDBC

Step 1: Install MySQL

While installing MySQL, it will promt you to create a root password .  At this stage please select a safe and secure password . Make sure you remember the password, to use it later.

Video Instructions


Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


  • Montagne Fergusan

    I love this TUTORIAL very EASy to Learn

  • Step 1 — Installing MySQL
    On Ubuntu 16.04, only the latest version of MySQL is included in the APT package repository by default. At the time of writing, that’s MySQL 5.7

    To install it, simply update the package index on your server and install the default package with apt-get.

    sudo apt-get update
    sudo apt-get install mysql-server
    You’ll be prompted to create a root password during the installation. Choose a secure one and make sure you remember it, because you’ll need it later. Next, we’ll finish configuring MySQL.

    Step 2 — Configuring MySQL
    For fresh installations, you’ll want to run the included security script. This changes some of the less secure default options for things like remote root logins and sample users. On older versions of MySQL, you needed to initialize the data directory manually as well, but this is done automatically now.

    Run the security script.

    mysql_secure_installation
    This will prompt you for the root password you created in Step 1. You can press Y and then ENTER to accept the defaults for all the subsequent questions, with the exception of the one that asks if you’d like to change the root password. You just set it in Step 1, so you don’t have to change it now. For a more detailed walkthrough of these options, you can see this step of the LAMP installation tutorial.

    To initialize the MySQL data directory, you would use mysql_install_db for versions before 5.7.6, and mysqld –initialize for 5.7.6 and later. However, if you installed MySQL from the Debian distribution, like in Step 1, the data directory was initialized automatically; you don’t have to do anything. If you try running the command anyway, you’ll see the following error:

    Output
    2016-03-07T20:11:15.998193Z 0 [ERROR] –initialize specified but the data directory has files in it. Aborting.
    Finally, let’s test the MySQL installation.

    Step 3 — Testing MySQL
    Regardless of how you installed it, MySQL should have started running automatically. To test this, check its status.

    systemctl status mysql.service
    You’ll see output similar to the following:

    Output
    ● mysql.service – MySQL Community Server
    Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en
    Active: active (running) since Wed 2016-11-23 21:21:25 UTC; 30min ago
    Main PID: 3754 (mysqld)
    Tasks: 28
    Memory: 142.3M
    CPU: 1.994s
    CGroup: /system.slice/mysql.service
    └─3754 /usr/sbin/mysqld
    If MySQL isn’t running, you can start it with sudo systemctl start mysql.

    For an additional check, you can try connecting to the database using the mysqladmin tool, which is a client that lets you run administrative commands. For example, this command says to connect to MySQL as root (-u root), prompt for a password (-p), and return the version
    businesslearning.home.blog