Created 01-31-2016 10:36 PM
Whenever I execute the following query : sqoop list-databases --connect jdbc:mysql://localhost:3306 --username xxx -password xxx . Only the following tables are displayed information_schema, hive, mysql, ranger, ranger_audit,test, but not the databases which I created inside mysql workbench. Your guidance will be appreciated.
Created 02-01-2016 12:12 AM
@keerthana gajarajakumar I suggest to load the file from OS.
yum -y install git
git clone https://github.com/datacharmer/test_db.git
[root@sandbox ~]# cd test_db/
[root@sandbox test_db]# ls
Changelog employees.sql load_dept_emp.dump load_salaries1.dump load_titles.dump sakila test_employees_md5.sql
employees_partitioned_5.1.sql images load_dept_manager.dump load_salaries2.dump objects.sql show_elapsed.sql test_employees_sha.sql
employees_partitioned.sql load_departments.dump load_employees.dump load_salaries3.dump README.md sql_test.sh
[root@sandbox test_db]# mysql < employees.sql
Created 01-31-2016 11:22 PM
If you have created databases under hcatalog then you won't be able to see it through workbench
Created 01-31-2016 11:31 PM
Created 01-31-2016 11:50 PM
Thanks @Neeraj Sabharwal. I downloaded the sample employee database from http://dev.mysql.com/doc/employee/en/employees-installation.html and ran the scripts on Mysql Workbench . I've got all the tables and data loaded but then when I executed the sqoop list-databases command the following is not being displayed. Am I missing anything?
Created 01-31-2016 11:57 PM
@keerthana gajarajakumar It looks like that your script creates a database employees
can you try this?
sqoop list-tables --connect jdbc:mysql://localhost:3306/employees --username xxx -password xxx
Created 01-31-2016 11:58 PM
@Neeraj Sabharwal -- Thanks Neeraj. I ran the code you suggested but I'm getting the following error - 16/01/31 23:58:50 ERROR manager.CatalogQueryManager: Failed to list tables com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown database 'employees' at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Created 02-01-2016 12:00 AM
Created on 02-01-2016 12:04 AM - edited 08-19-2019 03:40 AM
@Neeraj Sabharwal -- It's getting listed in mysql workbench but not when I try it on hortonworks sandbox
Created on 02-01-2016 12:08 AM - edited 08-19-2019 03:40 AM
@Neeraj Sabharwal -- Thanks for your reply. When I try executing the following command.. I don't see employees listed below like yours.
Created 01-31-2016 11:55 PM
@keerthana gajarajakumar Try this
grant all privileges on *.* to ‘username’@’%’ identified by ‘userpassword’;