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

(mysql)ÁÙʱ±íµÄʹÓÃ

ʹÓÃÁÙʱ±íµÄºÃ´¦£º
ʹÓÃÁÙʱ±í´æ·ÅÖмä½á¹û,¼ÓËÙ²éѯ£¬»ò´æ·ÅÁÙʱ½á¹û.
 
(1)
´´½¨ÁÙʱ±íºÜÈÝÒ×£¬¸øÕý³£µÄCREATE TABLEÓï¾ä¼ÓÉÏTEMPORARY¹Ø¼ü×Ö£º
CREATE TEMPORARY TABLE tmp_table (
name VARCHAR(10) NOT NULL,
value INTEGER NOT NULL
)
 
(2)
ÁÙʱ±í½«ÔÚÄãÁ¬½ÓMySQLÆÚ¼ä´æÔÚ¡£µ±Äã¶Ï¿ªÊ±£¬MySQL½«×Ô¶¯É¾³ý±í²¢ÊÍ·ÅËùÓõĿռ䡣µ±È»Äã¿ÉÒÔÔÚÈÔÈ»Á¬½ÓµÄʱ
ºòɾ³ý±í²¢Êͷſռ䡣
DROP TABLE tmp_table -- ²»ÓüÓtemporary
(2.2)
ÁÙʱ±íµÄ³£Ó÷½·¨:
create temporary table temp_user select * from user;
 
(3)
Èç¹ûÔÚÄã´´½¨ÃûΪtmp_tableÁÙʱ±íʱÃûΪtmp_tableµÄ±íÔÚÊý¾Ý¿âÖÐÒѾ­´æÔÚ£¬ÁÙʱ±í½«ÓбØÒªÆÁ±Î£¨Òþ²Ø£©·ÇÁÙʱ
±ítmp_table¡£
 
(4)
ʹÓÃÁÙʱ±í¼ÓËÙ²éѯ
¡¡¡¡°Ñ±íµÄÒ»¸ö×Ó¼¯½øÐÐÅÅÐò²¢´´½¨ÁÙʱ±í£¬ÓÐʱÄܼÓËÙ²éѯ¡£ËüÓÐÖúÓÚ±ÜÃâ¶àÖØÅÅÐò²Ù×÷£¬¶øÇÒÔÚÆäËû·½Ã滹Äܼò
»¯ÓÅ»¯Æ÷µÄ¹¤×÷¡£ÀýÈç:
¡¡¡¡SELECT cust.name£¬rcvbles.balance£¬……other columns
¡¡¡¡from cust£¬rcvbles
¡¡¡¡WHERE cust.customer_id = rcvlbes.customer_id
¡¡¡¡AND rcvblls.balance>0
¡¡¡¡AND cust.postcode>“98000”
¡¡¡¡ORDER BY cust.name
¡¡¡¡Èç¹ûÕâ¸ö²éѯҪ±»Ö´Ðжà´Î¶ø²»Ö¹Ò»´Î£¬¿ÉÒÔ°ÑËùÓÐδ¸¶¿îµÄ¿Í»§ÕÒ³öÀ´·ÅÔÚÒ»¸öÁÙʱÎļþÖУ¬²¢°´¿Í»§µÄÃû×Ö
½øÐÐÅÅÐò:
¡¡¡¡SELECT cust.name£¬rcvbles.balance£¬……other columns
¡¡¡¡from cust£¬rcvbles
¡¡¡¡WHERE cust.customer_id = rcvlbes.customer_id
¡¡¡¡AND rcvblls.balance>0
¡¡¡¡ORDER BY cust.name
¡¡¡¡INTO TEMP cust_with_balance
¡¡¡¡È»ºóÒÔÏÂÃæµÄ·½Ê½ÔÚÁÙʱ±íÖвéѯ:
¡¡¡¡SELECT * from cust_with_balance
¡¡¡¡WHERE postcode>“98000”
¡¡¡¡ÁÙʱ±íÖеÄÐÐÒª±ÈÖ÷±íÖеÄÐÐÉÙ£¬¶øÇÒÎïÀí˳Ðò¾ÍÊÇËùÒªÇóµÄ˳Ðò£¬¼õÉÙÁË´ÅÅÌI/O£¬ËùÒÔ²éѯ¹¤×÷Á¿¿ÉÒԵõ½´ó
·ù¼õÉÙ¡£


Ïà¹ØÎĵµ£º

MySQL ±àÂë»úÖÆ

Ò»°ãÔÚMYSQLʹÓÃÖÐÎIJéѯ
¶¼ÊÇÓà set NAMES character
character_set_client £¬ÕâÊÇÓû§¸æËßMySQL²éѯÊÇÓõÄʲô×Ö·û¼¯¡£
character_set_connection £¬MySQL½ÓÊܵ½Óû§²éѯºó£¬°´ÕÕcharacter_set_client½«Æäת»¯Îªcharacter_set_connectionÉ趨µÄ×Ö·û¼¯¡£
character_set_results £¬ MySQL½«´æ´¢µÄÊý¾Ýת»»³Écharact ......

mysql³£ÓÃÃüÁî

 grant all on *.* to root@'192.168.10.131' identified by 'admin';
 
LOAD DATA INFILE (´ÓÎļþÖе¼ÈëÊý¾Ý)
mysqldump -u pivot -p pivot news > c:\news.sql
 ÄÇô»¹Ô­¿ÉÒÔmysqlÃüÁmysql -u Óû§Ãû -p (ÃÜÂë) -h Ö÷»úÃû --one-database »¹Ô­Êý¾Ý¿âÃû < ·¾¶/±¸·ÝÃû.bak,--one-databaseÊÇÖ¸ ......

mysql ±íÀàÐÍmyISAM £¬Innodb

¾ÍÎÒÖªµÀµÄÁ½¸öÇø±ð£º
myISAM  ²»Ö§³ÖÊÂÎñ
Innodb   Ö§³ÖÊÂÎñ
Èç¹ûÐÞ¸ÄmyISAM ΪInnodb£¬ÐèÒª°ÑÔ­À´µÄÊý¾ÝÏÈdump³öÀ´£¬Çå¿Õ±í£¬ÔÚÖØвåÈë
innodbÔÚ/etc/my.cfgµÄÅäÖÃΪ
innodb_data_home_dir = /var/lib/mysql/
innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend
innodb_log_group_hom ......

MySQL .frm .myd .myi Îļþ ¼°Êý¾Ý¿â±¾µØÒÆÖ²

     ½ñÌìÔÚʵ¼Ê¿ª·¢ÖжÔÓÚMySQLÊý¾Ý¿â½øÐÐÒÆÖ²·¢ÉúµÄÎÊÌâÀ´ËµÏÂ. ¿ªÊ¼°Ñ±¾µØdataÖеÄÊý¾Ý¿âÎļþ¿½±´µ½Áíһ̨»ú×ÓÉÏTest, Ö´ÐÐshow tables ; ¿ÉÒÔ¿´µ½Êý¾Ý¿â±í,µ«ÊǶԱí½øÐÐÈκβÙ×÷¶¼±¨´í: ±í²»´æÔÚ , Ô­ÒÔΪMysqlµÄÊý¾Ý¿âÎļþ(.frm)Copy->stickµ½±¾µØ°²×°MySQLDBĿ¼µÄdataÎļþ¼ÐϾͿÉÒÔ.ÊÂʵ²»Ê ......

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/
ÔËÐÐÈçϵĴúÂë¾Í¿ÉÒÔ½â¾öÉÏÊöÎÊÌâ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ