Unknown version specified for initialization: 3.1.0 schemaTool failed
yeah finally I have solved it no need of Cygwin.
first download these cmds and paste them in bin folder which you might have already done
https://github.com/HadiFadl/Hive-cmd
no need to repeat it if you have already done it :)
i have created the database in mysql by create database metastore_db;
my hive_site.xml looks like this because i choosed to use mysql, write your mysql username,password in place of root root.
<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="configuration.xsl"?><configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3307/metastore_db?createDatabaseIfNotExist=false&useSSL=true</value> <description>metadata is stored in a MySQL server</description> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> <description>MySQL JDBC driver class</description> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> <description>user name for connecting to mysql server</description> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>root</value> <description>password for connecting to mysql server</description> </property></configuration>
write this in cmd:
hive --service schematool -dbType derby -initSchema
or write this if you are using mysql as backend:
hive --service schematool -dbType mysql -initSchema
if you get output at the end like
Initialization script completedschemaTool completed
you have successfully done it. else try to go to C:\apache-hive-3.1.2-bin\bin via cmd and then execute it.