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

MySQLÖ÷´Ó·þÎñÆ÷µÄһЩ¼¼ÇÉ(ת)

Ö÷´Ó·þÎñÆ÷±íÀàÐ͵ÄÑ¡Ôñ
Ò»°ãµÄ¹²Ê¶ÊÇÖ÷·þÎñÆ÷ʹÓÃinnodb£¬ÊÂÎñ£¬ÐÐËøµÈ¹¦ÄÜÊÇmyisamËùûÓеģ¬¶ÔÐ޸IJÙ×÷¶øÑÔ£¬Ëü¸ü¸ßЧ£»´Ó·þÎñÆ÷ʹÓÃmyisam£¬È«ÎļìË÷¹¦ÄÜÊÇinnodbËùûÓеģ¬¶Ô²éѯ²Ù×÷¶øÑÔ£¬Ëü¸ü¸ßЧ¡£ÕâÑù¾Í¿ÉÒÔ¸÷¾¡ÆäÄÜ¡£
ºÇºÇ£¬Ö÷´Ó¿â¸÷˾ÆäÖ°£¬Ö÷¿â£º×î¿ìµÄËÙ¶È×öÌí¼Óɾ³ýÐ޸IJÙ×÷£¬´Ó¿â£¬×î¿ìµÄËÙ¶È×ö²éѯ²Ù×÷
ÎÊÌ⣺Ö÷´Ó·þÎñÆ÷×Ö¶ÎÀàÐ͵ÄÑ¡Ôñ
×Ö¶ÎÀàÐͶÔÓÚ·ÖÒ³µÈ²Ù×÷ÓкܴóÓ°Ïì¡£Ö÷·þÎñÆ÷Ò»°ãÊÇinnodb£¬ÒòΪ²»Éæ¼°²éѯ£¬ËùÒÔ¿ÉÒÔʹÓÃvarcharµÈÀ´´æ´¢×Ö·û´®À´½ÚÊ¡¿Õ¼ä£¬´Ó·þÎñÆ÷Ò»°ãÊÇ myisam£¬ÒòΪÉæ¼°²éѯ£¬ËùÒÔ±ØÐëÔÚcharºÍvarcharÖ®¼ä×ÐϸȨºâ£¬Ã»ÓÐvarchar, text, blob×ֶεıíÊǾ²Ì¬±í£¬·´Ö®ÊǶ¯Ì¬±í£¬¾²Ì¬±íµÄ¼ìË÷ЧÂÊÒª±È¶¯Ì¬±íºÃÈô¸É±¶£¬Ò»°ãÀ´Ëµ£¬ËùÓÐÉæ¼°´ó½á¹û¼¯µÄ²éѯ¶¼Ó¦¸Ã¾¡¿ÉÄܱ£Ö¤ÔÚ¾²Ì¬±íÉÏÍê³É£¬ÕâÀï ˵һ¸öÀý×Ó£º±ÈÈç˵³£¼ûµÄarticles±íÓÐtitle(varchar), body(text)µÈ×ֶΣ¬ÔÚ×öÎÄÕÂÁбíµÄʱºò£¬ÒòΪ²»ÊǾ²Ì¬±í£¬ËùÒÔ²éѯ²»»áºÜ¿ì£¬ÏÂÃ濪ʼÖع¹½â¾ö·½°¸£º°ÑÔ­À´µÄarticles±í²ð·Ö³É subjects±íºÍcontents±í£¬title×Ö¶ÎÉèÖÃΪһ¸ö×ã¹»µÄcharÀàÐÍ·ÅÔÚsubjects±íÀbody×ֶλ¹±£³ÖÊÇtextÀàÐͷŵ½ contents±íÀsubjectsºÍcontents±íÖ®¼äµÄ¹ØϵÊÇÒ»¶Ô¶à£¬ÕâÑù£¬Ë³´ø×ÅÒ²·½±ãµÄʵÏÖÁ˶àÒ³ÎÄÕµĹ¦ÄÜ£¬¶øÇÒ¸üÖØÒªµÄÊÇÔÚ²éѯÎÄÕ ÁбíµÄʱºò£¬²Ù×÷¶¼ÊÇÔÚsubjects¾²Ì¬±íÀïÍê³É£¬Ð§Âʿ϶¨»á±ÈÇ°Ò»ÖÖ·½°¸ÌáÉýºÜ¶à¡£
Ç¿µ÷£ºMyISAMÀᄇ̬±íºÍ¶¯Ì¬±íµÄÇø±ð¶ÔÐÔÄÜÓ°Ï켫´ó£¬µ«ÎÒ¸Ò˵ºÜ´óÒ»²¿·ÖʹÓÃÕß²¢Ã»ÓÐ×¢Òâ¹ýÕâÒ»µã£¡Èç¹ûÄã¾ÍÊÇÆäÖÐÖ®Ò»£¬ÄÇôÎÒÇ¿ÁÒ½¨ÒéÄãÔÙ´ÎÌå»á Ò»ÏÂÇ°Ãæ˵µÄarticles·Ö½âΪsubjects/contentsµÄ¹ý³Ì£¬ÏàÐÅÄãÊìϤÁËÒÔºó£¬ÏÂÒ»¸öÓ¦ÓõÄËٶȻáÓÐÖʵÄÌáÉý¡£
°¦£¬ÎÒ¾ÍÊÇÄDz»ÖªµÀµÄµ±ÖÐÒ»ÈË£¬ÊܽÌÁË
ÎÊÌ⣺Ö÷´Ó·þÎñÆ÷NOW()º¯ÊýÔì³ÉÊý¾Ý²»Ò»ÖÂ
¼ÙÉèÔÚÖ÷·þÎñÆ÷ÉÏÖ´ÐÐÒ»ÌõINSERT …. VALUES ( …, NOW())£¬ÄÇôÔÚ´Ó·þÎñÆ÷ÉÏÒ²»áͬÑùÖ´ÐÐÒ»ÌõµÄSQLÓï¾ä£¬µ«ÊÇÖ÷´Ó·þÎñÆ÷¸÷×ÔµÄʱ¼äÉèÖÿÉÄܲ»Ò»Ö£¨±ÈÈç˵ʱÇø²»Í¬£©£¬NOW()ÔÚÁ½Ì¨·þÎñÆ÷É쵀 ½á¹û¾Í¿ÉÄܲ»Ò»Ö¡£ÔÚMySQL5.1À½«Ö§³ÖÐи´ÖÆ£¬ÄÇʱºò¾Í²»´æÔÚÕâ¸öÎÊÌâÁË¡£²»¹ý²»¹ÜÔõô˵£¬¶¼²»Ó¦¸ÃÔÚ³ÌÐòÀïʹÓÃNOW()£¬Ê±¼äµÄ¼ÆËãÔÚÓ¦Óà ³ÌÐòÀïÍê³É¡£ÕâÀï½éÉÜÒ»¸ö¶îÍâµÄС¼¼ÇÉ£º»ñµÃʱ¼ä´Á£¬ºÍtime()Ïà±È£¬$_SERVER[‘REQUEST_TIME’] ÉÙ×öÁËÒ»´Îϵͳµ÷Ó㬲»¹ýÊÇ·ñºÏÊÊÒªÊӿ͹ÛÇé¿ö¶ø¶¨¡£
Õâµã²»¸Ò¹¶Í¬£¬binlogÉÏÓÐʱ¼ä´ÁÐÅÏ¢£¬ËùÒÔÓ¦¸Ã¿ÉÒÔ


Ïà¹ØÎĵµ£º

mysql text ³¤¶È


mysql text ³¤¶È
ÎÄÕ·ÖÀà:Êý¾Ý¿â
½ñÌìÔÚ×öDBÉè¼ÆµÄʱºòÔÚÏëÓÃTEXT ÊÇ·ñÄܹ»Âú×㽫À´µÄÊý¾Ý£¬Äܹ»³öÏÖ×°²»ÏµÄÇé¿ö¡£
ºóÀ´²éѯÁËһϹٷ½ÊÖ²áµÃµ½ÁËÒ»¸ö´ð°¸¡£
Ò»¸öBLOB»òTEXTÁУ¬×î´ó³¤¶ÈΪ65535(2^16-1)¸ö×Ö·û¡£
MEDIUMBLOB 
MEDIUMTEXT 
Ò»¸öBLOB»òTEXTÁУ¬×î´ó³¤¶ÈΪ16777215(2^24-1)¸ö×Ö·û¡£
LONG ......

Mysql data to long´íÎóµÄ´¦Àí·½·¨

½ñÌìÔÚдʵϰÉúµÄÅàѵPPTʱ£¬ÓÃmysqlµÄcommand line client²åÈëÒ»Ìõ´øÖÐÎĵļǼʱ£¬±¨data to longµÄ´íÎó£¬
ÔÚÍøÉϲ鿴ÁËÏà¹Ø×ÊÁÏ£¬ËµµÄÊÇÒòΪÕâ¸öconsoleʹÓÃÁËÒ»ÖÖ±àÂ뷽ʽ£¬°ÑÃüÁî±àÂëºóÔÙ·¢Ë͵½Êý¾Ý¿â£¬¾ßÌåÇë²Î¿´http://www.cnblogs.com/ovliverlin/archive/2007/11/26/972549.html£¬ËµµÄ±È½ÏÏêϸ£¬±¾ÈË¿´Íêºó£¬Ö±½Ó ......

mysql ÐÞ¸ÄÃÜÂë

use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
Ê×ÏÈÒªÉùÃ÷Ò»µã£¬´ó²¿·ÖÇé¿öÏ£¬ÐÞ¸ÄMySQLÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ģ¬
ËùÒÔÒ»°ãÓû§ÎÞ·¨¸ü¸ÄÃÜÂ룬³ý·ÇÇëÇó¹ÜÀíÔ±¡£
·½·¨Ò»
ʹÓÃphpmyadmin£¬ÕâÊÇ×î¼òµ¥µÄÁË£¬ÐÞ¸Ämysql¿âµ ......

ת£ºLinuxϽøÐÐMYSQLµÄC++±à³ÌÆð²½ÊÖ¼Ç


LinuxϽøÐÐMYSQLµÄC++±à³ÌÆð²½ÊÖ¼Ç
Ê×ÏÈ°²×°±ØÐèµÄ¿ª·¢°ü
sudo apt-get install gcc g++ libgcc1 libg++ make gdb
°²×°MYSQLµÄCÓïÑÔ¿ª·¢°ü
sudo apt-get install libmysql++-dev libmysql++2c2a libmysqlclient15-dev libmysqlclient15off
......

ÔÙ̸mysqlµÄÅäÖÃÎļþmy.ini or my.cnf (Ö®¶þ)

ÈçÈôתÔØ£¬Çë×ðÖظöÈËÀͶ¯£¬Îñ±Ø×¢Ã÷ԭʼ³ö´¦£º(http://blog.csdn.net/iihero/archive/2010/05/13/5585039.aspx)
±¾ÎÄΪiihero@CSDNÔ­´´¡£
ÔÚǰһƪ¶ÌÎÄÀïÌáµ½ÁËmy.ini/cnfµÄ¼ÓÔØ˳Ðò£ºC:\WINDOWS\my.cnf->C:\WINDOWS\my.ini->C:\my.cnf ->C:\my.ini ->$installdir\my.ini¡£(%MYSQL_HOME%\my.ini)-> ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ