You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by sagar nikam <sa...@gmail.com> on 2012/10/28 05:32:53 UTC

How to load phpmyadmin dump .sql file into hive ?

i have below .sql file


file---->
===============================================================
-- Database: `manager`
-- Table structure for table `access`
-- 

CREATE TABLE IF NOT EXISTS `access` (
`id_access` int(11) NOT NULL AUTO_INCREMENT,
`no_of_waiter` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`macaddress` mediumtext NOT NULL,
PRIMARY KEY (`id_access`),
KEY `no_of_waiter` (`no_of_waiter`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=99 ;

-- 
-- Dumping data for table `access`
INSERT INTO `access` (`id_access`, `no_of_waiter`, `name`, `macaddress`)
VALUES
(66, 19, 'antonio', 'Mozilla/5.0 (compatible)'),
(2, 6, 'jota', 'Mozilla/5.0 (Windows NT 6.1) ');
===============================================================
there are thousands of row,but due to space problem,i m showing only two
rows data

i googled out & get "sqoop"
it dont have good tutorials to explain step by step

another way is that i have web address of this phpmyadmin with username &
passsword also

tell me both ways (which is best & easiest way to import?)

Re: How to load phpmyadmin dump .sql file into hive ?

Posted by Shreepadma Venugopalan <sh...@cloudera.com>.
Hi Sagar,

Is your data in a flat file or is it in a relational database? If your data
is in a relational database, you can use sqoop to import the data into a
Hive warehouse. You can find step by step tutorial on sqoop here:

http://archive.cloudera.com/cdh/3/sqoop/SqoopUserGuide.html#_connecting_to_a_database_server

Hive doesn't support an INSERT VALUES statement, so you will not be able to
execute this sql directly to insert data into a Hive warehouse.

Thanks,
Shreepadma

On Sat, Oct 27, 2012 at 9:32 PM, sagar nikam <sa...@gmail.com>wrote:

> i have below .sql file
>
>
> file---->
> ===============================================================
> -- Database: `manager`
> -- Table structure for table `access`
> --
>
> CREATE TABLE IF NOT EXISTS `access` (
> `id_access` int(11) NOT NULL AUTO_INCREMENT,
> `no_of_waiter` int(11) NOT NULL,
> `name` varchar(45) NOT NULL,
> `macaddress` mediumtext NOT NULL,
> PRIMARY KEY (`id_access`),
> KEY `no_of_waiter` (`no_of_waiter`)
> ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=99 ;
>
> --
> -- Dumping data for table `access`
> INSERT INTO `access` (`id_access`, `no_of_waiter`, `name`, `macaddress`)
> VALUES
> (66, 19, 'antonio', 'Mozilla/5.0 (compatible)'),
> (2, 6, 'jota', 'Mozilla/5.0 (Windows NT 6.1) ');
> ===============================================================
> there are thousands of row,but due to space problem,i m showing only two
> rows data
>
> i googled out & get "sqoop"
> it dont have good tutorials to explain step by step
>
> another way is that i have web address of this phpmyadmin with username &
> passsword also
>
> tell me both ways (which is best & easiest way to import?)
>