Support Questions

Find answers, ask questions, and share your expertise

I'm unable to view the databases inside Mysqlworkbench. Instead the following databases are listed : information_schema, hive, mysql, ranger, ranger_audit,test

avatar
Expert Contributor

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.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@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

View solution in original post

20 REPLIES 20

avatar
Master Mentor

@keerthana gajarajakumar

If you have created databases under hcatalog then you won't be able to see it through workbench

avatar
Master Mentor

avatar
Expert Contributor

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?

avatar
Master Mentor

@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

avatar
Expert Contributor

@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)

avatar
Master Mentor

@keerthana gajarajakumar

Could you login to mysql and run show databases;

command is

show databases;

avatar
Expert Contributor

@Neeraj Sabharwal -- It's getting listed in mysql workbench but not when I try it on hortonworks sandbox

1672-capture.png

avatar
Expert Contributor

1674-sandbox.png@Neeraj Sabharwal -- Thanks for your reply. When I try executing the following command.. I don't see employees listed below like yours.

avatar

@keerthana gajarajakumar Try this

grant all privileges on *.* to ‘username’@’%’ identified by ‘userpassword’;