MYSQL¸´ÖÆ
ÅäÖø´ÖÆ
1.ÅäÖÃserver-idºÍlog-bin
2.Ö÷¿âÖÐÌí¼ÓÓÃÓÚ¸´ÖƵÄÓû§
GRANT REPLICATION SLAVE,reload,super ON *.*
TO 'repl'@'%.vm.dba.com' IDENTIFIED BY 'slavepass'
3.ÔÚ´Ó¿âÉÏÉèÖÃÓÃÓÚ¸´ÖƵÄÑ¡Ïî
server-id
master-host
master-user
master-password
--read-only ¸ÃÑ¡ÏîÈôӷþÎñÆ÷Ö»ÔÊÐíÀ´×Ô´Ó·þÎñÆ÷Ï̻߳ò¾ßÓÐSUPERȨÏÞµÄÓû§µÄ¸üС£¿ÉÒÔÈ·±£´Ó·þÎñÆ÷²»½ÓÊÜÀ´×Ô¿Í»§µÄ¸üС£
--replicate-do-db=db_name ¸æËß´Ó·þÎñÆ÷ÏÞÖÆĬÈÏÊý¾Ý¿â(ÓÉUSEËùÑ¡Ôñ)Ϊdb_nameµÄÓï¾äµÄ¸´ÖÆ¡£
--replicate-wild-do-table=db_name.% ¿çÊý¾Ý¿â½øÐиüÐÂ
--replicate-do-table=db_name.tbl_name ¸æËß´Ó·þÎñÆ÷Ïß³ÌÏÞÖƶÔÖ¸¶¨±íµÄ¸´ÖÆ¡£
--replicate-ignore-db=db_name ¸æËß´Ó·þÎñÆ÷²»Òª¸´ÖÆĬÈÏÊý¾Ý¿â(ÓÉUSEËùÑ¡Ôñ)Ϊdb_nameµÄÓï¾ä¡£
--replicate-ignore-table=db_name.tbl_name ¸æËß´Ó·þÎñÆ÷Ï̲߳»Òª¸´ÖƸüÐÂÖ¸¶¨±íµÄÈκÎÓï¾ä(¼´Ê¹¸ÃÓï¾ä¿ÉÄܸüÐÂÆäËüµÄ±í)¡£
--replicate-wild-do-table=db_name.tbl_name ¸æËß´Ó·þÎñÆ÷Ïß³ÌÏÞÖƸ´ÖƸüеıíÆ¥ÅäÖ¸¶¨µÄÊý¾Ý¿âºÍ±íÃûģʽµÄÓï¾ä¡£
--replicate-wild-ignore-table=db_name.tbl_name ¸æËß´Ó·þÎñÆ÷Ï̲߳»Òª¸´ÖƱíÆ¥Åä¸ø³öµÄͨÅä·ûģʽµÄÓï¾ä¡£
--replicate-rewrite-db=from_name->to_name ¸æËß´Ó·þÎñÆ÷Èç¹ûĬÈÏÊý¾Ý¿â(ÓÉUSEËùÑ¡Ôñ)ΪÖ÷·þÎñÆ÷ÉϵÄfrom_name£¬Ôò·ÒëΪto_name¡£
--skip-slave-start ¸æËß´Ó·þÎñÆ÷µ±·þÎñÆ÷Æô¶¯Ê±²»Æô¶¯´Ó·þÎñÆ÷Ï̡߳£Ê¹ÓÃSTART SLAVEÓï¾äÔÚÒÔºóÆô¶¯Ï̡߳£
--slave-skip-errors=[err_code1,err_code2,... | all] ¸ÃÑ¡Ïî¸æËß´Ó·þÎñÆ÷SQLÏ̵߳±Óï¾ä·µ»ØÈκÎÑ¡ÏîÖµÖÐËùÁеĴíÎóʱ¼ÌÐø¸´ÖÆ¡£
4.´ÓÖ÷¿âͬ²½Êý¾Ýµ½´Ó¿â
4.1 load data from master;
4.2 ±¸·Ý»¹Ô·½Ê½
4.2.1 Æô¶¯´Ó·þÎñÆ÷¡£Èç¹ûÇ°ÃæÒѾ¸´ÖÆÁË£¬ÓÃ--skip-slave-startÑ¡ÏîÆô¶¯´Ó·þÎñÆ÷£¬ÒÔ±ãËü²»Á¢¼´³¢ÊÔÁ¬½ÓÖ÷·þÎñÆ÷¡£
4.2.2 Èç¹ûʹÓÃmysqldump±¸·ÝÖ÷·þÎñÆ÷µÄÊý¾Ý£¬½«×ª´¢Îļþ×°Ôص½´Ó·þÎñÆ÷¡£
cmd> mysql -u root -p < dump_file.sql
4.2.3 ÉèÖÃÁ¬½Ó²ÎÊý
mysql> CHANGE MASTER TO
-> MASTER_HOST='master_ho
Ïà¹ØÎĵµ£º
¸÷λ¸ßÊֺá£Ð¡µÜѧϰJAVA²»¾Ã£¬È»ºóÔÙÓÃMYSQLÊý¾Ý¿â¡£
ÓÉÓÚÊÇÓñðÈ˵ĵķ¶Àýѧϰ£¬ËùÒÔ³öÏֺܶàÆæ¹ÖµÄÎÊÌâ
ÎÒÓÃ×Ô¼ºµÄMYSQL ·þÎñÆ÷£¬È»ºó°Ñ±ðÈ˵ÄÊý¾Ý¿âµ¼½øÀ´¡£È»ºó³öÏÖ°æ±¾ÎÊÌâ¡£
ÎÊÌâÈçÏÂ
Table './db_librarysys/tb_manager' was created with a different version of MySQL and cannot be read
2010-4-28 22:44 ......
ÎÒд¹ýµÄ½Ì³Ì²»¶à£¬¶øÇҴ󲿷ֶ¼ÊÇÀ´Ô´ÓÚ±ðÈ˵Ľ̳̣¬²»¹ý£¬ÕâÀïËù½éÉܵģ¬¶¼ÊÇÈÚÈëÎÒËù×ܽáµÄ¾Ñ飮££ÒýÑÔ
¡¡¡¡
¡¡¡¡PHPµÄÖ´ÐÐЧÂÊÊÇÓÐÄ¿¹²¶ÃµÄ£¬ÕâÒ²ÊÇÎÒϲ»¶ËüµÄÔÒòÖ®Ò»£¬ºÍËü³ÆΪ¾øÃî´îµµµÄMysqlÒÔ¼°ApacheÏëÈںϣ¬²»Äܲ»¾ªÌ¾ÆäЧÂÊÁË¡£PHP¸üÐÂÒ²ºÜ¿ì£¬ÕâÀïÁоÙÁËÄ¿Ç°×îа汾PHP4.3.2RC4£¨¼¸ºõûÓÐBUGÁË£¬¹À¼ÆÐ´Í ......
MySQLÖØа²×°µÄʱºò³öÏÖÁËÎÊÌ⣺Could not start the service MySQL. Error:0,ÔÒòÊÇûÓжԾɵÄMySQLÍêȫжÔصô¡£
ÔÚÄã´ÓµçÄÔÀïжÔؾɵÄMYSQLÊý¾Ý¿â·þÎñʱ£¬Ê×ÏÈÏÈÔÚWINDOWS·þÎñÀïÍ£µôMYSQLµÄ·þÎñ¡£ÔÙµ½¿ØÖÆÃæ°åÀïµÄÔö¼Óɾ³ý³ÌÐòÄÚ½øÐÐɾ³ý£¬È»ºóÊÖ¶¯É¾³ýÔ°²×°Îļþ,µ«ÊÇÄã²¢²»ÄÜÍêÕûµÄ°ÑMYSQL·þÎñɾ ......
Can't open the mysql.plugin table. Please run mysql_upgrade to create it
µ±Åöµ½ÕâÑùµÄ´íÎóÊÇûÓгõʼ»¯mysqlÊý¾Ý¿â,¿ÉÒÔÔËÐÐÈçϽű¾¾Í¿ÉÒÔ½â¾ö
cd /opt/mysql-5.1.46
cd scripts/
./mysql_install_db --user=mysql --datadir=/usr/local/mysql/var/
ÔËÐÐÈçϵĴúÂë¾Í¿ÉÒÔ½â¾öÉÏÊöÎÊÌâ ......