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

Õýȷɾ³ýMYSQlÈÕÖ¾·½·¨

1.²éÕÒµ±
mysql> show binary logs;
+—————-+———–+
| Log_name | File_size |
+—————-+———–+
| mysql-bin.000001 | 150462942 |
| mysql-bin.000002 | 125 |
| mysql-bin.000003 | 106 |
+—————-+———–+
2.ɾ³ýbin-log(ɾ³ýmysql-bin.000003֮ǰµÄ¶øûÓаüº¬mysql-bin.000003)
mysql> purge binary logs to ‘mysql-bin.000003′;
Query OK, 0 rows affected (0.16 sec)
3. ²éѯ½á¹û(ÏÖÔÚÖ»ÓÐÒ»Ìõ¼Ç¼ÁË.)
mysql> show binlog events\G
*************************** 1. row ***************************
Log_name: mysql-bin.000003
Pos: 4
Event_type: Format_desc
Server_id: 1
End_log_pos: 106
Info: Server ver: 5.1.26-rc-log, Binlog ver: 4
1 row in set (0.01 sec)
(mysql-bin.000001ºÍmysql-bin.000002Òѱ»É¾³ý)
mysql> show binary logs;
+—————-+———–+
| Log_name | File_size |
+—————-+———–+
| mysql-bin.000003 | 106 |
+—————-+———–+
1 row in set (0.00 sec)
(ɾ³ýµÄÆäËü¸ñʽÔËÓÃ!)
¡¡ PURGE {MASTER | BINARY} LOGS TO ‘log_name’
¡¡¡¡PURGE {MASTER | BINARY} LOGS BEFORE ‘date’
¡¡¡¡ÓÃÓÚɾ³ýÁÐÓÚÔÚÖ¸¶¨µÄÈÕÖ¾»òÈÕÆÚ֮ǰµÄÈÕÖ¾Ë÷ÒýÖеÄËùÓжþ½øÖÆÈÕÖ¾¡£ÕâЩÈÕÖ¾Ò²»á´Ó¼Ç¼ÔÚÈÕÖ¾Ë÷ÒýÎļþÖеÄÇåµ¥Öб»É¾³ý£¬ÕâÑù±»¸ø¶¨µÄÈÕÖ¾³ÉΪµÚÒ»¸ö¡£
¡¡¡¡ÀýÈ磺
¡¡¡¡PURGE MASTER LOGS TO ‘mysql-bin.010′;
¡¡¡¡PURGE MASTER LOGS BEFORE ‘2008-06-22 13:00:00′;
Çå³ý3ÌìÇ°µÄ binlog
PURGE MASTER LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 3 DAY);
¡¡¡¡BEFORE±äÁ¿µÄdate×Ô±äÁ¿¿ÉÒÔΪ’YYYY-MM-DD hh:mm:ss’¸ñʽ¡£MASTERºÍBINARYÊÇͬÒå´Ê¡£
¡¡¡¡Èç¹ûÄúÓÐÒ»¸ö»îÐԵĴÓÊô·þÎñÆ÷£¬¸Ã·þÎñÆ÷µ±Ç°ÕýÔÚ¶ÁÈ¡ÄúÕýÔÚÊÔͼɾ³ýµÄÈÕÖ¾Ö®Ò»£¬Ôò±¾Óï¾ä²»»áÆð×÷Ó㬶øÊÇ»áʧ°Ü£¬²¢°éËæÒ»¸ö´íÎó¡£²»¹ý£¬Èç¹û´ÓÊô·þÎñÆ÷ÊÇÐÝÖ¹µÄ£¬²¢ÇÒÄúÅöÇÉÇåÀíÁËÆäÏëÒª¶ÁÈ¡µÄÈÕÖ¾Ö®Ò»£¬Ôò´ÓÊô·þÎñÆ÷Æô


Ïà¹ØÎĵµ£º

mysqlÎÊÌ⼯×Ü

°²×°ÅäÖÃmysql
http://edu.codepub.com/2009/1213/18710.php
Ò»¡¢
ÏÂÔرàÒë°²×°
#cd /usr/local/src/
#wget http://mysql.byungsoo.net/Downloads/MySQL-5.1/mysql-5.1.38.tar.gz
#tar –xzvf mysql-5.1.38.tar.gz ../software/
#./configure
--prefix=/usr/local/mysql //MySQL°²×°Ä¿Â¼
--datadir=/mydata / ......

FedoraÏÂMysqlµÄ¼òµ¥Ê¹ÓÃ

תµ½¸½Â¼1£¨mysql ÃüÁî´óÈ« - ÃüÁîÏê½â
£©
תµ½¸½Â¼2£¨mysqlÂÒÂëÎÊÌâ½â¾ö·½·¨
£©
ÔÚÎÒµÄFedoraÖУ¬ÔÚϵͳ°²×°Ê±ÎÒ¾ÍÑ¡Ôñ°²×°ÁËMysqlÁË£¬ËùÒԾͲ»ÓÃÔÙÈ¥ÏÂÔØÔ´´úÂ룬ȻºóÈ¥ÂýÂý±àÒë¡£¹þ¹þ£¬ÍµÁËÒ»¸öÀÁ¡£
ϵͳ°²×°ºÃÁË£¬Mysqlʱ±Ø²»¿ÉÉٵģ¬ËùÒÔÒ»¶¨Òª¼ìÑéÒ»ÏÂMysql¿ÉÒÔÓò»¡£
Ê×ÏÈÇл»µ½rootÕË»§£¬È»ºóÊäÈëÃüÁs ......

[ת]mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεÈ


mysql alter Óï¾äÓ÷¨,Ìí¼Ó¡¢Ð޸ġ¢É¾³ý×ֶεȠ      
     
     
//Ö÷¼ü549830479      
     
   alter table tabelname add new_fiel ......

phpÁ¬½Ómysql²âÊÔºÍÅäÖÃ


phpÁ¬½Ómysql²âÊÔ´úÂ룺
$link=mysql_connect('localhost','root','123456');
if(!$link) echo "ʧ°Ü!";
else echo "³É¹¦!";
mysql_close();
?>
ÔËÐдúÂë³öÏÖ£ºCall   to   undefined   function   'mysql_connect()'… ʧ°Ü
°Ù¶ÈÕÒµ½½á¹ûÊÇPHP+MYSQL »·¾³Ã ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ