Hive uses the Derby database by default, Derby is an embedded database, the database is typically created in the directory where the hive command is run, and if the switch directory is running, the database is not found
Hive MySQL Configuration:
Website address: https://cwiki.apache.org/confluence/display/Hive/AdminManual+MetastoreAdmin
Create files under Hive Profile directory: Hive-site.xml, configured as follows
<configuration> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost/hive?createDatabaseIfNotExist=true</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value> com.mysql.jdbc.driver</value> </property> <property> <name> javax.jdo.option.connectionusername</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value> Root</value> </property></configuration>
Configured after initialization:./schematool-initschema-dbtype MySQL
After the initialization is successful, the Hive command line can be started and the MySQL driver needs to be placed in the Lib directory of hive.
MySQL Configuration for Hive