Steps to install mysql
- Run the command :sudo apt-get install mysql-server and give appropriate username and password.
Using sqoop to perform import to hadoop from sql
- Download mysql-connector-java-5.1.28-bin.jar and move to /usr/lib/sqoop/lib using command
user@ubuntu:~$ sudo cp mysql-connnectpr-java-5.1.28-bin.jar
>/usr/lib/sqoop/lib/
- Login to mysql using command
user@ubuntu:~$ mysql -u root -p
- Login to secure shell using command
user@ubuntu:~$ ssh localhost
- Start hadoop using the command
user@ubuntu:~$ bin/hadoop start-all.sh
- Run the command
user@ubuntu:~$ sqoop import -connect
>jdbc:mysql://localhost:3306/sqoop -username root -pasword abc
>-table employees -m
Error points
- Do check if the hadoop is in safe mode using command
user@ubuntu:~$hadoop dfsadmin -safemode get
user@ubuntu:~$hadoop dfsadmin -safemode leave
user@ubuntu:~$hadoop dfsadmin -safemode get
- Do make sure that haoop is running before performing the import action.