摘要:
DELIMITER $$USE `servant_591up`$$DROP PROCEDURE IF EXISTS `sp_move_data`$$CREATE PROCEDURE `sp_move_data`()BEGINDECLARE v_exit INT DEFAULT 0;DECLARE v_spid BIGINT;DECLARE v_id BIGINT;DECLARE i INT DEFAULT 0;DECLARE c_table INT;DECLARE v_UniqueKey VARCHAR(57);DECLARE v_TagCatalogId INT;DECLARE v_Root 阅读全文
摘要:
LOAD DATA LOCAL INFILE 'c:\userlist.txt' INTO TABLE temp_userFIELDS ESCAPED BY '\\' TERMINATED BY '\t' LINES TERMINATED BY '\r\n' (`username`, `userid`)CREATE TABLE tc_userinfo(`username` VARCHAR(100),`ip` VARCHAR(100))ENGINE = MYISAM DEFAULT CHARSET=utf8SELECT * FROM 阅读全文
摘要:
mysql函数大全 对于针对字符串位置的操作,第一个位置被标记为1。 ASCII(str) 返回字符串str的最左面字符的ASCII代码值。如果str是空字符串,返回0。如果str是NULL,返回NULL。 mysql> select ASCII('2'); -> 50 mysql> select ASCII(2); -> 50 mysql> select ASCII('dx'); -> 100 也可参见ORD()函数。 ORD(str) 如果字符串str最左面字符是一个多字节字符,通过以格式((first byte ASCI 阅读全文
摘要:
mysql_upgrade should be executed each time you upgrade MySQL. It checks all tables in all databases for incompatibilities with the current version of MySQL Server. If a table is found to have a possible incompatibility, it is checked. If any problems are found, the table is repaired. mysql_upgrade a 阅读全文
摘要:
EXPLAINSELECT COUNT(*) FROM ol_answerresult_1 INNER JOIN ol_question ON ol_answerresult_1.QuestionId = ol_question.QuestionId AND PaperId='00000000-0000-0000-0000-000000000000' AND ol_question.IsConfirmed=1 AND QuestionCategory=1 AND ol_question.SimilarType<>2 AND (GKYear!=0 OR GKArea! 阅读全文
摘要:
mysqlslap --defaults-file="C:/Program Files/MySQL/MySQL Server 5.1/my.ini" --concurrency=200 --iterations=1 --number-int-cols=4 --auto-generate-sql --auto-generate-sql-load-type=mixed,update,write,key,read --engine=myisam --number-of-queries=1000 -uroot -p8319999mysqlslap --defaults-file=& 阅读全文
摘要:
C:\Program Files\MySQL\MySQL Server 5.1\scripts>mysqlslap --defaults-file="C:/Program Files/MySQL/MySQL Server 5.1/my.ini" --concurrency=50 --iterations=1 --number-int-cols=4 --auto-generate-sql --auto-generate-sql-load-type=update --engine=myisam --number-of-queries=10000 -uroot -p8319 阅读全文
摘要:
mysqlbinlog -R -h 192.168.56.221 -u tongchao -p111111 mysql0-bin.000001 --start-datetime="2010-12-22 00:00:00" --stop-datetime="2010-12-22 05:00:00"远程binlog获取需要权限,replication slave权限mysqlbinlog -d 591up /data0/mysql/3306/tc/log-bin.000536 --start-datetime='2010-12-20 00:02:50 阅读全文
摘要:
MySQL与MSSQL 有一个区别在于MySQL建表的时候需要选择存储引擎,常用的存储引擎有MyISAM和InnoDB而由于InnoDB是一个健壮的事务型存储引擎,已经有10多年的历史,一些重量级的互联网公司(Yahoo,Google Netease ,Taobao)也经常使用我的日常工作也经常接触InnoDB,现在就InnoDB一部分可以改善性能的参数列举1. innodb_additional_mem_pool_size除了缓存表数据和索引外,可以为操作所需的其他内部项分配缓存来提升InnoDB的性能。这些内存就可以通过此参数来分配。推荐此参数至少设置为2MB,实际上,是需要根据项目的In 阅读全文
摘要:
SET @rowNum = 0;SELECT userid,@rowNum:=@rowNum+1 AS rowNo FROM ol_user ORDER BY userid DESC LIMIT 10; 阅读全文