We will be using the sakila database extensively inside the rest of the course and it would be great if you can follow the installation process below.
Importing the Sakila Database
// Change the File
Find and Replace all "InnoDB" with "MyISAM" in the schema file - different database engine - Full text - so don't have to upgrade
// MySQL用我的host03.xyy上安装了mysql数据库,所以在host03上做
mysql -u root -p
root
SOURCE /home/cloudera/Spark/sakila-db/sakila-schema.sql
SOURCE /home/cloudera/Spark/sakila-db/sakila-data.sql
SHOW FULL TABLES;
DROP VIEW actor_info;
DROP VIEW customer_list;
DROP VIEW film_list;
DROP VIEW nicer_but_slower_film_list;
DROP VIEW sales_by_film_category;
DROP VIEW sales_by_store;
DROP VIEW staff_list;
// Hive在host03机器上切换到hdfs用户,然后执行hive,进入hive命令行
CREATE DATABASE sakila;
// Terminal在03机器上使用hdfs用户进入,执行如下命令,否则找不到驱动程序。
sqoop import-all-tables --connect "jdbc:mysql://host03.xyy:3306/sakila" --username root --password root --hive-import --hive-database sakila