mysql 命令导入导出sql
导出(不进入mysql)
mysqldump -h10.168.193.2 -uwanyouxicom -p52wyxg7P3v5N7 wanyouxicom wyx_phome_ecms_advert>advert.sql
导入(进入mysql)
source /dir_for_sql_file/sql.sql
其实我一直在你身边
导出(不进入mysql)
mysqldump -h10.168.193.2 -uwanyouxicom -p52wyxg7P3v5N7 wanyouxicom wyx_phome_ecms_advert>advert.sql
导入(进入mysql)
source /dir_for_sql_file/sql.sql
mysql -uroot -p1234
create database wiki default charset utf8;
use wiki;
source /your_wiki_sql_file_path/wiki.sql
insert into car_media_article_click(media_id,article_id,click_num) values(3,1770351,1) on duplicate key update click_num = click_num + 1
update by_article set pic_url = replace(pic_url,’oyskpbhvb.bkt.clouddn.com’,’wximg.checheng.cn’)
select date,DATE_FORMAT(date,’%Y%m’) weeks,sum(`install`) install_count,sum(`launches`) launches_count,sum(`active`) active_count from tj_app_day_data where date >=’2017-10-25′ and date<='2017-12-17' group by weeks;
select `date`,DATE_FORMAT(date,’%Y%m’) months,sum(`install`) install_count,sum(`launches`) launches_count,sum(`active`) active_count from tj_app_day_data where appid=’$appid’ and date >=’$start_date’ and date<='$end_date' group by months
新建索引
curl -XPUT ‘http://localhost:9200/dept/employee/1’ -d ‘{ “empname”: “emp1”}’
删除数据
curl -XDELETE ‘http://localhost:9200/dept/employee/3’
IK Analysis for ElasticSearch
The IK Analysis plugin integrates Lucene IK analyzer (http://code.google.com/p/ik-analyzer/) into elasticsearch, support customized dictionary.
Analyzer: ik_smart , ik_max_word , Tokenizer: ik_smart , ik_max_word
$client = Elasticsearch\ClientBuilder::create()
# ->setHosts([“localhost:9200”])
->setHosts([“101.37.85.163:9200”])
->setRetries(1)
->build();
namespace searchapi\controllers;
use Yii;
use yii\web\Controller;
use searchapi\models\CarBrandInfo;
use searchapi\models\CarBrandType;
use searchapi\models\CarBrandTypeInfo;
use searchapi\models\CarBrandSonTypeInfo;
use searchapi\models\CarFactory;
use yii\data\Pagination;
use yii\helpers\BaseJson;
use Elasticsearch;