Data Warehouse Technology Based on MySQL and Infobright

Source: Internet
Author: User
User set ulimit-SHn65535mkdir-phomemysqlinfobrightusrsbingroupaddmysqlusrsbinuseradd-gmysqlmysqlcdusr

Set ulimit-SHn 65535 mkdir-p/home/mysql/infobright/usr/sbin/groupadd mysql/usr/sbin/useradd-g mysql mysqlcd/usr/

User settings
Ulimit-SHn 65535
Mkdir-p/home/mysql/infobright
/Usr/sbin/groupadd mysql
/Usr/sbin/useradd-g mysql
Cd/usr/local/soft/

Download and decompress
64-bit System
Wget
Tar zxvf infobright-3.3.1-x86_64-ice.tar.gz
Music infobright-3.3.1-x86_64 infobright

32-bit System
Wget
Tar zxvf infobright-3.3.1-i686-ice.tar.gz
Music infobright-3.3.1-i686 infobright

Installation Steps
Cd infobright
. /Install-infobright.sh -- datadir =/home/mysql/infobright/data -- cachedir =/home/mysql/infobright/cache -- config =/home/mysql/infobright/my. cnf -- port = 3307 -- socket =/tmp/mysqlinfobright. sock -- user = mysql -- group = mysql

Memory limit
Vi/home/mysql/infobright/data/brighthouse. ini

Start and Stop
Cd/usr/local/infobright/;./bin/mysqld_safe -- defaults-file =/home/mysql/infobright/my. cnf 2> & 1>/dev/null &
Cd/usr/local/infobright/;./bin/mysqladmin-uroot-p-S/tmp/mysqlinfobright. sock shutdown
/Usr/local/infobright/bin/mysql-S/tmp/mysqlinfobright. sock

Test Export
/Usr/local/mysql/bin/mysql-uroot-p-Dt2011-e "select username, user_id, regtime into outfile '/home/test.csv 'fields TERMINATED ', 'enabledby' \ "'elasticby' \ 'Lines terminated by '\ n' from users limit 300 ;"

Test Import
/Usr/local/infobright/bin/mysql-S/tmp/mysqlinfobright. sock-uroot-p-Dt2011_logs -- skip-column-names-e "load data infile '/home/test.csv 'into TABLE access_log fields terminated ', 'escaped by' \ 'lines terminated by' \ n ';"

Set permissions
/Usr/local/mysql/bin/mysql-uroot
/Usr/local/infobright/bin/mysql-S/tmp/mysqlinfobright. sock
Grant all privileges on *. * TO 'addcn' @ 'localhost' identified by '123 ';
Set password for 'addcn' @ 'localhost' = old_password ('addcn2011 ');
Flush privileges;

Grant all privileges on *. * TO 'addcn' @ '% 'identified BY '123 ';
Set password for 'addcn' @ '%' = old_password ('addcn2011 ');

/Usr/local/infobright/bin/mysql-S/tmp/mysqlinfobright. sock-uaddcn-paddcn2011-Dt2011_logs -- skip-column-names-e "load data infile '/home/test.csv 'into TABLE access_log fields terminated ', 'escaped by' \ 'lines terminated by' \ n ';"

Other data
Create database 't2011 _ logs ';
Create table 'Access _ log '(
'Sid 'varchar (50) not null,
'User _ id' int (11) not null,
'Timestamp' int (11) NOT NULL
) ENGINE = brighthouse default charset = latin1;

1282815666
2, 1002, 1282815668
1282815675
Load data infile '/home/test.csv 'into table' access _ log' fields terminated by', 'elasticed BY ''' lines terminated by '\ n ';

Select * from access_log;

Compression ratio:
1,660,546 data, MB later than 56179KB
1 533 952/56 179 = 27.3047224

The content exceeds the field type:
ERROR 2 (HY000) at line 1: Wrong data or column definition. Row: 3, field: 16.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.