infobright安装和配置

安装infobright
在usr目录下创建新目录infobright目录,将我们下载的安装文件infobright-4.0.7-0-linux_x86_64-ice.rpm放到此目录下,打开终端,切换到infobright目录下:

[root@localhost /]# cd /usr/infobright/
[root@localhost infobright]# ls
infobright-4.0.7-0-linux_x86_64-ice.rpm
[root@localhost infobright]#

然后执行安装命令:

[root@localhost infobright]# rpm -ivh  infobright-4.0.7-0-linux_x86_64-ice.rpm --prefix=/usr/infobright/

执行后显示如下信息:

准备中...                          ################################# [100%]
Installing infobright 4.0.7-0 (x86_64)
The installer will generate /tmp/ib4.0.7-0-install.log install trace log.
正在升级/安装...
   1:infobright-4.0.7-0               ################################# [100%]
Creating/Updating datadir and cachedir
Creating user mysql and group mysql
Installing default databases
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:

/usr/infobright/infobright-4.0.7-x86_64/bin/mysqladmin -u root password 'new-password'
/usr/infobright/infobright-4.0.7-x86_64/bin/mysqladmin -u root -h localhost password 'new-password'

Alternatively you can run:
/usr/infobright/infobright-4.0.7-x86_64/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 /usr/infobright/infobright-4.0.7-x86_64 ; /usr/infobright/infobright-4.0.7-x86_64/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/infobright/infobright-4.0.7-x86_64/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/infobright/infobright-4.0.7-x86_64/scripts/mysqlbug script!

The latest information about MySQL is available at http://www.mysql.com/
Support MySQL by buying support/licenses from http://shop.mysql.com/

System Physical memory: 2000(MB)
Infobright optimal ServerMainHeapSize is set to 600(MB)
Infobright optimal LoaderMainHeapSize is set to 320(MB)
Infobright server installed into folder /usr/infobright/infobright
Installation log file /tmp/ib4.0.7-0-install.log
--------------------------------------
To activate infobright server, please run ./postconfig.sh script from /usr/infobright/infobright-4.0.7-x86_64.
Example command: cd /usr/infobright/infobright-4.0.7-x86_64; ./postconfig.sh

通过阅读上述打印信息,我们可以获知很多操作提示(已经告知我们详细的操作命令,在此不在赘述);安装完成后,我们需要执行命令./postconfig.sh

[root@localhost infobright]# cd /usr/infobright/infobright-4.0.7-x86_64
[root@localhost infobright-4.0.7-x86_64]# ./postconfig.sh

提示是否注册,选择“N”,不注册。

启动infobright

[root@localhost infobright-4.0.7-x86_64]# /etc/init.d/mysqld-ib start
Starting MySQL. SUCCESS! 
[root@localhost infobright-4.0.7-x86_64]# 

停止infobright

[root@localhost infobright-4.0.7-x86_64]# /etc/init.d/mysqld-ib stop
Shutting down MySQL. SUCCESS! 
[root@localhost infobright-4.0.7-x86_64]# 

卸载infobright

[root@localhost ~]# rpm -e infobright

设置进入infobright的root用户的密码

[root@localhost infobright-4.0.7-x86_64]# bin/mysqladmin -u root password '123456'
Warning: bin/mysqladmin: unknown variable 'loose-local-infile=1'

进入infobright

[root@localhost infobright-4.0.7-x86_64]# mysql-ib -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.40 build number (revision)=IB_4.0.7_r16961_17249(ice) (static)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> 

如果不设置进入infobright的用户名和密码,则可以直接使用命令mysql-ib进入上述界面。

应用:

mysql> create database warehouse;

mysql> use warehouse
Database changed
mysql> create table user( 
      user_id int(10) not null, 
      user_name varchar(20) not null, 
      age int(30) not null 
)ENGINE=BRIGHTHOUSE DEFAULT CHARSET=UTF8;

mysql> select * from user;

mysql> 

使用的引擎是 BRIGHTHOUSE 主键,为空,自动递增...此引擎都不支持。

导入数据

load data  [low_priority] [local] infile 'file_name txt' [replace | ignore]
into table tbl_name
[fields
[terminated by't']
[OPTIONALLY] enclosed by '']
[escaped by'\' ]]
[lines terminated by'n']
[ignore number lines]
[(col_name,   )]

low_priority:那么MySQL将会等到没有其他人读这个表的时候,才把插入数据;
replace和ignore:控制对现有的唯一键记录的重复的处理。如果你指定replace,新行将代替有相同的唯一键值的现有行。如果你指定ignore,跳过有唯一键的现有行的重复行的输入。如果你不指定任何一个选项,当找到重复键时,出现一个错误,并且文本文件的余下部分被忽略;
fields:关键字指定了文件字段的分割格式:
terminated by:是以什么字符作为分隔符;
enclosed by:字段括起字符;
lines:指定了每条记录的分隔符默认为'\n'即为换行符;

新建数据文件 info.txt

10001,"Tom",10
10002,"Jean",11
10003,"jerry",5

将文本中的数据导入到数据仓库的表中

mysql> load data infile '/usr/infobright/info.txt' ignore into table user character set utf8 fields terminated by ',' enclosed by '"' lines terminated by '\n';

Query OK, 3 rows affected (0.07 sec)
Records: 3  Deleted: 0  Skipped: 0  Warnings: 0

查询数据是否插入成功:

mysql> select * from user;
+---------+-----------+-----+
| user_id | user_name | age |
+---------+-----------+-----+
|   10001 | Tom       |  10 |
|   10002 | Jean      |  11 |
|   10003 | jerry     |   5 |
+---------+-----------+-----+
3 rows in set (0.00 sec)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 218,607评论 6 507
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 93,239评论 3 395
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 164,960评论 0 355
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 58,750评论 1 294
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 67,764评论 6 392
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 51,604评论 1 305
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 40,347评论 3 418
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 39,253评论 0 276
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 45,702评论 1 315
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,893评论 3 336
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 40,015评论 1 348
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,734评论 5 346
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 41,352评论 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,934评论 0 22
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 33,052评论 1 270
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 48,216评论 3 371
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,969评论 2 355

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,657评论 18 139
  • linux资料总章2.1 1.0写的不好抱歉 但是2.0已经改了很多 但是错误还是无法避免 以后资料会慢慢更新 大...
    数据革命阅读 12,168评论 2 33
  • Ubuntu的发音 Ubuntu,源于非洲祖鲁人和科萨人的语言,发作 oo-boon-too 的音。了解发音是有意...
    萤火虫de梦阅读 99,274评论 9 467
  • 开发证书准备: 要有一个开发者账号(在 https://developer.apple.com/ 申请) 在苹果开...
    liailing阅读 746评论 0 1
  • 最近迷画简笔画,对于做手工的人来说,怎能不能自己一个美美的笔袋呢? 越大容量的笔袋,让我自己都有点惊吓了。 蓝天,...
    叶样悠阅读 300评论 2 4