hive 配置mysql元数据库
2016-01-24 18:42
543 查看
在hive的配置文件hive-site.xml中
<?xmlversion="1.0"?> <!-- LicensedtotheApacheSoftwareFoundation(ASF)underoneormore contributorlicenseagreements.SeetheNOTICEfiledistributedwith thisworkforadditionalinformationregardingcopyrightownership. TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0 (the"License");youmaynotusethisfileexceptincompliancewith theLicense.YoumayobtainacopyoftheLicenseathttp://www.apache.org/licenses/LICENSE-2.0 Unlessrequiredbyapplicablelaworagreedtoinwriting,software distributedundertheLicenseisdistributedonan"ASIS"BASIS, WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied. SeetheLicenseforthespecificlanguagegoverningpermissionsand limitationsundertheLicense. --> <?xml-stylesheettype="text/xsl"href="configuration.xsl"?> <configuration> <!--HiveConfigurationcaneitherbestoredinthisfileorinthehadoopconfigurationfiles--> <!--thatareimpliedbyHadoopsetupvariables.--> <!--AsidefromHadoopsetupvariables-thisfileisprovidedasaconveniencesothatHive--> <!--usersdonothavetoedithadoopconfigurationfiles(thatmaybemanagedasacentralized--> <!--resource).--> <!--HiveExecutionParameters--> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://192.168.1.200:3306/hive?createDatabaseIfNotExist=true</value> <description>JDBCconnectstringforaJDBCmetastore</description> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> <description>DriverclassnameforaJDBCmetastore</description> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> <description>usernametouseagainstmetastoredatabase</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>123456</value> <description>passwordtouseagainstmetastoredatabase</description> </property> </configuration>
<name>javax.jdo.option.ConnectionUserName</name>为mysql的授权的用户名
<name>javax.jdo.option.ConnectionPassword</name>为mysql授权的密码然后输入hive命令
输入showdatabases;查看hive的数据库,默认为default
注意要把mysql-connector-java-xxx.jar驱动放到hive的lib目录下
相关文章推荐
- 关于远程MySQL Access denied for user admin@'dongwt' (using password: YES)
- mysql主从库
- mysql双机热备的配置步骤
- 游戏服务器之mysql句柄连接池
- 【MySQL】InnoDB日志机制深入分析
- 自建pyspider中的mysql语句
- MySQL 远程连接丢失
- 使用nodejs,express,mysql,Bootstrap开发采购招标网站(二)主页和注册页面的实现
- mysql 安装、配置、使用
- mysql 中文乱码问题
- MySQL5.7版本新特性
- (笔记)Mysql实例:建库建表并插入数据2
- (笔记)Mysql实例:建库建表并插入数据1
- (笔记)Mysql命令mysqldump:备份数据库
- (笔记)Mysql命令rename:修改表名
- (笔记)Mysql命令alter add:增加表的字段
- MySQL5.5.19安装
- 使用nodejs,express,mysql,Bootstrap开发采购招标网站(一)项目搭建
- 关于 Mac OS 本地安装 Mysql 的一些坑
- mysqldump和bin-log备份以及恢复示例