安裝hive+mysql

一、源碼安裝mysqlhtml

  以root用戶首先安裝libaio-0.3.104.tar.gzmysql

  tar zxvf libaio-0.3.104.tar.gzlinux

  cd libaio-0.3.104sql

  make prefix=/lib64 install數據庫

   export LD_LIBRARY_PATH=/lib64/libapp

 

   解壓mysqlide

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

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

  cd mysqlserver

  執行  ./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 &  啓動

二、爲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

成功登錄

三、創建hive專用的元數據庫

相關文章
相關標籤/搜索