Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

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

I loaded the same databases in my system. See this

There is chance that you ended up loading it into default or test db. I suggest to load the data using mysql prompt

[root@sandbox test_db]# sqoop list-databases --connect jdbc:mysql://localhost:3306 --username root --password xxx

Warning: /usr/hdp/2.3.2.0-2950/accumulo does not exist! Accumulo imports will fail.

Please set $ACCUMULO_HOME to the root of your Accumulo installation.

16/02/01 00:04:25 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.3.2.0-2950

16/02/01 00:04:25 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.

16/02/01 00:04:26 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/zookeeper/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

information_schema

demomysql

employees

hive

mysql

ranger

ranger_audit

test

[root@sandbox test_db]#

[root@sandbox test_db]# mysql < employees.sql

INFO

CREATING DATABASE STRUCTURE

INFO

LOADING departments

INFO

LOADING employees

INFO

LOADING dept_emp

INFO

LOADING dept_manager

INFO

LOADING titles

INFO

LOADING salaries

data_load_time_diff

00:00:16

avatar
Master Mentor

@keerthana gajarajakumar

1655-screen-shot-2016-01-31-at-70639-pm.png

See the above output of

sqoop list-databases --connect jdbc:mysql://localhost:3306 --username root --password root

1656-screen-shot-2016-01-31-at-70755-pm.png

avatar
Expert Contributor

@Neeraj Sabharwal -- Your suggestion to download using git clone seems to work. However when I ran this code, [root@sandbox test_db]# mysql < employees.sql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) . So, will this code work? [root@sandbox test_db]# mysql -u root -p < employees.sql

avatar
Master Mentor

See this @keerthana gajarajakumar

Dont put any space after p and provide password.

[root@sandbox test_db]# mysql -u root -proot < employees.sql

INFO

CREATING DATABASE STRUCTURE

INFO

LOADING departments

INFO

LOADING employees

INFO

LOADING dept_emp

INFO

LOADING dept_manager

INFO

avatar
Expert Contributor

@Neeraj Sabharwal -- Now, I made few changes when I ran this code (sudo /usr/bin/mysql_secure_installation), guess it's wrong. Despite entering my correct mysql password, I'm getting the following error: Enter current password for root (enter for none): ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

avatar
Expert Contributor

@Neeraj Sabharwal Do you know how to fix this?

avatar
Master Mentor

avatar
Expert Contributor

@Neeraj Sabharwal -- It worked. Thanks a lot for your time and suggestions:)

avatar
Master Mentor

@keerthana gajarajakumar Perfect!!!! thanks for trying and not giving up 🙂

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