1、安装MariaDB数据库
# yum install mariadb mariadb-server mysql-connector-java -y |
2、启动MariaDB数据库
# systemctl enable mariadb # systemctl start mariadb # systemctl status mariadb 查看数据库启动状态 |
3、配置MariaDB数据库
#mysql_secure_installation Enter current password for root (enter for none): 直接回车 Set root password? [Y/n] y New password: bigdata Re-enter new password:bigdata Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] n Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y |
4、创建hive数据库
# mysql -uroot -p123456 MariaDB [(none)]> create database hive; MariaDB [(none)]> grant all privileges on hive.* to 'hive'@'localhost' identified by '123456'; MariaDB [(none)]> grant all privileges on hive.* to 'hive'@'%' identified by '123456'; MariaDB [ambari]> exit Bye |
5、创建Hive数据库并设置编码格式为 latin1
create database hive DEFAULT CHARACTER SET latin1;
6、允许root用户可以使用任意主机访问数据库(配置远程访问)
update mysql.user set host = '%' where user = 'root' and host = '127.0.0.1';
7、刷新权限
flush privileges;
8、HSQL
read 表名 10;
count 表名;