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

ÉèÖÃMySQLÊý¾Ýͬ²½£¨µ¥Ïò&Ë«Ïò£©

ÉèÖÃMySQLÊý¾Ýͬ²½£¨µ¥Ïò&Ë«Ïò£©
ÓÉÓÚ¹«Ë¾µÄÒµÎñÐèÇó£¬ÐèÒªÍøͨºÍµçÐŵÄÊý¾Ýͬ²½£¬¾Í×öÁ˸öMySQLµÄË«Ïòͬ²½£¬¼ÇϹý³Ì£¬ÒÔºóÓõõ½ÔÙ·­³öÀ´£¬Ò²Ìù³öÀ´¹©´ó¼Ò²Î¿¼¡£
Ò»¡¢×¼±¸·þÎñÆ÷
ÓÉÓÚMySQL²»Í¬°æ±¾Ö®¼äµÄ(¶þ½øÖÆÈÕÖ¾)binlog¸ñʽ¿ÉÄܻ᲻һÑù£¬Òò´Ë×îºÃµÄ´îÅä×éºÏÊÇMasterµÄMySQL°æ±¾ºÍSlaveµÄ°æ±¾Ïàͬ»òÕ߸üµÍ£¬MasterµÄ°æ±¾¿Ï¶¨²»ÄܸßÓÚSlave°æ±¾¡£
±¾ÎÄÖУ¬ÎÒÃǼÙÉèÖ÷·þÎñÆ÷(ÒÔϼò³ÆMaster)ºÍ´Ó·þÎñÆ÷(ÒÔϼò³ÆSlave)µÄ°æ±¾¶¼ÊÇ5.0.27£¬²Ù×÷ϵͳÊÇRedHat Linux 9¡£
¼ÙÉèͬ²½MasterµÄÖ÷»úÃûΪ£ºA(IP:192.168.0.1)£¬SlaveÖ÷»úÃûΪ£ºB(IP:192.168.0.2)£¬2¸öMySQLµÄbasedirĿ¼¶¼ÊÇ/usr/local/mysql£¬datadir¶¼ÊÇ£º/var/lib/mysql¡£
¶þ¡¢ÉèÖÃͬ²½·þÎñÆ÷
1¡¢ÉèÖÃͬ²½Master
ÐÞ¸Ä my.cnf Îļþ£¬ÔÚ
# Replication Master Server (default)
# binary logging is required for replication
Ìí¼ÓÈçÏÂÄÚÈÝ£º
log-bin=/var/log/mysql/updatelog
server-id = 1
binlog-do-db=test
binlog-ignore-db=mysql
ÖØÆôMySQL,´´½¨Ò»¸öMySQLÕʺÅΪͬ²½×¨ÓÃ
GRANT REPLICATION SLAVE,RELOAD,SUPER, ON *.* TO back@192.168.0.2 IDENTIFIED BY 'back' ;
FLUSH PRIVILEGES ;
2¡¢ÉèÖÃͬ²½Slave
ÐÞ¸Ämy.cnfÎļþ£¬Ìí¼Ó
server-id = 2
master-host = 192.168.0.1
master-user = back
master-password = back
master-port = 3306
replicate-ignore-db=mysql
replicate-do-db=test
ÖØÆôMySQL
3¡¢Æô¶¯Í¬²½
ÔÚÖ÷·þÎñÆ÷A MySQLÃüÁî·ûÏ£º
show master status;
ÏÔʾ£¨µ±È»Õâ¸öÊÇÎÒ»úÆ÷µÄÇé¿ö£¬ÄãµÄ²»¿ÉÄܸúÎÒÒ»Ñù¹þ£¬Ö»ÊǸöÀý×Ó£©£º
+------------------+----------+-------------------+------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+------------------+----------+-------------------+------------------+
| updatelog.000028 | 313361 | test | mysql |
+------------------+----------+-------------------+------------------+
ÔÚ´Ó·þÎñÆ÷A MySQLÃüÁî·ûÏ£º
slave stop£»
CHANGE MASTER TO MASTER_LOG_FILE='updatelog.000028',MASTER_LOG_POS=313361;
slave start;
ÓÃshow slave status\G;¿´Ò»Ï´ӷþÎñÆ÷µÄͬ²½Çé¿ö
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Èç¹û¶¼ÊÇyes£¬ÄÇ´ú±íÒѾ­ÔÚͬ²½
Íù±íÀïÃæдµãÊý¾Ý²âÊÔһϿ´ÊÇ·ñͬ²½³É¹¦£¬Èç¹û²»³É¹¦£¬¾ø¶Ô²»ÊÇÄãµÄRPÎÊÌ⣬ÔÙ¼ì²éһϲÙ×


Ïà¹ØÎĵµ£º

mysql utf 8 ÂÒÂë½â¾ö======ÕýÈ·µÄ

mysql utf-8 ÂÒÂë½â¾ö
Êý¾Ý¿â 2009-09-15 12:34:33 ÔĶÁ327 ÆÀÂÛ0 ×ֺţº´óÖÐС
ÔÚÍøÉÏ¿´¹ýºÜ¶à½â¾ömysqlÂÒÂëµÄÌû×Ó£¬¿ÉÊÇдµÄ²»ÊÇÂÞÀïÂÞà¾͹ýÓÚ¸´ÔÓ¡£ÆäʵÂÒÂëûÄÇô¸´ÔÓ£¬ÊÇÍøÉϵĴóÏÀÃÇÏë¶àÁË¡£ÎÒÑо¿¹ýÒ»¶ÎÈÕ×Ó£¬×ܽá³öÒ»Ì××Ô¼ºµÄ½â¾ö·½°¸£¬Èç¹ûÄ㻹û½â¾öÂÒÂë¾ÍÓÃÎҵķ½·¨ÊÔһϡ£Îҵķ½°¸²»ÊÇ×îºÃµÄ£¬È´ÊÇ×î¼òµ¥Ò ......

ʵÀý½²½âÈçºÎʹÓÃC++²Ù×÷MySQLÊý¾Ý¿âÀà

 
¡¡¡¡ÓÃC++²Ù×÷MySQLÊý¾Ý¿âÀࣺ
¡¡¡¡×¢ÊÍ£ºÕ⼸¸öÀà¶Ô´¦Àí²»ÊǺܴóÊý¾ÝÁ¿µÄ²Ù×÷ÊǺÜÀíÏëµÄ£¬ µ«²»ÊÊÒËÌØ´óÐ͵ÄÊý¾ÝµÄ²éѯ£¬ÒòΪԴÂëÖн«²éѯµ½µÄÊý¾ÝÖ±½Ó·ÅÈëÁËÄÚ´æ¡£
¡¡¡¡/*
¡¡¡¡* project:
¡¡¡¡* ͨÓÃÄ£¿é ( Óà c++ ´¦Àí mysql Êý¾Ý¿âÀ࣬ÏñADO )
¡¡¡¡*
¡¡¡¡* description:
¡¡¡¡*
¡¡¡¡* ͨ¹ýDataBase,Reco ......

ÔõÑù½øÐÐMysqlÔ¶³ÌÁ¬½Ó


 ÔõÑù½øÐÐMysqlÔ¶³ÌÁ¬½Ó
ÎÒÓÃ:
grant all privileges on *.* to ´´½¨µÄÓû§Ãû@localhost identified by "ÃÜÂë";
flush privileges; \* ˢиղŵÄÄÚÈÝ*\
========================
mysqlĬÈÏÊDz»ÔÊÐíÔ¶³ÌÁ¬½ÓµÄ£¬ÒòΪÓкܴóµÄ°²È«Òþ»¼¡£¡£
ËùÒÔÐèÒªÊÖ¶¯Ôö¼Ó¿ÉÒÔÔ¶³Ì·ÃÎÊÊý¾Ý¿âµÄÓû§¡£
ÏÂÃæÊÇÁ¬½Ó·½Ê½£º
# m ......

MySQL ¶à¼¶²éѯ

ÐèÇó1£ºÔÚÒ»¸öselect ²éѯ¼¯ÖÐÔٴβéѯ
SELECT * from (SELECT field from table) AS alias
ÐèҪעÒâºóÃæµÄalias£¬ÔÚmysqlÖУ¬ÕâÊDZØÐëµÄ
ÐèÇó2£ºÒ»¸ö²éѯ¼¯µÄ½á¹û²»ÔÚÁíÒ»¸ö²éѯ¼¯ÖÐ
SELECT feild1 from table1 WHERE feild1 NOT IN (SELECT field2 from table2)
ÐèҪעÒ⣬ӦÓÃIN/NOT IN×Ó¾äʱ£¬±ØÐëÖ¸¶¨²éѯ×Ö¶ÎÃû£ ......

Ubuntu Ϲ¹½¨»ùÓÚ mysql ¹ÜÀíµÄ pure ftpd

²ÎÕÕ : http://ubuntuing.javaeye.com/blog/65547
µÚ
Ò»²½£º°²×°pure-ftpdºÍpure-ftpd-mysql.
apt-get install pure-ftpd
apt-get
install pure-ftpd-mysql
µÚ¶þ²½£ºÐÞ¸Äpure-ftpdÁ´½ÓmysqlµÄÃÜÂë
vim
/etc/pure-ftpd/db/mysql.conf
ĬÈÏÅäÖãº
#MYSQLServer    
localhost
#MYSQLPort& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ