2020-01-01ãã1å¹´éã®è¨äºä¸è¦§
ã¯ããã« ããªãã ã®Advent Calendarç¨ã®è¨äºã§é©å¿ããã·ã¥ã¤ã³ããã¯ã¹ï¼AHIï¼ã«ã¤ãã¦å°ãæ¸ãããã ãã©ãä»æ¥ã¯ããããããã£ã¦ã©ããã£ã¦ä½¿ã£ããè¦ããããã®ï¼ã£ã¦è©±ã§ãã é©å¿ããã·ã¥ã¤ã³ããã¯ã¹ã¨ã¯ï¼ï¼ããããï¼ InnoDBã®ã¤ã³ããã¯ã¹ã¯ã¯ã©â¦
ã¯ããã« æè¿ãMyISAMã®ãã¨èª¿ã¹ãæ©ä¼ãå¤ãã£ãã®ã§ãä»ã¾ã§ã®äººçã§MyISAMãã¼ãã«ã触ããã¨ãªãã¦ã»ã¼0ã ã£ãããMySQLçã«ã¯ä»æ´ãªæãããããã©ã¨ããããæ¸ãåºãã¦ã¿ãã (æ®´ãæ¸ãã«è¿ãããã¨ã§èª¿ã¹ãã¨ãã«ã¨ã£ãããã«ãªãã°ã¨æã£ã¦ã) ãªã®â¦
æ¬ã¨ã³ããªã¯MySQL Advent Calendar 2020 ã®13æ¥ç®ã§ãã ä»æ¥ã¯ã¡ãã£ã¨ã ãMySQL8.0ã«ã¢ããã°ã¬ã¼ããã¨ãã¨è¯ãããã¨ãããã¿ã§ãã TRUNCATEãããDROPã¨CREATEã®ã»ããæ§è½ãè¯ããï¼ ã¯ããMySQL5.7以åã¾ã§ã¯DROPã¨&CREATE ã®ã»ããTRUNCATE TABLEâ¦
ã¯ããã« ä»åã¯ãã£ã¨è§¦ãããã£ãMySQL Shellã®ãã³ããããã¤ã¤ã æå¾ã¯ååä½ã£ãMDSç¸æã«ã¤ã³ãã¼ããã¦ã¿ãããã¨æãã¾ãã MDSã«ã¤ã³ãã¼ãããããã«ã¯ociã¯ã©ã¤ã¢ã³ãã®è¨å®ãããªãã¸ã§ã¯ãã¹ãã¬ã¼ã¸ãå¿ è¦ãªã®ã§ãããããéä¸ã§è¨å®ãã¦ããâ¦
ã¯ããã« MDSï¼MySQL Database Serviceï¼ãæ±äº¬ãªã¼ã¸ã§ã³ã«ãæ¥ã¾ããï¼ (^O^) <ç¥ï¼ ã¨ããããã§ãæ4æã«èµ·ãããããã¨ããããæéãã§ãããã§ä¹ ã ã«OCIã触ã£ã¦ã¿ããã§ãããä½ããããã®ãç°¡åã«ä½ãã¦æ¥½ããã£ãã§ãã ãã ãå ¬å¼ãã¥ã¼ããªã¢ã«â¦
Myãªãã 8.0.21ã«åå å æ¥ãMySQL Release note ã§ããããè¨ãåå¼·ä¼ 8.0.21ãã«åå ãã¦ã¾ããã¾ããã ä»åãææ°ã®MySQL8.0.21ã®ãªãªã¼ã¹ãã¼ããã¿ããªã§è¦ãªãããæãã¤ãã¾ã¾ã«èªãä¼ã§ããã®ä¸ã§åã¯ç¸å¤ãããROMå°ã§ããåå ãã¦ããã¾ããã â¦
ãï¼ä½å½ããåã®ãã¨è¨ã£ã¦ãã®ï¼ ããæãããè²´æ¹ãã¯ã¨ãªãã£ãã·ã¥ãã¡ããã¨ä½¿ãã使ããªããæåã«èãã¦ããåã人ã§ããã query_cache_typeãONï¼1ï¼ã«ããã¨ã¯ã¨ãªã¼ãã£ãã·ã¥ãæå¹ã«ãªããã§ããããããããã¥ã¡ã³ããèªãã¨å°ãªãã¨ãMySQL5â¦
ã¯ããã« ã¿ã¤ãã«éããMySQL5.xç³»ã ã¨ãããããã¯ã«ãªããã ãã©ã MySQL8.0ã ã¨ããã¯æ©æ§ãå¤ãã£ã¦ãããããã¯ã«ãªããªãã ã¨ããçµã¿åããã®ã話ã åã¯ãã®è©±ãã©ã£ãã§è¦ãè¨æ¶ãç¡ãã£ãï¼å¿ããï¼ï¼ã®ã§ æãã¦ããã£ãã¨ãçµæ§é©ãããã ãã©â¦
ãã¼ãã£ã·ã§ãã³ã°ãããã¼ãã«ã®ç¢ºèªæ¹æ³ MySQL触ã£ã¦ã¦ãå®ã¯ä»äºä¸ã§ã¯ä¸åº¦ã触ã£ããã¨ããªãã£ããã¼ãã£ã·ã§ãã³ã°ã ï¼ã ã£ã¦ãè²ããªäººã使ããªãã£ã¦è¨ã£ã¦ããã ããï¼ ã ãã©ãæå¤ã¨ä¸ã®ä¸ä½¿ã£ã¦ã人ã¯å¤ãã®ã§ä»å¾ã®ããã«ããã¼ãã£ã·ã§ãã³â¦
å ¨ãMySQLã«é¢ä¿ãªããã§ãããã£ããã¯å®¶ã§ä»äºããã®ã«ä¸é½åã ã£ãããèµ·ãã£ã身ã®ä¸ã®è©± å ãè¶ è¶ããï¼ ãªãã³ã¯æ©ãã§ããã 家ã¯æ±äº¬ã®ã¨ããéåä½å® ã150以ä¸ã®ä¸å¸¯ãä½ããã³ã·ã§ã³ã ãã®å®¶ã®å åç·ãé ãã®ã§ããã åç·é度ã測ãã¨ã1Gbpsãâ¦
ã¯ããã« MySQL8.0.20ã§è¿½å ã»å¤æ´ããããã©ã¡ã¼ã¿ããªãã¨ãªãçºãã¦ã¿ã¾ããã ãã©ã¡ã¼ã¿ã®èª¬æã«ã¤ãã¦ã¯åºæ¬çã«ã¯ããã¥ã¡ã³ãããã®å¼ç¨ã§ãã å¤æ´ããããã©ã¡ã¼ã¿ä¸è¦§ ä¾ã«ãã£ã¦ã¨ã¿ãããã®ãã©ã¡ã¼ã¿æ¯è¼ãã¼ã«ããåããã¾ããã Parameter 8â¦
MySQLã§ã®ãã¼ãã«ã³ãã¼ãèãã MySQLã§ãã¼ãã«ã³ãã¼ï¼åä¸ã¤ã³ã¹ã¿ã³ã¹å ã¨ãå¥ã¤ã³ã¹ã¿ã³ã¹ã¨ããããã©ï¼ã£ã¦æå¤ã¨ãã¹ãã¨ãã¡ãã£ã¨ãããªã«ããªä½æ¥ç¨ã«ããããªãã¾ãããã ã¨ããããã§ãInnoDBã¨MyISAMé¢é£ã ãã§ããæ¸ãåºãã¦ã¿ã¾ããã ã³â¦
â»è¿½è¨ãã¾ãããå¾è¿°ã®ããã¥ã¡ã³ãã®è©±ã¯ä¿®æ£ããã¾ããï¼(^â½^) è¨å¨ï¼ã¤ã³ã¹ãã¥ã«ã¡ã³ãï¼ã¨ã¯ è¨å¨ï¼ã¤ã³ã¹ãã¥ã«ã¡ã³ãï¼ã¨å¼ã°ããã³ã¼ããéãã¦MySQLï¼NDB Clusterãå«ãï¼ã¯ããã©ã¼ãã³ã¹ã«é¢ãããã¼ã¿ãåå¾ãã¦ãã¾ãã åå¾ããããã¼ã¿ã¯ããâ¦
AUTO_INCREMENTãå·»ãæ»ã ä»ã®ä¼ç¤¾ã«å ¥ãã¾ã§ç¥ããªãã£ããã§ãããçµæ§æåãªãã°ã£ã½ãã§ããã AUTO_INCREMENTã§æ¡çªãããçªå·ããåèµ·åããã¨MySQL5.7以åã¯å·»ãæ»ãç¾è±¡ãèµ·ãã話ã§ãã åç¾ãã¦ã¿ã MySQL5.7ã¨8.0ã«ããããåããã¼ãã«ãä½ã£ã¦â¦
MySQL8ã§CHARé¢æ°ãããã¥ã¡ã³ãã©ããã«ãªã£ã¦ãªã https://dev.mysql.com/doc/refman/5.6/ja/string-functions.html#function_char ãèªãã¨ãããæ¸ãã¦ããã CHAR(N,... [USING charset_name]) CHAR() ã¯å N å¼æ°ãæ´æ°ã¨ãã¦è§£éãããããã®æ´æ°ã®ã³â¦
ååWindowsã ã£ãã®ã§ãä»åã¯Ubuntuã§å¼ãç¶ãåå¿è åãã«ã©ã¤ããªæãã§å°å ¥é¨åãæ¸ãã¦ã¿ã¾ããã 1. MySQL APT Repositoryã®åå¾ ãããããã¦ã³ãã¼ã(ã¤ã³ã¹ãã¼ã«æ¸ã®äººã¯ã¹ããã) 2020/1/25ç¾å¨ã®ææ°çã¯mysql-apt-config_0.8.14-1_all.deb 2. â¦
MySQL Shell ãWindowsã«å ¥ãã¦ã¿ã å æ¥åå ãã¦ããMySQL Technology Cafe #7ã§MySQL Shellã£ã¦ä½ï¼ã©ããªãã¨ã§ããã®ï¼ ã¨ãã£ãåå¿è åãã®è©±ããããã¨ããã®ã§èãã¦æ¥ã¾ããã ä»åã¯ããããå¦ãã ãã¨ãããã³ããã£ã¦ãã¾ã£ãWindowsã§ã®è¨å®ã«â¦
MySQLã®ãã¹ãã³ã°ãPerconaã§ä½¿ã£ã¦ã¿ã MySQLã®ãã¹ãã³ã°ã¯EnterpriseEditionã§ãã使ããªãããPerconaServerã¯ãããç¡åã§ä½¿ããããã«ï¼ ãããããããºãããªï¼ ã§ã使ããã®ã¯8.0.17-18ãã¼ã¸ã§ã³ãããªã®ã§ããããã5.7â¦ã ã¨ããããããã®è¨äº â¦
ä»åã¯æè¡çãªãã¨ã¯ãã¡ãããMySQLã®Mã®åãåºãªãçªå¤ç·¨ã§ã åæµ·éï¼å½é¤¨è¿è¾ºï¼ã®ãããããã¤ã³ããèªã£ã¦ã¿ã å«ã®å®å®¶ãããã®ã§å¹´æ«å¹´å§ã§è¡ã£ã¦ãã ä»ã¾ã§ã«ãä½åº¦ãè¡ã£ã¦ããã§ãå½é¤¨è¿è¾ºã§è¯ãã£ãã¨ãã¨ãéã«ç´¹ä»ãã¦ã¿ã é å½é¤¨ã®è¡ä¸¦ã¿ â¦