zoukankan      html  css  js  c++  java
  • 安装hive+mysql

    1、源码安装mysql

      以root用户首先安装libaio-0.3.104.tar.gz

      tar zxvf libaio-0.3.104.tar.gz

      cd libaio-0.3.104

      make prefix=/lib64 install

       export LD_LIBRARY_PATH=/lib64/lib

       解压mysql

      tar zxvf mysql-5.5.29-linux2.6-x86_64.tar.gz

      ln -s mysql-5.5.29-linux2.6-x86_64 mysql

      cd mysql

      执行  ./scripts/mysql_install_db --datadir=/home/hive/mysql/data --basedir=$PWD --user=hive

    Installing MySQL system tables...
    OK
    Filling help tables...
    OK

    To start mysqld at boot time you have to copy
    support-files/mysql.server to the right place for your system

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:

    /home/hive/mysql/bin/mysqladmin -u root password 'new-password'
    /home/hive/mysql/bin/mysqladmin -u root -h hostname password 'new-password'

    Alternatively you can run:
    /home/hive/mysql/bin/mysql_secure_installation

    which will also give you the option of removing the test
    databases and anonymous user created by default. This is
    strongly recommended for production servers.

    See the manual for more instructions.

    You can start the MySQL daemon with:
    cd /home/hive/mysql ; /home/hive/mysql/bin/mysqld_safe &

    You can test the MySQL daemon with mysql-test-run.pl
    cd /home/hive/mysql/mysql-test ; perl mysql-test-run.pl

    Please report any problems with the /home/hive/mysql/scripts/mysqlbug script!

      看到以上信息安装成功

    ln -s /home/hive/mysql/ /usr/local/mysql

    防止以下报错:

    默认会去寻找这个目录

    首先需要将scripts/mysql.server服务脚本复制到/etc/init.d/,并重命名为mysqld。

    cp support-files/mysql.server /etc/init.d/mysqld

    通过chkconfig命令将mysqld服务加入到自启动服务项中。

    chkconfig --add mysqld

    chkconfig --list mysqld

    ./mysqld_safe  --user=hive &  启动

    2、为hive建立相应的mysql账号,并且赋予足够的权限 (http://www.cnblogs.com/fly1988happy/archive/2011/12/15/2288554.html

    ./mysql -u root -p

    create user 'hive' identified by 'hive';

     grant all privileges on *.* to 'hive'@'localhost' with grant option;

    测试登陆

    ./mysql -u hive -p 

    hive

    成功登陆

    3、建立hive专用的元数据库

  • 相关阅读:
    Update操作一定是先Delete再Insert吗?
    asp.net中的并发控制
    asp.net2.0下利用javascript实现treeview中的checkbox全选
    Json
    SQL Server2005 事务隔离级别
    设计概念模型
    前沿视频教程
    PowerDesigner使用
    表单 数字字符验证正则
    CharIndex對比Replace
  • 原文地址:https://www.cnblogs.com/dlutxm/p/3245353.html
Copyright © 2011-2022 走看看