运维开发技巧

通过shell脚本获取到相应的数据,然后导入到数据库中,用PHP代码实现页面体验的步骤

  1. 编写shell脚本,获取相应信息

  2. 通过load data infile 'filename' into table tablename;把所得信息导入的数据库中

    具体参数详见笔记 load data 的具体使用方法

  3. 利用PHP代码把所需要的信息体现在页面中

注:mysql导入信息

load data infile 'filename' into table tablename [option]

option 参数

fields terminated by 'string'    //字段分割符,默认指表符 '\t'

fields [optionally] enclosed by 'char' //字段引用符,如果加optionally只在char,varchar,text等类型上加,默认不使用

 fileds escaped by 'char'   //转义字符,默认\

 lines starting by 'string'  //每行前加字符 ''

 lines terminated by 'string'  //行未加字符串  默认\n 

 ignore number lines   //number 代表数字,忽略导入数据的前几行

 set 列名=exp   //将某个列转换后再加载


你可能感兴趣的:(load,Data)