Time for action – installing and setting up MySQL
Let's get MySQL installed and configured with the basic databases and access rights.
- On an Ubuntu host, install MySQL using
apt-get
:$ apt-get update $ apt-get install mysql-server
- Follow the prompts, and when asked, choose a suitable root password.
- Once installed, connect to the MySQL server:
$ mysql -h localhost -u root -p
- Enter the root password when prompted:
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 40 … Mysql>
- 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)
- Create a user account with full access to the database:
Mysql> grant ...
Get Hadoop: Data Processing and Modelling 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.