Time for action – installing and setting up MySQL

Let's get MySQL installed and configured with the basic databases and access rights.

  1. On an Ubuntu host, install MySQL using apt-get:
    $ apt-get update
    $ apt-get install mysql-server
    
  2. Follow the prompts, and when asked, choose a suitable root password.
  3. Once installed, connect to the MySQL server:
    $ mysql -h localhost -u root -p
    
  4. Enter the root password when prompted:
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 40
    
    Mysql>
    
  5. Create a new database to use for the examples in this chapter:
    Mysql> create database hadooptest;
    

    You will receive the following response:

    Query OK, 1 row affected (0.00 sec)
    
  6. Create a user account with full access to the database:
    Mysql> grant ...

Get Hadoop Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.