mysqlϵķÖÒ³´æ´¢¹ý³Ì
CREATE PROCEDURE pro_page(
in _sql varchar(1000),
in _order varchar(1000),
in _pagecurrent int,
in _pagesize int
)
BEGIN
if _pagesize<=1 then
set _pagesize=20;
end if;
if _pagecurrent < 1 then
set _pagecurrent = 1;
end if;
set @strsql = concat(_sql,' ',_order,' limit ',_pagecurrent*_pagesize-_pagesize,',',_pagesize);
prepare stmtsql from @strsql;
execute stmtsql;
deallocate prepare stmtsql;
END;
Ïà¹ØÎĵµ£º
cmdÏÂÇл»µ½ mysql °²×°Ä¿Â¼
Àý
d:/mysql/bin (Èç¹ûÓÃWAMP°²×°ÔòÊÇD:\wamp\bin\mysql\mysql5.1.30\bin)
Ç°Ì᣺mysqlÓû§rootÃÜÂëΪ¿Õ.
ÊäÈë mysql -u root mysql
mysql> ״̬ÏÂÊäÈë update user set password=password('ÐÂÃÜÂë') where user='root';
»ØÏÔ
Query OK, 0 rows ......
ÓÃMYSQLÓï¾ä£º
mysql -uroot -p^^^^^ -e "select * from test.table2" > d:\a.xls
ÆäÖÐtestΪÊý¾Ý¿â table2ΪÆäÖеıí d:\a.xlsΪ±íλÖà ......
query_cache_min_res_unit ²éѯ»º´æ·ÖÅäµÄ×îС¿éµÄ´óС(×Ö½Ú)
query_alloc_block_size Ϊ²éѯ·ÖÎöºÍÖ´Ðйý³ÌÖд´½¨µÄ¶ÔÏó·ÖÅäµÄÄÚ´æ¿é´óС
Qcache_free_blocks´ú±íÄÚ´æ×ÔÓÉ¿éµÄ¶àÉÙ£¬·´Ó³ÁËÄÚ´æËéƬµÄÇé¿ö
==========================
1£©µ±²éѯ½øÐеÄʱºò£¬Mysql°Ñ²éѯ½á¹û±£´æÔÚqurey ......
1£ºMysql ÃüÁî²»¿ÉÒÔÖ´ÐÐ
ÔÒò £ººÇºÇ ±ÈÈç show databases µÄÃüÁî £¬Ö´ÐÐÍêÖ®ºó ɶҲûÓÐ £¬×Ðϸ ÕÒÁËÔÒò £¬Oh my god ÉÙÁË ·ÖºÅ¡£
Ӧд³É£ºshow databases;
2£ºÃüÁîÐÐÖÐÎÄÂÒÂëÎÊÌâ
ÏÖÏó£ºmysqlµÄĬÈϱàÂëÉèÖÃΪutf-8£¬Ò³ÃæÒÔutf-8µÄ±àÂ뷽ʽдÈëµ½Êý¾Ý¿â¡£Óù¤¾ß²é¿´Ò»ÇÐÕý³££¬µ«´ÓmysqlµÄÃüÁîÐжÁÊý¾Ý³öÀ´× ......