安裝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.rzrgm.cn/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專用的元數據庫
浙公網安備 33010602011771號