一、源码安装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专用的元数据库