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

mysql¹ØÓÚÍøÉÏÁ÷תµÄ£¬Éú³É£³£¬£¶Ö®¼äµÄËæ»úÕûÊý

Èç¹ûÄãËÑË÷GOOGLE£¬Äã»áÕÒµ½ºÜ¶à¹ØÓÚmysqlµÄËæ»úÊý£¬ËûÃÇ»áÕâÑù˵
Éú³É£³£¬£¶Ö®¼äµÄËæ»úÕûÊý
FLOOR(3 + (RAND() * 6))
ÔÚ4ºóÃæÌí¼ÓÒ»¸ö3µ½6Ö®¼äµÄÕûÊý
CONCAT(343,FLOOR(3 + (RAND() * 6)))
ÔÚijһ×ֶκóÃæÌí¼Óһλ£³£¬£¶Ö®¼äµÄÕûÊý
UPDATE test SET xx= CONCAT(xx,FLOOR(3 +(RAND() * 6)));
µ«ÊÇÎÒ˽×Ô²âÊÔÁËһϣ¬·¢ÏÖÕâÑù×öµÄ»°£¬²úÉúµÄËæ»úÊý»áÊÇ3-9Ö®¼äµÄ¡£×Ðϸ·ÖÎöÒ»¿´£¬·¢ÏÖÒ»¸öÎÊÌ⣺Rand()*6»á²úÉú0µ½6Ö®¼äµÄËæ»úÊý£¬Èç¹ûÔÙ¼ÓÉÏÒ»¸ö3µÄ»°£¬²úÉúµÄËæ»úÊý£¬×ÔÈ»¾ÍÊÇ3-9Ö®¼äµÄÁË¡£²»ÖªµÀÍøÉÏÕâô¶àÈËתÕâ¸öÌù×Ó£¬ÊDz»ÊÇÕæµÄ×Ô¼ºÊÔ¹ý£¬Ïë¹ý£¿


Ïà¹ØÎĵµ£º

תһƪ²âÊÔ Amoeba For MySQLµÄÎÄÕÂ

×÷ÕߣºSky.Jian | ¿ÉÒÔÈÎÒâ×ªÔØ, µ«×ªÔØÊ±Îñ±ØÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂԭʼ³ö´¦ ºÍ ×÷ÕßÐÅÏ¢ ¼° °æÈ¨ÉùÃ÷
Á´½Ó£ºhttp://www.jianzhaoyang.com/database/amoeba_for_mysql | del.icio.us | Twitter it
ͬÊ Struct Chen µÄ Amoeba For MySQL ÏîÄ¿ÒѾ­ ³öÀ´²»¶Ìʱ¼äÁË£¬¿ÉһֱûÓÐʱ¼äºÃºÃÌåÑ飬×î½üÒ»Ö±ÔÚ×öһЩÈí¼þºÍÓ²¼þ ......

ͬ²½Æô¶¯Ñ¡Ïî(mysql ͬ²½)

²»¹ÜÊÇmaster»¹ÊÇslave£¬¶¼ÒªÉ趨 server-id Ñ¡ÏîÀ´È·¶¨Ê¹ËüÃǶ¼Óи÷×ÔΨһµÄͬ²½ID¡£±ØÐëÑ¡Ôñ 1 µ½ 2^32-1 Ö®¼äµÄÕýÕûÊý¡£ÀýÈ磺 server-id=3¡£
¹ØÓÚmaster·þÎñÆ÷ÉÏ¿ÉÓÃÓÚ¿ØÖƶþ½øÖÆÈÕÖ¾¼Ç¼µÄÑ¡ÏîÏêϸÃèÊöÇë¿´"5.9.4 The Binary Log"¡£
ϱíÃèÊöÁËslaveͬ²½¿ÉÓõÄÑ¡Ï¿ÉÒÔÔÚÃüÁîÐлòÕßÅäÖÃÎļþÖÐÉ趨ËüÃÇ¡£
һЩslav ......

mysql Ïà¹ØÅäÖÃ

mysqlÖв»Çø·Ö´óСд£º
LinuxÖÐMySQLµÄÅäÖÃÎļþÖÐ(/etc/my.cnf)£¬ÊÇûÓÐlower_case_table_names=1ÕâÐеġ£
ÔÚWindows°²×°µÄMySQLµÄÅäÖÃÎļþÖÐ(my.ini)£¬ÊÇÓÐlower_case_table_names=1ÕâÐеġ£
lower_case_table_names=1µÄÓÃ;ÊÇÈÃMySQLʵÏÖ²»Çø·Ö´óСд
mysqlÖÐÔÊÐíÆäËû»úÆ÷·ÃÎÊ£º
mysql> use mysql;
Õâ¾ä»°µÄÒâ˼ ......

mysql Ö÷´ÓÐĵÃ


grant replication slave on *.* to 'guest'@'192.168.1.%' identified by '123456'
change master to master_host='192.168.1.190',master_user='guest',master_password='123456',master_port=3306
mysql> change master to master_host='192.168.1.190',master_user='guest',master_password='123456',master_log ......

MySQLѧϰ(5)IN,GRANT,MD5,EXISTS

1.INµÄÓ÷¨
IN(value,value1,...) valuesµÄ¸öÊý¸úmax_allowed_packetÏà¹Ø£¬SELECT 2 IN (2,4,'STRING');
NOT IN(value,..)ºÍINÓï·¨Ò»Ñù¡£
2.IF NOT EXISTS
CREATE ... IF NOT EXISTS stm; ...¿ÉÒÔʹDATABASE,TABLE,EVENT¡£ÈçCREATE TABLE IF NOT EXISTS t(id INT); 
3.MD5,MySQLÊý¾Ý¿âÌṩÁËmd5¼ÓÃܹ¦Ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ