2021/12/17 Engineers in CARTA vol.2 #MySQL https://voyagegroup.connpass.com/event/231708/ å¾æãªãã¨ã¨ããããç¹ç°ãªãã¨ãç´¹ä»ããã³ã¼ãã¼ã«ãªã£ã¦ãã¾ã£ã
åé¡ MySQLã§ããã³ãããªã¹ãã¢ãã¦ãããããããªã¨ã©ã¼ã«åºä¼ãã¾ããã Unknown command '\''. çã ã¯ã©ã¤ã¢ã³ãå´ï¼mysqlã³ãã³ãï¼ã®æåã³ã¼ãã®è¨å®ãããã ã³ãã³ãã©ã¤ã³ãªãã·ã§ã³ã§ä»¥ä¸ã®ããã«æå®ããã ãã¾ãããã¨ã $ mysql -u user --default-character-set=utf8 database_name < dump.sql ãã¾ããããªãã¨ã $ mysql -u user database_name < dump.sql ERROR at line 123: Unknown command '\''. $ mysql -u user --default-character-set=sjis database_name < dump.sql ERROR at line 123: Unknown command '\''
ããï¼ã¡ã¢ãªãã£ã¡ã使ã£ã¦ãã¨ããæã®å¯¾å¦ã¡ã¢ã§ã ãã£ããã¯ZABBIXç£è¦ ZABBIXã§æ¤è¨¼ç¨ã®ãµã¼ããç£è¦ãã¦ããã¨ããããªããRAMã®ä½¿ç¨çãé«ãã£ããã§ããã ãã®æMySQLã®ãã¥ã¼ãã³ã°ãRAMã®ç·éã¨æ¯è¼ããã¨ãããªãã«ããã©ã¼ãã³ã¹éè¦ï¼ã¿ãããªè¨å®ã«ãã¦ããã®ã§ãããã¼ãããããããã¨æã£ã¦å¤ã調æ´ããã®ã§ããã ããããå¤ãå調æ´ãã¦ãã¡ã¢ãªä½¿ç¨éããã¾ãå¤ãããâ¦â¦ã freeã³ãã³ãã§ç¢ºèªãã¦ããã©ãèãã¦ãè¨å®ããããã£ã¨å¤ãéã®ã¡ã¢ãªãæ¶è²»ãã¦ããããã§ããã åå ã¯ä¸ä½ï¼ å½ã¦ã¯ã¾ããã®ãä½ãç¡ããæ¢ãã¦ã¿ã¾ããã æ¢ãã¦çµæã以ä¸ã®ï¼ç¹ãæªãããã¨ãããã¨ãåããã¾ããããªãããããã§ã table_definition_cache ãã¼ãã«ãéãããã«ãã£ãã·ã¥ã使ã£ã¦é«éåããã ãã®ãã£ãã·ã¥ã®ãã¼ãã«å®ç¾©ã®æ ¼ç´æ°ï¼ãããã§ããæå°å¤ã400ã§æ大
TL;DR ãã®è¨äºã«æ¸ããäº äºåæ¢ç´¢æ¨ã®ã話(åæç¥è) MySQLã®InnoDBã§å©ç¨ããã¦ããB+æ¨ã¤ã³ããã¯ã¹ã®æ§é ã¨ç¹æ§ (åæç¥è) MySQLã®ClusteredIndex,SecondaryIndexã«ã¤ãã¦(åæç¥è) ã«ã¼ãã£ããªãã£ã«ã¤ãã¦(åæç¥è) å®éã®è² è·å¯¾ç æ¤åºç·¨ ã¹ãã¼ã¯ã¨ãª æ¤åºç·¨ ãã®ä»ã®ã¯ã¨ãªå²ãåºããããã ã¯ã¨ãªã»ã¤ã³ããã¯ã¹ã®æé©å explainã®ä½¿ãæ¹ã¨è©³ç´° ã±ã¼ã¹å¥å®è·µ åç´ã«ã¤ã³ããã¯ã¹ãããã£ã¦ããªãã±ã¼ã¹ ã«ã¼ãã£ããªãã£ãä½ãã¤ã³ããã¯ã¹ã使ããã¦ããã±ã¼ã¹ é¨åçã«ããã¤ã³ããã¯ã¹/è¤åã¤ã³ããã¯ã¹ãããã£ã¦ããªãã±ã¼ã¹ è¤åã¤ã³ããã¯ã¹ã®é åºèª¤ãã§ã¤ã³ããã¯ã¹ãé©ç¨ã§ãã¦ããªãã±ã¼ã¹ è¤åã¤ã³ããã¯ã¹ã®æåãrangeæ¤ç´¢ã®ã±ã¼ã¹ ã½ã¼ãã«ã¤ã³ããã¯ã¹ãé©ç¨ã§ãã¦ããªãã±ã¼ã¹ ã½ã¼ãã«ã¤ã³ããã¯ã¹ãé©ç¨ã§ãã¦ããªãã±ã¼ã¹ï¼
ï¼ï¼ï¼ãMySQL Workbenchã¨ã¯ MySQL Workbenchã¨ã¯ãMySQLã®å ¬å¼ãµã¤ãã«ã¦MySQL Serverã¨å ±ã«é å¸ããã¦ããããã¼ã¿ãã¼ã¹ã®è¨è¨ã»éçºã»ç®¡çãä¸æ¬ã§å®ç¾ãã¦ããç¡æãã¼ã«ã§ããã³ãã³ãã©ã¤ã³ã§ã¯ãªããã¸ã¥ã¢ã«æä½ï¼GUIï¼ã«å¯¾å¿ãã¦ãããã³ãã³ãæä½ãè¦æãªæ¹ã«ãããããã§ãã ï¼ï¼ï¼ãMySQL Workbenchã®æ©è½ ãã¼ã¿ãã¼ã¹è¨è¨ã®é¢ã§ã¯ãæ°è¦ã«ERå³ãä½æã§ããã»ããæ¢åã®ãã¼ã¿ãã¼ã¹ããERå³ãéã«çæãããã¨ãå¯è½ã¨ãªã£ã¦ãã¾ãã ãã¼ã¿ãã¼ã¹éçºã®é¢ã§ã¯ãSQLã®ã¯ã¨ãªä½æãå®è¡ã ãã§ãªããæé©åãç´æçãªæä½ã§è¡ãããã¸ã¥ã¢ã«è¡¨ç¤ºã«å¯¾å¿ãã¦ãã¾ããããã«SQLã¨ãã£ã¿ã«ã¯ã«ã©ã¼ãã¤ã©ã¤ã表示ãèªåè£å®æ©è½ã®ã»ããSQLã®å®è¡å±¥æ´è¡¨ç¤ºãSQLã¹ãã¼ãã¡ã³ãã®åå©ç¨ããªãã¸ã§ã¯ããã©ã¦ã¶ã«ã対å¿ãã¦ãããSQLã¨ãã£ã¿ã¨ãã¦ãã¨ã¦ã
14. MySQLã®â¾¯åãâ¾ã #ã¨ã¯ DBã«ç¹åããï¼åºç¾©ã®ï¼ã¤ã³ãã©ãã¶ã¤ã³ ããã¯ã¢ããã®é »åº¦, ä¿ç®¡å , ..etc. + ãã®å®è£ - ç£è¦, ãªã½ã¼ã¹ã¢ãã¿ãªã³ã°, ..etc. + ãã®å®è£ - mikasafabric for MySQL + MySQL Router- ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ã¢ããã®æ¤è¨¼ã¨ããPercona Serverã¨ã MariaDBã¨ã - DBã«ç¹åããã·ã§ããä½æ¥ åããã® ALTER TABLE 以å¤ã使ã£ããã¼ãã«å®ç¾©ã®æ´æ° < 5.6 ã ã£ããããã¼ãã«ã⼤ãããã¦ã¬ããªã±ã¼ã·ã§ã³ãè©°ã¾ã£ããããã±ã¼ã¹ - ã¹ãã¼ã¯ã¨ãªã¼ãã¥ã¼ãã³ã°- ãã¤ãã¼ãã¼ã¸ã§ã³ã¢ãã- 13/63
ã¯ããã« é ããªãã¾ããã11/20(é)ã«éå¬ãããMySQL Casual Talks Vol.8ã§ä»¥ä¸ã¹ã©ã¤ãã§çºè¡¨ãã¾ããããã®å 容ã®è£è¶³ã¨ããè¼ãã¦ããã¾ãã MySQL5.7ã¨MariaDB10.1ã®æ§è½æ¯è¼(ç°¡æ) from hiroi10 æè¿MariaDB 10.1ãGAã«ãªããMySQL 5.7ãGAã«ãªããMariaDBã£ã¦ã©ããªãï¼ãã¨ãèãããäºãå¢ããããã¨ãããããã³ããã¼ã¯ã§æ§è½æ¯è¼ãã¦ã¿ããããçºç«¯ã§ãããMariaDBã®10ç³»ã¯MySQL 5.5ããã¼ã¹ã«ãã¦ããã¨ãããã¨ã§æ£ç´ãã¾ãæå¾ ãã¦ããªãã£ãã®ã§ãããèµ·åæã®ãã°ãè¦ãã¨InnoDBã¯Perconaã®XtraDB5.6ãã¼ã¹ã ã£ãã®ã§Percona5.6ã¨åãå¾åããªãã¨ããæ³åã§å®æ½ãã¾ãããæ¦ãåãå¾åã¨ãªãã¾ããã ã¾ããç§ã¯MariaDB10ç³»ã¯ã¾ã¨ãã«è§¦ã£ããã¨ããªãã£ãã®ã§å¤ã ãªã¨
MySQLã«éããªããã©ããGPLã¯å¶å©ç®çã§ã¯ä½¿ããªãçãªæãè¾¼ã¿ãã¯æ¢ãã¦æ¬²ããã å é±ãã·ã¹ãã éçºã®ææ¡ã§å®¢å ã«è¡ã£ã¦ããã å½æ¹ã30ååã®SEã対å¿ãã¦ãããæ å½è ã¯40代å¾åã®æ å ±ã·ã¹ãã é¨éã®æ¹ã ææ¡ããã·ã¹ãã ã®è¦æ¨¡ã¯ããã»ã©å¤§ããã¯ãªããã客ããããããã¾ãäºç®ã¯ãªãã¨è¨ããã¦ãããããRDBMSã«ãMySQLãã使ã£ãWebã·ã¹ãã ãææ¡ããã¨ããããããã»ã©å¯ç¨æ§ã¯æ±ãã¦ãªãããç¡æã§ä½¿ããDBã®æ¹ããããã¨è¨ãããã ãããåç¨ã©ã¤ã»ã³ã¹ãè³¼å ¥ããã¨åéããããã ãªãã¨æã£ãã®ã§ããMySQLã¯GPLã©ã¤ã»ã³ã¹ãããã®ã§ç¡æã§ä½¿ããã¨ãã§ãã¾ãããã¨èª¬æããã¨ãããæ å½è ã®é¡ãéºãããªã£ãã ãGPLã ã¨ã½ã¼ã¹ã³ã¼ããå ¬éããªãã¨ãããªããã ãï¼ãã¨ãMySQLã®ã½ã¼ã¹ã³ã¼ããæ¹å¤ãã¦ããªãã¦ããMySQLã使ã£ãã½ããã¦ã§ã¢ã§ããã°ã½ã¼ã¹ã³ã¼ããå ¬éããªãã¨ã
10. æåéåæåéå US-ASCII æ°åãè±åã32åã®è¨å· JIS X 0201 US-ASCII(ããâãÂ¥ã/ã~ãâãâ¾ã)+ã«ã¿ã« ã JIS X 0208 æ°åãã²ãããªãã«ã¿ã«ããæ¼¢åãã©ãã³æåã ã®ãªã·ã£æåãè¨å·çã JIS X 0213 JIS X 0208 + 第ä¸æ°´æº/第åæ°´æºããã¼ãæ°åã é¼»æ¿é³æåçã 11. æåéåæåéå Windows-31J JIS X 0201 + JIS X 0208 + NECç¹æ®æå + IBM æ¡å¼µæå(ãâ§ããâ §ããã±ããé«ããï¨ããå½ ã ç) Unicode ä¸çä¸ã®æåãçµµæå(ã�����������������ãã�������������������ãç)ãå«ãã
æè¿ãElastic BeanstalkãECSã¨æ¦ã£ã¦ããSREãã¼ã ã®è åã§ãã P5ãããããã®ã«PS3ãPS4ãæã£ã¦ããªãã®ã§æããããã¦ç¾¨ã¾ããã£ã¦ããæ¯æ¥ã§ãã ãã®è¨äºã§ã¯ãçªç¶ã®ã¢ã¯ã»ã¹å¢ã«åããããã«ãMySQLã®ã¹ã¬ã¼ããï¼ãï¼æéã§ã¹ã±ã¼ã«ã¢ã¦ãã§ããããã«ãã話ãæ¸ãã¾ãã MySQL on EC2 ã¯ãã¯ãããã¯å¨ç¥ã®éãAWSãå©ç¨ãã¦ãã¾ããã主è¦ãªãã¼ã¿ã¼ãã¼ã¹ã«ã¤ãã¦ã¯Amazon RDSã§ã¯ãªãMySQL on EC2ã使ã£ã¦ãã¾ãã ããã¯ä»¥ä¸ã®ãããªçç±ã«ãããã®ã§ãã æ´å²çãªçµç·¯: AWS移è¡å½æãRDSãç¡ãã£ããã¾ãã移è¡å¾ããã°ããã¯Tritonnã使ã£ã¦ãããããRDSã使ããã¨ãã§ããªãã£ã ãªã³ã©ã¤ã³ã¡ã³ããã³ã¹ã®å®ç¾: VPCã«ã¼ããã¼ãã«ã使ã£ãä»®æ³IPã¨MHA for MySQLã使ã£ã¦ãã¦ã³ã¿ã¤ã ã¼ãã®ãã¹ã¿DBã®åãæ¿ãã
æ»æã«å©ç¨ãããå ´åãroot権éã§ä»»æã®ã³ã¼ããå®è¡ããããµã¼ããå¶å¾¡ãããå¯è½æ§ãææããã¦ããã ç±³Oracleåä¸ã®ãªã¼ãã³ã½ã¼ã¹ãã¼ã¿ãã¼ã¹ãMySQLãã«æªè§£æ±ºã®èå¼±æ§ãè¦ã¤ãã£ãã¨ãã¦ãã»ãã¥ãªãã£ç 究è ã9æ12æ¥ã«æ¦ç¥ãã³ã³ã»ããå®è¨¼ã³ã¼ããå ¬éããããµã¤ãã¼æ»æã«å©ç¨ãããå ´åãroot権éã§ä»»æã®ã³ã¼ããå®è¡ããããµã¼ããå¶å¾¡ãããå¯è½æ§ãææããã¦ããã ç 究è ã®Dawid Golunskiæ°ãå ¬éããæ å ±ã«ããã°ãMySQLã®èå¼±æ§ã¯è¤æ°çºè¦ããããä¸ã§ãç¹ã«æ·±å»ãª1件ã«ã¤ãã¦ã¯ããªã¢ã¼ãã®æ»æè ãMySQLã®è¨å®ãã¡ã¤ã«ã«ä¸æ£ãªå 容ãä»è¾¼ãSQLã¤ã³ã¸ã§ã¯ã·ã§ã³æ»æã«å©ç¨ãããæããããã ãã®èå¼±æ§ã¯ãMySQLã®ææ°çãå«ã5.7ç³»ã5.6ç³»ã5.5ç³»ã®å ¨ãã¼ã¸ã§ã³ã«ãããã©ã«ãã®ç¶æ ã§åå¨ãããç¾æç¹ã§Oracle MySQLãµã¼ãã®èå¼±æ§ä¿®æ£ãããã¯åå¨
ã©ããä½éã§ãããã¬ã¿ã®ã¤ã³ãã©ã¯Engineyardã§ã¯ãªã¯ãªãã£ã¦ããã§ããããã®ããªãã¦ããã®Auroraï¼ããã使ãããã£ãããã§ãã ãã¦ãç§ãæ¸ããåã åã®è¨äºã«ã¦ããã³ã¢æ©è½ã®AWSåããä»å¾ã®TODOã¨ãã¦æãã¦ãã¾ãããã5/9ã«EngineyardããAWSã¸ã®ç§»è¨ãå®äºãã¦ãã¾ãããEngineyardã¯Railsãnodejsãªã©ã®WEB-DBç°å¢ãç°¡åã«æ§ç¯ã§ããPaaSã§ããHerokuã¨ã®éãã¯ãµã¼ãã«sshããããchefãå©ç¨ãã¦Fluentdãªã©ã®ããã«ã¦ã§ã¢ãå ¥ããããæ¢åã®ã³ã³ãã£ã°ã¬ã¼ã·ã§ã³ãã«ã¹ã¿ãã¤ãºããããããã¨ãã§ããç¹ãæãããã¾ããæ¯è¼çèªç±åº¦ã®é«ãPaaSã¨è¨ããã§ãããããã¬ã¿ã§ã¯åµæ¥ãå æã¾ã§ãä¸è©±ã«ãªãã¾ããã ä»åã¯ç§»è¨ã¨Auroraã®éç¨ã«é¢ããTipsã®ç´¹ä»ã«ãªãã¾ãããªããæ¬è¨äºã«ç¤ºãè¨è¨ã»éç¨æ¹éã¯AWSã®ã½ãªã¥ã¼ã·ã§
17. MySQLã®â½´ã¡ä½ç½® app, browser app, browser app, browser app, browser app, browser app, browser WEB, AP WEB, AP WEB, AP WEB, AP WEB, AP WEB, AP Database 16/136 18. ãã㪠app, browser app, browser app, browser app, browser app, browser app, browser WEB, AP WEB, AP WEB, AP WEB, AP WEB, AP WEB, AP Database 17/136 19. WEBãµã¼ãã¼ã¨ã®å¯¾â½ app, browser app, browser app, browser app, browser app, browser app, browser
第31åé¢è¥¿PHPåå¼·ä¼ã®çºè¡¨
100Mã«ã¹ã±ã¼ãªã³ã°ï¼Key-Valueã¹ãã¢ã¨ãã¦MySQLã使ããNoSQL以ä¸ã®ããã©ã¼ãã³ã¹ãåºã MySQLã¯NoSQLãããåªãã¦ãã¾ããKey-Valueã¹ãã¢ã¨ãã£ãNoSQLã®ã¦ã¼ã¹ã±ã¼ã¹ãèãã¦ã¿ãã¨ãããã©ã¼ãã³ã¹ã使ãããããå®å®æ§ã®ç¹ã§MySQLã®æ¹ãåççã§ããMySQLã«ã¯ããªãã¬ã¼ã·ã§ã³ãé害ã«é¢ãããã¨ããã¬ããªã±ã¼ã·ã§ã³ãç°ãªã使ç¨ãã¿ã¼ã³ã¾ã§ã¨ãå¤ãã®ãªã³ã©ã¤ã³ãããªã¢ã«ãç¨æãããããå å®ãªã¨ã³ã¸ã³ã§ãããããã£ãçç±ãããæ¯è¼ããã¾ã§ããªããMySQLã¯æè¿ã®NoSQLã¨ã³ã¸ã³ãããåªãã¦ããã¨è¨ãã¾ãã ããæè¿ã§ã¯ãNoSQLã¨ã³ã¸ã³ã主æµã«ãªã£ã¦ãã¦ãã¾ããå¤ãã®éçºè ããMongoDBãCassandraãRedisãHadoopã¨ãã£ãNoSQLã¨ã³ã¸ã³ãã¢ããªã±ã¼ã·ã§ã³æ§ç¯ã®ç¬¬ä¸åè£ã¨ãã¦ãããããããå ¨ã¦æããã®SQLã¨ã³ã¸ã³ãä¸å
AWSã使ãå§ãã¦ç´ä¸å¹´ãçµéããã®ã§ããã®ä¸å¹´ãæ¯ãè¿ã£ã¦ã¿ã¦ãæåããç¥ã£ã¦ãæ¹ãè¯ãã£ããªãã¨æã£ããã¤ã³ããããã¯ã¢ãããã¦ã¿ã¾ããã IAMãã¼ã«ã¯Nameå¤ããããªããä»ãæ¿ããã§ããªã件å¢ãã ãã§ä½ã£ãIAMãã¼ã«ãä»ä¸ãã¦ææ°æã ã¨éç¨éå§ï¼æ°ã¶æå¾ã«ä»ãæ¿ãã§ããªãäºã«æ°ä»ãã¦ãec2ctrlã¨ãããã«ãEC2ã¤ã³ã¹ã¿ã³ã¹ãã³ã³ããã¼ã«ããããã®ãã¼ã«ãªã®ã«ããªããS3ã®å ¨æ¨©éä»ä¸ãã¦ããããã¯ãååããäºæ¸¬ã§ããªãäºæ ã«ãªã£ã¦ãã¾ã£ãã¨ãã話ã ã¾ããå¥ã«ãªãªã´ãã§ã¯ç¡ããã§ããã©ããã¤ã³ã¹ã¿ã³ã¹ä½ãç´ãã°ä»ãæ¿ãã§ããããæ°ãããã¼ã«ä½ã£ã¦ã¤ã³ã¹ã¿ã³ã¹ä½ãç´ãã°ããã ãã®è©±ã§ããããããããªããã ããã¾ãããã©ï¼ VPCã§VPNæ¥ç¶ã¯ãªã¼ã¸ã§ã³æ¯ã«ï¼ã¤ããè¨å®ã§ããªãã£ã件IDCå´ã®ã°ãã¼ãã«IPãè¤æ°ç¨æã§ããªãåæã§ãããIDCã¨AWS(VPC)éã§ã®VPNæ¥ç¶
ãã®ææ¸ã¯ãæè¡è©è«ç¤¾åãWEB+DB PRESS Vol.22ãã«å·çããè¨äºãæè¡è©è«ç¤¾ã® 許å¯ãå¾ã¦WWWã§å ¬éãã¦ãããã®ã§ãã ãã®WWWçã¯æ ¡æ£åã®å稿ãå ã«ãã¦ããç¹ãWWWå ¬éå¾ã«å¿ è¦ãããã°ä¿®æ£ããç¹ã§ãéèªçã®æç« ã¨ã¯ç°ãªãé¨åãããã¾ããã¾ããå³è¡¨ãéèªçã¨ã¯ç°ãªãã¾ãã äºããäºæ¿ãã ããã ã¾ãããã®æç« ã対象ãã¦ããã®ã¯MySQL 4.0ç³»ãªã®ã§ãææ°ã®ãªãªã¼ã¹çã¨æ¯ã¹ãã¨èª¬æä¸è¶³ãªç¹ãªã©ãå¤ã ããã¨æãã¾ãã ã¬ããªã±ã¼ã·ã§ã³ã®åºæ¬ãããããã«ã¯ããã®ææ¸ã¯ã¾ã æçã ã¨æãã¾ãããè¨å®ã¬ãã«ã®èª¬æã¯ææ°ã®ããã¥ã¡ã³ããåç §ããããã«ãã¦ãã ããã
ãç¥ãã
é害
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}