ʵÏÖwin2003ÏÂmysqlÊý¾Ý¿âÿÌì×Ô¶¯±¸·Ý
ÖÕÓÚÈ÷þÎñÆ÷ÿÌìÔçÉϱ¸·ÝÒ»´Î MySQL Êý¾Ý¿â²¢×Ô¶¯´ò°ü,ͬʱɾ³ý 5 ÌìÇ°µÄ±¸·ÝÎļþ. ·ÖÏíÈçÏÂ.
1. »·¾³: windows server 2003 + Apache 2.0 + PHP5 + MySQL 4.0.26 .
2. ¼ÙÉè PHP °²×°Ä¿Â¼Îª D:/php ,MySQL °²×°Ä¿Â¼Îª D:/mysql.
3. ÔÚ D:/php Ͻ¨Á¢Ä¿Â¼ WinRAR, °ÑÄã winrar °²×°Ä¿Â¼Ï嵀 WinRAR.exe ºÍ RARReg.KEY ¸´ÖƵ½ D:/php/WinRAR .
4. D:/php Ͻ¨Á¢Îļþ mysql_backup.php:
/*/////////////////////////
#FileName: mysql_backup.php
#Author: faisun
#Website: http://www.softpure.com
////////////////////////*/
//±£´æĿ¼,·¾¶ÒªÓ÷´Ð±¸Ü.ÄúÐèÒªÊÖ¶¯½¨Á¢Ëü.
$store_folder = 'D:databse_backup'; //Óû§ÃûºÍÃÜÂë
//¸ÃÕʺÅÐëÓвÙ×÷[ËùÓÐ]µÄÊý¾Ý¿â¼°FILEµÄȨÏÞ
//·ñÔòÓÐЩÊý¾Ý¿â²»Äܱ¸·Ý.
$db_username = "root";
$db_password = ""; $time=time(); $nowdir = "$store_folder".date("Ymd",$time)."";
if(file_exists("$nowdir.rar")) die("File exists.n");
@mkdir($nowdir); mysql_connect("localhost","$db_username","$db_password");
$query=mysql_list_dbs(); while($result=mysql_fetch_array($query)){
system (dirname(__FILE__).'..mysqlbinmysqldump --opt '."$result[Database] -u ".($db_password?"-p":"")." > $nowdir$result[Database].sql");
echo "dumping database `$result[Database]`...n";
}
echo "nWinrar loading...n"; system( dirname(__FILE__)."WinRARWinRAR.exe a -ep1 -r -o+ -m5 -df "$nowdir.rar" "$nowdir" " ); //ɾ³ý 5 ÌìÇ°µÄÎļþ
@unlink("$store_folder".date("Ymd",$time-86400*5).".rar"); echo "nOK!n"; >
5. D:/php Ͻ¨Á¢Îļþ mysql_backup.bat,ÄÚÈÝÖ»ÓÐÒ»¾ä:
php.exe mysql_backup.php
6. Ë«»÷¸Ã bat ÎļþÔËÐÐ,Èç¹ûÄܱ¸·ÝÁË,OK,ÏÂÒ»²½Ìí¼ÓÈÎÎñ¼Æ»®.
7. °Ñ D:/php/mysql_backup Ìí¼Óµ½ÈÎÎñ¼Æ»®,ʱ¼äѡÿÌì. ¸ù¾Ý·þÎñÆ÷µÄ¼à²â½á¹û,ÿÌìÔçÉÏ 5-8 ʱΪÁ÷Á¿µÍ·åÆÚ. ÓÉÓÚ 5-7 ʱÓÐЩÊý¾Ý¿âµÄÇåÀí¹¤×÷,ÎÒ°Ñʱ¼ä¶¨ÔÚÁËÔçÉÏ 8 µãÕû.
Ïà¹ØÎĵµ£º
×¼±¸
ls /usr/local/src // ÏÔʾÎļþÁбí
ls | wc -l // ²é¿´µ±Ç°ÎļþĿ¼ÏÂÎļþµÄ¸öÊý
gcc -v // ²é¿´±àÒ빤¾ßÊÇ·ñ´æÔÚ
rpm -qa|grep -i xxxx // ²é¿´ÏµÍ³ÖÐÊÇ·ñÒѾ°²×°ÁËijÈí¼þµÄÏà¹ØÈí¼þ°ü
rpm -e --nodeps xxxx // жÔØÈí ......
¿ÉÒԲο¼ÏÂÁÐÎÄÕÂ
http://www.mysqlperformanceblog.com/2010/03/23/too-many-connections-no-problem/
½áÂÛÈçÏ£º
£¨1£©mysqlĬÈÏ»á¸øsuperÓû§ÁôÒ»¸öÁ¬½Ó£¬Äã¿ÉÒÔÓÃÕâ¸öÔ¤ÁôµÄÁ¬½ÓÀ´µÇ¼£¬À´Ôö¼ÓÁ¬½ÓÊý£»µ«ÊÇÈç¹ûÁ¬½ÓµÄÓû§È«ÊÇsuperȨÏ޵ģ¬ÔòÕâ¸öÔ¤ÁôµÄÁ¬½Ó²»´æÔÚ¡£Õâʱ¿ÉÒÔÓÃÒÔϵÄÃüÁîÀ´ÉèÖÃÁ¬½ÓÊý£ºgdb -p $(cat ......
ÎÒÓõÄÊÇmysql5.0£¬
ÎÒ³ÌÐòÖÐÓõ½ÁËÒ»¾äsqlÊÇ
SQL code
select count(DISTINCT id) from Policyinfo p where p.filename not in
(select p2.filename from Policyreadinfo p2 where p2.reader='test')
µ«ÊÇÿ´ÎÔÚ³ÌÐòÖÐÿ´ÎÖ´ÐÐÕâ¾äsqlʱÍøÒ³¾ÍÌØÂý£¬Òª10¶àÃ룬¶øÕâ2¸ö±íµÄ¼Ç¼ÐÐÊýÒ²¾Í1000¶à¶øÒÑ£¬ÎÒ°ÑÕâ¾äsqlµ¥¶ÀÄ ......
ÔÚһЩÇé¿öÏ£¬MySQL¿ÉÒÔÖ±½ÓʹÓÃË÷ÒýÀ´Âú×ãÒ»¸ö ORDER BY »ò GROUP BY ×Ó¾ä¶øÎÞÐè×ö¶îÍâµÄÅÅÐò¡£¾¡¹Ü ORDER BY ²»ÊǺÍË÷ÒýµÄ˳Ðò׼ȷƥÅ䣬Ë÷Òý»¹ÊÇ¿ÉÒÔ±»Óõ½£¬Ö»Òª²»ÓõÄË÷Òý²¿·ÖºÍËùÓеĶîÍâµÄ ORDER BY ×Ö¶ÎÔÚ WHERE ×Ó¾äÖж¼±»°üÀ¨ÁË¡£ ¡¡¡¡Ê¹ÓÃË÷ÒýµÄMySQL Order By ¡¡¡¡ÏÂÁеļ¸¸ö²éѯ¶¼»áʹÓÃË÷ÒýÀ´½â¾ö ORDER BY ......
windows주
½â¾ö°ì·¨£º
1.¼ì²éÄãµÄMysqlĿ¼ÓÐûÓиøϵͳµÄSystemÓû§È¨ÏÞ¡£
2.ɾ³ýµôÄãµÄ %WINDOWS%/my.ini Îļþ¡£
3.¼ì²éÄãµÄ c:/my.cnf ÎļþÅäÖÃÊÇ·ñÕýÈ·¡£
ÐÞ¸Ä%windir%\my.ini£¬Ôö¼Ó
[mysqld]
#ÉèÖÃbasedirÖ¸ÏòmysqlµÄ°²×°Â·¾¶
basedir=D:\Program\Tools\mysql
datadir=D:\Program\Tools\mysql\data& ......