Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysql ±¸·ÝºÍ»Ö¸´²ßÂÔ

mysql ±¸·ÝºÍ»Ö¸´²ßÂÔ
ÎÄÕ·ÖÀà:Êý¾Ý¿â
ÔÚÊý¾Ý¿â±í¶ªÊ§»òË𻵵ÄÇé¿öÏ£¬±¸·ÝÄãµÄÊý¾Ý¿âÊǺÜÖØÒªµÄ¡£Èç¹û·¢Éúϵͳ±ÀÀ££¬Äã¿Ï¶¨ÏëÄܹ»½«ÄãµÄ±í¾¡¿ÉÄܶªÊ§×îÉÙµÄÊý¾Ý»Ö¸´µ½±ÀÀ£·¢ÉúʱµÄ״̬¡£±¾ÎÄÖ÷Òª¶ÔMyISAM±í×ö±¸·Ý»Ö¸´¡£
 
±¸·Ý²ßÂÔÒ»£ºÖ±½Ó¿½±´Êý¾Ý¿âÎļþ£¨²»ÍƼö£©
±¸·Ý²ßÂÔ¶þ£ºÊ¹ÓÃmysqlhotcopy±¸·ÝÊý¾Ý¿â£¨ÍêÈ«±¸·Ý£¬ÊʺÏСÐÍÊý¾Ý¿â±¸·Ý£©
±¸·Ý²ßÂÔÈý£ºÊ¹ÓÃmysqldump±¸·ÝÊý¾Ý¿â£¨ÍêÈ«+ÔöÁ¿±¸·Ý£¬ÊʺÏÖÐÐÍÊý¾Ý¿â±¸·Ý£©
±¸·Ý²ßÂÔËÄ£ºÊ¹ÓÃÖ÷´Ó¸´ÖÆ»úÖÆ(replication)£¨ÊµÏÖÊý¾Ý¿âʵʱ±¸·Ý£©
 
½Å±¾ÏÂÔصØÖ·£ºµã»÷ÏÂÔؽű¾
 
±¸·Ý²ßÂÔÒ»¡¢Ö±½Ó¿½±´Êý¾Ý¿âÎļþ
Ö±½Ó¿½±´Êý¾ÝÎļþ×îΪֱ½Ó¡¢¿ìËÙ¡¢·½±ã£¬µ«È±µãÊÇ»ù±¾Éϲ»ÄÜʵÏÖÔöÁ¿±¸·Ý¡£ÎªÁ˱£Ö¤Êý¾ÝµÄÒ»ÖÂÐÔ£¬ÐèÒªÔÚ±¸·ÝÎļþÇ°£¬Ö´ÐÐÒÔÏ SQL Óï¾ä£º
FLUSH TABLES WITH READ LOCK;
Ò²¾ÍÊÇ°ÑÄÚ´æÖеÄÊý¾Ý¶¼Ë¢Ðµ½´ÅÅÌÖУ¬Í¬Ê±Ëø¶¨Êý¾Ý±í£¬ÒÔ±£Ö¤¿½±´¹ý³ÌÖв»»áÓÐеÄÊý¾ÝдÈë¡£ÕâÖÖ·½·¨±¸·Ý³öÀ´µÄÊý¾Ý»Ö¸´Ò²ºÜ¼òµ¥£¬Ö±½Ó¿½±´»ØÔ­À´µÄÊý¾Ý¿âĿ¼Ï¼´¿É¡£
 
±¸·Ý²ßÂÔ¶þ¡¢Ê¹ÓÃmysqlhotcopy±¸·ÝÊý¾Ý¿â
mysqlhotcopy ÊÇÒ»¸ö PERL ³ÌÐò£¬×î³õÓÉTim Bunce±àд¡£ËüʹÓàLOCK TABLES¡¢FLUSH TABLES ºÍ cp »ò scp À´¿ìËÙ±¸·ÝÊý¾Ý¿â¡£ËüÊDZ¸·ÝÊý¾Ý¿â»òµ¥¸ö±íµÄ×î¿ìµÄ;¾¶£¬µ«ËüÖ»ÄÜÔËÐÐÔÚÊý¾Ý¿âÎļþ£¨°üÀ¨Êý¾Ý±í¶¨ÒåÎļþ¡¢Êý¾ÝÎļþ¡¢Ë÷ÒýÎļþ£©ËùÔڵĻúÆ÷ÉÏ£¬²¢ÇÒmysqlhotcopy Ö»ÄÜÓÃÓÚ±¸·Ý MyISAM±í¡£
±¾±¸·Ý²ßÂÔÊʺÏÓÚСÐÍÊý¾Ý¿âµÄ±¸·Ý£¬Êý¾ÝÁ¿²»´ó£¬¿ÉÒÔ²ÉÓÃmysqlhotcopy³ÌÐòÿÌì½øÐÐÒ»´ÎÍêÈ«±¸·Ý¡£
±¸·Ý²ßÂÔ²¼Öãº
£¨1£©¡¢°²×°DBD-mysql perlÄ£¿é£¬Ö§³Ömysqlhotcopy½Å±¾Á¬½Óµ½MySQLÊý¾Ý¿â¡£
shell> tar -xzvf  DBD-mysql-4.005.tar.gz
shell> cd DBD-mysql-4.005
shell> unset LANG
shell> perl Makefile.PL -mysql_config=/usr/local/mysql/bin/mysql_config -testuser=root -testpassword=UserPWD
shell> make
shell> make test
shell> make install
£¨2£©¡¢ÉèÖÃcrontabÈÎÎñ£¬Ã¿ÌìÖ´Ðб¸·Ý½Å±¾
shell> crontab -e
0 3 * * * /root/MySQLBackup/mysqlbackup.sh >/dev/null&


Ïà¹ØÎĵµ£º

tomcat ÅäÖÃmysql Êý¾Ý¿âÁ¬½Ó³Ø

tomcat °²×°Ä¿Â¼ÏµÄconfĿ¼ÖеÄcontext.xmlÓëweb.xmlÎļþ·Ö±ðÐÞ¸ÄÈçÏ£º
context.xml мÓÈçÏÂÄÚÈÝ£º
<Resource name="jdbc/mysql"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://Êý¾Ý¿âµØÖ·:3306/Êý¾Ý¿âà ......

Ò»¸öMYsqlÀà

<?php
class mysql {
 /*+++++++++++++++Êý¾Ý¿â·ÃÎÊÀà++++++++++++++++++++++++++
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 */
   //=================================================
        //Á¬½ÓÊý¾Ý
 private $Hos ......

MySQLÖÐÓÃsqlÓï¾ä²åÈëʱÆÚ

mysql> create table testdate(
         -> id int not null auto_increment primary key,
         -> time date);
Query OK, 0 rows affected (0.30 sec)
mysql> insert into testdate(time) values('2010-4-23');
Q ......

MYSQL 8Сʱ¶Ï¿ªÁ´½ÓÎÊÌâºÍ½â¾ö°ì·¨

MYSQL 8Сʱ ¶Ï¿ªÁ´½ÓÎÊÌâ
½â¾ö°ì·¨ÓÐÁ½¸ö£ºµÚÒ»ÊÇÉèÖÃautoReconnectÊôÐÔÉèÖÃΪtrue£»µÚ¶þÊÇÉèÖÃDBCP ʱ½«testqueryµÈ¼¸¸öÊôÐÔÒ»²¢ÉèÖá£
ÎÊÌâµÄÔ­ÒòÊÇ£¬MySQLµÄ²ÎÊýinteractive_timeout£¬Ò²¾ÍÊǽ»»¥³¬Ê±Ê±¼äĬÈÏΪ8Сʱ¡£Ò²¾ÍÊÇÈç¹ûÒ»¸öÁ´½ÓÔÚ8Сʱºó£¬»¹Ã»ÓкͷþÎñÆ÷½»»¥£¬Õâ¸öÁ¬½Ó¾Í»á±»MySQL·þÎñÆ÷¶Ï¿ª¡£ÒòΪMySQLÄÜ ......

Ôõô°Ñpowerdesignerµ¼³öµÄsqlÓÃPHPµ¼ÈëMysQLÊý¾Ý¿â

ÎÒÃÇÖªµÀÓÃpowerdesignerµ¼³öµÄsqlÎļþºó׺Ϊ'.sql'£»ÓÃphpmyadminºÜÈÝÒ×µ¼ÈëMysQLÊý¾Ý¿â£¬µ«ÊÇÓÃPHPÔõôµ¼ÈëÊý¾Ý¿âÄØ?
ÎÒÓÃpowerdesignerÉè¼ÆÒ»¸öÊý¾Ý¿âºóµ¼³ösqlÎļþ£¨Ò»¸öͶƱϵͳ£©Îª'vote.sql'£»
ÎļþÄÚÈÝΪ£¨Ò»Ð©sqlÓï¾äºÍ×¢ÊÍ£©£º
        
/*======================= ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ