Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
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 02-01-2016 12:05 AM
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
Created on 02-01-2016 12:07 AM - edited 08-19-2019 03:40 AM
See the above output of
sqoop list-databases --connect jdbc:mysql://localhost:3306 --username root --password root
Created 02-01-2016 12:22 AM
@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
Created 02-01-2016 12:25 AM
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
Created 02-01-2016 12:37 AM
@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)
Created 02-01-2016 12:38 AM
@Neeraj Sabharwal Do you know how to fix this?
Created 02-01-2016 12:40 AM
Created 02-01-2016 01:31 AM
@Neeraj Sabharwal -- It worked. Thanks a lot for your time and suggestions:)
Created 02-01-2016 01:33 AM
@keerthana gajarajakumar Perfect!!!! thanks for trying and not giving up 🙂
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