mysql的使用步骤(MySQL infobright的安装步骤)
mysql的使用步骤
MySQL infobright的安装步骤整个安装过程过了一遍,感觉跟mysql的安装差不太多。步骤如下:
1、使用"rpm -ivh 安装包"命令来安装一下rpm的包,如下:
|
[root@tk01-dba-mysql dba_mysql]# rpm -ivh infobright-4.0.7-0-x86_64-ice.rpm --prefix=/usr/local preparing... ################################# [100%] installing infobright 4.0.7-0 (x86_64) the installer will generate /tmp/ib4.0.7-0-install.log install trace log. updating / installing... 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/ local /infobright-4.0.7-x86_64/bin/mysqladmin -u root password 'new-password' /usr/ local /infobright-4.0.7-x86_64/bin/mysqladmin -u root -h tk01-dba-mysql-7-197 password 'new-password' alternatively you can run: /usr/ local /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/ local /infobright-4.0.7-x86_64 ; /usr/ local /infobright-4.0.7-x86_64/bin/mysqld_safe & you can test the mysql daemon with mysql-test-run.pl cd /usr/ local /infobright-4.0.7-x86_64/mysql-test ; perl mysql-test-run.pl please report any problems with the /usr/ local /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: 15866(mb) infobright optimal servermainheapsize is set to 6000(mb) infobright optimal loadermainheapsize is set to 800(mb) infobright server installed into folder /usr/ local /infobright installation log file /tmp/ib4.0.7-0-install.log -------------------------------------- to activate infobright server, please run ./postconfig.sh script from /usr/ local /infobright-4.0.7-x86_64. example command: cd /usr/ local /infobright-4.0.7-x86_64; ./postconfig.sh |
我这里是将文件解压到了/usr/local/目录下面,如果有其他目录,则可以使用其他目录进行解压,解压后的文件如下:
|
[root@tk01-dba-mysql local ]# ll total 54932 drwxr-xr-x. 2 root root 20 oct 11 11:45 bin drwxr-xr-x 8 root root 297 sep 27 09:10 cma_tcollector drwxr-xr-x. 2 root root 6 apr 11 2018 etc drwxr-xr-x. 2 root root 6 apr 11 2018 games drwxr-xr-x. 2 root root 6 apr 11 2018 include lrwxrwxrwx 1 root root 34 oct 15 21:42 infobright -> /usr/ local /infobright-4.0.7-x86_64 -rw-r --r-- 1 root root 56249223 oct 15 21:30 infobright-4.0.7-0-x86_64-ice.rpm drwxr-xr-x 11 root root 252 oct 15 21:42 infobright-4.0.7-x86_64 |
2、根据最后一行提示,激活infobright server,运行脚本./postconfig.sh ,如下:
|
[root@tk01-dba-mysql infobright]# ./postconfig.sh infobright post configuration -------------------------------------- infobright server activated. -------------------------------------- register your copy of ice and receive a free copy of the user manual (a $50 value) as well as a copy of the bloor research spotlight report "what's cool about columns" which explains the differences and benefits of a columnar versus row database . registration will require opening an http connection to infobright, do you wish to register now? [y/n]: n register now http://www.infobright.org/downloads/ice/. |
第一次运行的时候,会提醒是否注册,选择n,不注册,此时再次运行这个脚本:
|
[root@tk01-dba-mysql infobright]# ./postconfig.sh infobright post configuration -------------------------------------- using postconfig you can: -------------------------------------- (1) move existing data directory to other location, (2) move existing cache directory to other location, (3) configure server socket, (4) configure server port, (5) relocate datadir path to an existing data directory. please type 'y' for option that you want or press ctrl+c for exit. current configuration: -------------------------------------- current config file: [/etc/my-ib.cnf] current brighthouse.ini file: [/usr/ local /infobright-4.0.7-x86_64/data/brighthouse.ini] current datadir: [/usr/ local /infobright-4.0.7-x86_64/data] current cachefolder in brighthouse.ini file: [/usr/ local /infobright-4.0.7-x86_64/cache] current socket: [/tmp/mysql-ib.sock] current port: [5029] -------------------------------------- (1) do you want to copy current datadir [/usr/ local /infobright-4.0.7-x86_64/data] to a new location? [y/n]:y give new datadir path (e.g. /opt/datadirnewpath/data):/data/infobright_5029/data (2) option to change cachefolder is disabled when option 1 is chosen! (3) do you want to change current socket [/tmp/mysql-ib.sock]? [y/n]:n (4) do you want to change current port [5029]? [y/n]:n (5) relocation is disabled when options 1-4 are chosen! -------------------------------------- datadir(/usr/ local /infobright-4.0.7-x86_64/data) is going to be copied to /data/infobright_5029/data -------------------------------------- please confirm to proceed? [y/n]:y copying /usr/ local /infobright-4.0.7-x86_64/data to /data/infobright_5029/data ... is done. you can now remove/backup your old /usr/ local /infobright-4.0.7-x86_64/data ... done! |
此时安装包会提示是否修改相关的目录,按照自己的需求去修改,我这里只是简单的改了下data盘的目录,其他的选项都选择的是n,这样最终有一条提示:
datadir(/usr/local/infobright-4.0.7-x86_64/data) is going to be copied to /data/infobright_5029/data
一路yes,就安装完毕了。
3、查看data文件。此时进入刚才设定的data目录,/data/infobright_5029/data里面,查看初始化好的文件。
|
[root@tk01-dba-mysql data]# ll total 16 -rw-rw ---- 1 mysql mysql 0 oct 15 21:42 bh.err -rw-r --r-- 1 mysql mysql 1898 oct 15 21:42 brighthouse.ini -rw-r --r-- 1 mysql mysql 8 oct 15 21:42 ib_data_version drwxr-xr-x 2 mysql mysql 4096 oct 15 21:42 mysql drwxr-xr-x 2 mysql mysql 4096 oct 15 21:42 sys_infobright drwxr-xr-x 2 mysql mysql 6 oct 15 21:42 test |
4、启动服务。安装完软件之后,使用自带的工具/etc/init.d/mysqld-ib启动服务,启动完之后可以查看相关进程,启动方法和进程查看方法如下:
|
[root@tk01-dba-mysql infobright_5029]# /etc/init.d/mysqld-ib start starting mysql. success! [root@tk01-dba-mysql-7-195 infobright_5029]# ps -ef|grep 5029 root 78369 1 0 10:34 pts/1 00:00:00 sudo -u mysql /usr/ local /infobright-4.0.7-x86_64/bin/mysqld_safe --defaults-file=/etc/my-ib.cnf --log-queries-not-using-indexes --user=mysql --pid-file=/data/infobright_5029/data/tk01-dba-mysql-7-195.pid mysql 78372 78369 0 10:34 pts/1 00:00:00 /bin/sh /usr/ local /infobright-4.0.7-x86_64/bin/mysqld_safe --defaults-file=/etc/my-ib.cnf --log-queries-not-using-indexes --user=mysql --pid-file=/data/infobright_5029/data/tk01-dba-mysql-7-195.pid mysql 78507 78372 0 10:34 pts/1 00:00:00 /usr/ local /infobright-4.0.7-x86_64/bin/mysqld --defaults-file=/etc/my-ib.cnf --basedir=/usr/local/infobright-4.0.7-x86_64 --datadir=/data/infobright_5029/data --log-queries-not-using-indexes --log-error=/data/infobright_5029/data/bh.err --pid-file=/data/infobright_5029/data/tk01-dba-mysql-7-195.pid --socket=/tmp/mysql-ib.sock --port=5029 root 78570 68493 0 10:35 pts/1 00:00:00 grep --color=auto 5029 [root@tk01-dba-mysql-7-195 infobright_5029]# |
5、创建root用户的密码,这一步和mysql很像,使用/usr/local/infobright/bin/mysqladmin创建密码,方法如下:
|
[root@tk01-dba-mysql bin]# ./mysqladmin -uroot password '123456' warning: ./mysqladmin: unknown variable 'loose-local-infile=1' |
6、连接数据库,连接方法:
|
[root@tk01-dba-mysql bin]# mysql-ib -uroot -p123456 welcome to the mysql monitor. commands end with ; or \g. your mysql connection id is 2 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> show databases; + --------------------+ | database | + --------------------+ | information_schema | | bh_rsi_repository | | mysql | | sys_infobright | | test | + --------------------+ 5 rows in set (0.00 sec) mysql> show engines; + -------------+---------+-----------------------------------------------------------+--------------+------+------------+ | engine | support | comment | transactions | xa | savepoints | + -------------+---------+-----------------------------------------------------------+--------------+------+------------+ | brighthouse | default | brighthouse storage engine | yes | no | no | | mrg_myisam | yes | collection of identical myisam tables | no | no | no | | csv | yes | csv storage engine | no | no | no | | myisam | yes | default engine as of mysql 3.23 with great performance | no | no | no | | memory | yes | hash based, stored in memory, useful for temporary tables | no | no | no | + -------------+---------+-----------------------------------------------------------+--------------+------+------------+ 5 rows in set (0.00 sec) |
如果不设置进入infobright的用户名和密码,则可以直接使用命令mysql-ib进入上述界面。可以看到,默认的存储引擎是brighthouse。到这里,infobright的安装过程算是全部完成了。
7、导入数据。
社区版的目前只能通过load data的方法进行数据导入,语法如下:
|
load data [low_priority| concurrent] [ local ] infile 'file_name.txt' [ replace | ignore ] into table tbl_name [fields [terminated by 'string' ] [[optionally] enclosed by 'char' ] [escaped by 'char' ] ] [lines [starting by 'string' ] [terminated by 'string' ] ] [ ignore number lines] [(col_name_or_user_var,...)] [ set col_name = expr,...)] |
其中有很多关键字信息,这里解释一些重要的:
- low_priority关键字
如果load data语句使用了low_priority关键字,则在碰到其他会话操作相同表时,则会延迟执行load data语句,直到其他会话操作表结束为止。
- replace和ignore关键字
控制对现有的唯一键记录的重复的处理。如果你指定replace,新行将代替有相同的唯一键值的现有行。如果你指定ignore,跳过有唯一键的现有行的重复行的输入。
- fields关键字
指定了文件字段的分割格式:
- terminated by关键字
以什么字符作为分隔符;
- enclosed by
字段括起字符;
- lines
指定了每条记录的分隔符默认为'\n'即为换行符;
更多信息,请参考官方文档。
现在我们生成一个文本,然后写入数据:
|
mysql> use test; database changed mysql> show tables; + ----------------+ | tables_in_test | + ----------------+ | test | + ----------------+ 1 row in set (0.00 sec) mysql> load data infile '/tmp/a.txt' ignore into table test character set utf8 fields terminated by ' ' lines terminated by '\n' ; query ok, 4 rows affected (0.04 sec) records: 4 deleted: 0 skipped: 0 warnings: 0 mysql> system cat /tmp/a.txt 1 aaa 2 bbb 3 ccc 4 ddd mysql> select * from test; + ------+-------+ | id | name | + ------+-------+ | 1 | aaa | | 2 | bbb | | 3 | ccc | | 4 | ddd | + ------+-------+ 4 rows in set (0.00 sec) |
最终,所有的数据都导入了。大家可以尝试用这种方法导入大量的数据,然后对infobright的查询性能进行评估。
以上就是mysql infobright的安装步骤的详细内容,更多关于mysql infobright的安装的资料请关注开心学习网其它相关文章!
原文链接:https://cloud.tencent.com/developer/article/1533743
- mysql与oracle体系结构(详解MySQL实时同步到Oracle解决方案)
- mysql修改表结构的关键字(查看修改MySQL表结构命令)
- mysql突然报错206无法连接(详解MySQL连接挂死的原因)
- mysql备份工具怎么选(MySQL使用Xtrabackup备份流程详解)
- docker运行redis并操作(Docker安装MySQL和Redis的方法步骤)
- mysql的decimal类型(MySQL数据类型DECIMAL用法详解)
- mysql数据结构讲解(详解MySQL 数据库隔离级别与MVCC)
- win10下安装mysql8.0.23 及 “服务没有响应控制功能”问题解决办法(win10下安装mysql8.0.23 及 “服务没有响应控制功能”问题解决办法)
- mysql定期备份(Mysql5.7定时备份的实现)
- mysql语句性能分析(聊聊MySQL的COUNT*的性能)
- mysql的连接池名称如何查看(如何使用mysqladmin获取一个mysql实例当前的TPS和QPS)
- mysql高级概念(MySQL 自定义变量的概念及特点)
- mysql添加数据很慢(mysql如何优化插入记录速度)
- mysql操作时间的函数(一篇文章搞定Mysql日期时间函数)
- myeclipse连接mysql数据库的方法(教你用eclipse连接mysql数据库)
- mysql事务特性和隔离级别(Mysql事务特性和级别原理解析)
- 萌娃唱《白龙马》走红,那生动的小表情,网友直呼 简直是戏精(萌娃唱白龙马走红)
- 朱鹤松被不断认可,凤凰传奇玲花喊话岳云鹏,索要老朱演出门票(朱鹤松被不断认可)
- 元宵晚会槽点多,芒果台上来就假唱,岳云鹏不说相声改评书了(元宵晚会槽点多)
- 岳云鹏跟凤凰传奇谈心,说出了人生中最重要的三个人,这才成功(岳云鹏跟凤凰传奇谈心)
- 爱情可以当饭吃吗(爱情能当饭吃吗)
- Top 3 JSHS《运动与健康科学 英文 》跻身SCI体育学期刊世界前三(Top3JSHS运动与健康科学)
热门推荐
- SQL中Exists的用法
- h5微信手机端debug模式(iOS微信H5页面橡皮回弹效果的踩坑记录)
- elasticsearch docker(在Docker中安装Elasticsearch7.6.2的教程)
- zabbix sender能否发送告警数据(python3实现zabbix告警推送钉钉的示例)
- springbootvue数据交互系统(Springboot运用vue+echarts前后端交互实现动态圆环图)
- docker重新加载nginx(Docker Nginx Log 三者的处理详解)
- dedecms自适应代码(dedecms下广告延时加载显示,大大提高网页访问的速度)
- apache虚拟域名配置(Apache虚拟主机的配置和泛域名解析实现代码)
- xampp数据库表在哪个文件夹(XAMPP集成环境中MySQL数据库的使用)
- dedecms命名规则(DEDECMS织梦文章文档属性增加推荐特荐图标)
排行榜
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9