mysql命令、语句参考
连接本机上的mysql:
ps aux |grep mysql 查看链接
进入目录
cd /usr/local/mysql/bin
再键入命令
mysql -uroot -p
回车后提示输入密码。
退出mysql命令:exit(回车)
修复数据库
语法:mysqlcheck -r 数据库名 表名
mysqlcheck -r videokey sogou_keys -uroot -p
chown mysql.mysql *
语句参考
//通过核心关键词查询出相关关键词,然后csv格式导出数据;
SELECT keyword_name,cid FROM `tbl_keyword` WHERE `keyword_name` like '%电灶%'
SELECT `keyword_name` FROM `tbl_keyword` WHERE `keyword_name` like '%cd包%' or `keyword_name` like '%汽车%'
="update tbl_keyword set uztag= '"&B2&"' where keyword_name = '"&A2&"';"
update tbl_keyword set uztag = 'classId=167487&tagId=409001' where keyword_name = '调温电灶';
-- 表分区
--
CREATE TABLE IF NOT EXISTS `tao_items` (
`kid` int(11) NOT NULL,
`data` text NOT NULL,
`addtime` int(11) NOT NULL,
PRIMARY KEY (`kid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
PARTITION BY RANGE (kid)(
PARTITION p0 VALUES LESS THAN (500000),
PARTITION p1 VALUES LESS THAN (1000000),
PARTITION p2 VALUES LESS THAN (1500000),
PARTITION p3 VALUES LESS THAN (2000000),
PARTITION p4 VALUES LESS THAN (2500000),
PARTITION p5 VALUES LESS THAN (3000000),
PARTITION p6 VALUES LESS THAN MAXVALUE
);
CREATE TABLE IF NOT EXISTS `tao_goods` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`num_iid` varchar(20) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
PARTITION BY HASH (id)
PARTITIONS 100;
="update dt_company set introduce = '"&B2&"' where username = '"&A2&"';"
SELECT * from dt_company where introduce=''
查询某个字段为空的
select py from dt_business 拼音去掉重复
select * from dt_business
select * from tao_tkeys where kid >= 1 and <100000
select * from dt_company where username = 'lzhaixing'
select * from dt_company where userid = '57900'
select * from dt_business2 where username like '%sdljyt%' 字段内容模糊查询
SELECT * FROM `tao_tkeys` WHERE `kid` >= '1' and <= '9349'
SELECT username,introduce='',linkurl from dt_company where userid >57593 and userid <=62162
SELECT linkurl from dt_company where introduce='' and groupid >=6 and groupid <=9
delete from dt_business3 where itemid = 42024
update dt_business set business = '高压接头' where itemid = '46676';
update dt_business3 set business = '冷却塔内防腐' , py = 'lengquetaneifangfu' where itemid = '29533';
="update dt_business3 set business = '"&B1&"' , py = '"&C1&"' where itemid = '"&A1&"'; "
SELECT itemid,linkurl FROM dt_sell WHERE itemid >250000 and itemid <= 300000
DELETE FROM `q2vw34wzxs_gogbk`.`destoon_company_wjsell` WHERE `destoon_company_wjsell`.`itemid` =1;