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

ÅúÁ¿Ìø¹ýmysql slave´íÎóС½Å±¾

[perl] ÅúÁ¿Ìø¹ýmysql slave´íÎóС½Å±¾
2009Äê02ÔÂ20ÈÕ 16:24
·¢ÏÖmysql slave·þÎñÆ÷¾­³£ÒòΪһЩÌØÊâ×Ö·û»òÕß·ûºÅ²úÉúµÄ¸üÐÂÓï¾ä±¨´í£¬Õû¸öͬ²½Ò²»áÒò´Ë¶ø¿¨ÔÚÄÇ£¬×î³õµÄ°ì·¨Ö»ÊÇÊÖ¶¯È¥³ö´íµÄ»úÆ÷£¬Ö´ÐÐÏÂÃæÈýÌõsqlÓï¾ä£¬Ìø¹ý´íÎó¼´¿É¡£
slave stop;
set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
slave start;
һ̨slave»úÆ÷ÓÃÕâÑù·½·¨»¹ÐУ¬¶ą̀¾ÍÂé·³ÁË£¬¾Í˳ÊÖдÁ˸ö¼òµ¥µÄperl½Å±¾£¬·½±ãͳһÌø¹ý´íÎ󣬴úÂëÈçÏ£º
#!/usr/bin/env perl
use strict;
use warnings;
my @hosts = qw/
192.168.1.123:root:tt1234
192.168.1.124:root:tt1234
/;
foreach (@hosts) {
    my ($ip, $usr, $pass) = split ':';
    print "// ----- $ip\n";
    slaveskip($ip, $usr, $pass);
    print "\n";
}
# mysql slave skip
sub slaveskip {
    my ($ip, $usr, $pass) = @_;
    my $info = `mysql -u$usr -p$pass -h$ip -e 'show slave status\\G;'`;
    # Slave_SQL_Running is No
    if (($info =~ /Slave_IO_Running: Yes/) && ($info =~ /Slave_SQL_Running: No/)) {
        my $errno = $1 if $info =~ /Last_Errno: (\d*)/;
        my $error = $1 if $info =~ /Last_Error: (.*)/;
        if ($errno > 0 && length($error) > 0) {
            print "slave error**\n";
            print "errno : $errno\nerror : $error\n";
            system("mysql -u$usr -p$pass -h$ip -e 'slave stop;'");
            system("mysql -u$usr -p$pass -h$ip -e 'set GLOBAL SQL_SLAVE_SKIP_COUNTER=1;'");
            system("mysql -u$usr -p$pass -h$ip -e 'slave start;'");
        }
    } else {
&n


Ïà¹ØÎĵµ£º

windows 7 Ï°²×°apache php ºÍmysqlµÄһЩÎÊÌâ¡£

ÔÚwindowsÏ°²×°ampÍøÉϵĽéÉܺܶàÁË¡£
ÎÒÕâÀïֻ˵Щ¹Ø¼üµÄ²¿·Ö£¬Ò»·½Ãæ×÷Ϊ±Ê¼Ç£¬ÁíÒ»·½ÃæºÍ´ó¼Ò¹²Ïí¡£
1.°²×°apache
   a.ÕâÀïҪעÒ⣬ÔÚ¸Õ¿ªÊ¼ÌîдÖ÷»úÓòÃûʱ£¬Èç¹ûÄãûÓÐÓòÃû£¬¾ÍÔÚ±¾µØ°²×°£¬ÄǾÍÌîд±¾»úipÐÐÁË¡££¨ÎÒ¾õµÃÌîд127.0.0.1¸üºÃ£¬¾ßÌåÎÒûÊÔ¹ý£©
   b.apache µÄĬÈ϶˿ÚÊÇ80£¬ÎÒµÄ ......

mysql ´æ´¢ÒýÇæ

Õâ¶Îʱ¼äÔÚ¿´¡¶High Performance MySQL¡·£¬¿´µ½´æ´¢ÒýÇæÕâ¸öµØ·½¸Ðµ½ºÜ¶àϸ½Ú±È½ÏÄ°Éú£¬ËùÒÔ×ܽáС¼ÇһЩ
ΪÁËÊÊÓ¦¸÷ÖÖ²»Í¬µÄÔËÐл·¾³£¬MYSQLÌṩÁ˶àÖÖ²»Í¬µÄ´æ´¢ÒýÇ棨Storage Engine
£©,ÔÚÓ¦ÓóÌÐò¿ª·¢Õâ¸ö²ãÃæÉÏ£¬¿ª·¢Õß¿ÉÒÔ¸ù¾Ý²»Í¬µÄÐèÇóÑ¡ÔñÊʺϵÄStorage Engine
·½°¸£¬¸üΪÁé»îµÄÊÇ£¬Äã¿ÉÒÔ¸ù¾ÝÿÕÅ±í½«Òª´æ´¢Êý ......

Mysql³£ÓÃÃüÁîÐдóÈ«

µÚÒ»ÕС¢mysql·þÎñµÄÆô¶¯ºÍÍ£Ö¹
net stop mysql
net start mysql
µÚ¶þÕС¢µÇ½mysql
Óï·¨ÈçÏ£º mysql -uÓû§Ãû -pÓû§ÃÜÂë
¼üÈëÃüÁîmysql -uroot -p£¬ »Ø³µºóÌáʾÄãÊäÈëÃÜÂ룬ÊäÈë12345£¬È»ºó»Ø³µ¼´¿É½øÈëµ½mysqlÖÐÁË£¬mysqlµÄÌáʾ·ûÊÇ£º
mysql>
×¢Ò⣬Èç¹ûÊÇÁ¬½Óµ½ÁíÍâµÄ»úÆ÷ÉÏ£¬ÔòÐèÒª¼ÓÈëÒ»¸ö²ÎÊý-h»úÆ÷IP
µ ......

15.2.6.5. InnoDBºÍMySQL¸´ÖÆ


15.2.6.5. InnoDBºÍMySQL¸´ÖÆ
MySQL¸´ÖƾÍÏñ¶ÔMyISAM±íÒ»Ñù£¬Ò²¶ÔInnoDB±íÆð×÷Óá£ÒÔijÖÖ·½Ê½Ê¹Óø´ÖÆÒ²ÊÇ¿ÉÄܵģ¬ÔÚÕâÖÖ·½Ê½ÖдӷþÎñÆ÷ÉϱíµÄÀàÐͲ»Í¬ÓÚÖ÷·þÎñÆ÷ÉÏԭʼ±íµÄÀàÐÍ¡£ÀýÈ磬Äã¿ÉÒÔ¸´ÖÆÐ޸ĵ½Ö÷·þÎñÆ÷ÉÏÒ»¸öInnoDB±í£¬µ½´Ó·þÎñÆ÷ÉÏÒ»¸öMyISAM±íÀï¡£
ҪΪһ¸öÖ÷·þÎñÆ÷½¨Á¢Ò»¸öзþÎñÆ÷£¬Äã²»µÃ²»¸´ÖÆIn ......

MYSQL 5.0 ÒÔÉÏ 8Сʱ³¬Ê±ÎÊÌâ


Ó¦ÓóÌÐòºÍÊý¾Ý¿â½¨Á¢Á¬½Ó£¬Èç¹û³¬¹ý8СʱӦÓóÌÐò²»È¥·ÃÎÊÊý¾Ý¿â£¬Êý¾Ý¿â¾Í¶ÏµôÁ¬½Ó ¡£ÕâʱÔٴηÃÎʾͻáÅ׳öÒì³££¬ÈçÏÂËùʾ£º
java.io.EOFException
    at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1913)
    at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.jav ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ