Error Loading data to mysql in Spark

0 votes

Need Help. 

[edureka]> LOAD DATA INFILE "/user/edureka_422446/spark/county_facts_dictionary.csv"
-> INTO TABLE county_facts_dictionary
-> COLUMNS TERMINATED BY ","
-> OPTIONALLY ENCLOSED BY """
-> ESCAPED BY """
-> LINES TERMINATED BY "\n"
-> IGNORE 1 LINES;
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
Jul 11 in Apache Spark by Karan
50 views

1 answer to this question.

0 votes

You have to use sqoop to export data from hdfs to mysql, first you have to create a table in mysql with a schema based on the type of data you have then use the below command to export the data from hdfs to mysql in the web console: 

$ sqoop export --connect jdbc:mysql://sqoopdb.edu.cloudlab.com/databasename --table tabename --username labuser --password edureka -m 1 --fields-terminated-by "," --lines-terminated-by "\n" --export-dir /user/edureka_422446/spark/county_facts_dictionary.csv
answered Jul 11 by Jishan

Related Questions In Apache Spark

0 votes
1 answer

How to load data of .csv file in MySQL Database Table?

You can do it using a code ...READ MORE

answered Jul 22 in Apache Spark by Vishwa
41 views
0 votes
1 answer

How to read a data from text file in Spark?

Hey, You can try this: from pyspark import SparkContext SparkContext.stop(sc) sc ...READ MORE

answered Aug 6 in Apache Spark by Gitika
• 25,360 points
329 views
0 votes
1 answer

Efficient way to read specific columns from parquet file in spark

As parquet is a column based storage ...READ MORE

answered Apr 20, 2018 in Apache Spark by kurt_cobain
• 9,260 points
1,431 views
0 votes
1 answer

Getting error while connecting zookeeper in Kafka - Spark Streaming integration

I guess you need provide this kafka.bootstrap.servers ...READ MORE

answered May 24, 2018 in Apache Spark by Shubham
• 13,310 points
710 views
0 votes
1 answer

Error: Loading data to mysql

You have to use sqoop to export data ...READ MORE

answered Jul 23 in Apache Spark by Janan
44 views
0 votes
1 answer

Update hdfs data before stroring in MySql

Yes, you can update the data before ...READ MORE

answered Jan 27 in Big Data Hadoop by Omkar
• 67,660 points
38 views
0 votes
1 answer

Using Hadoop for Data Analytics.

Yes, your approach is correct - you ...READ MORE

answered Sep 28, 2018 in Big Data Hadoop by Frankie
• 9,810 points
43 views
0 votes
1 answer

How to open MySql console in Ubuntu?

sudo service mysqld restart mysql -u <username> root ...READ MORE

answered Dec 14, 2018 in Big Data Hadoop by Omkar
• 67,660 points
123 views
0 votes
1 answer

How to handle data shuffle in Spark

Hi, You can do it using map partition ...READ MORE

answered Aug 6 in Apache Spark by Gitika
• 25,360 points
71 views
0 votes
4 answers

How to change the spark Session configuration in Pyspark?

You can dynamically load properties. First create ...READ MORE

answered Dec 10, 2018 in Apache Spark by Vini
16,662 views