MySQLã®ã¤ã³ã¹ãã¼ã«æ¹æ³ãé²åãã¦ããï¼ - sakaikã®æ¥ã éæã(T)ç·¨ http://d.hatena.ne.jp/sakaik/20130205/mysql5_6_install ãã¡ãã®è¨äºãèªãã ã使ã£ã¦ã¿ãããªã£ãã®ã§ã MySQL 5.6 ã CentOS 6.3(x86_64) ã«ã¤ã³ã¹ãã¼ã«ãã¦ã¿ã¾ããã æé ãã»ã¼ä¸è¨è¨äºã¨åãã§ãã CentOS 6 ãªã®ã§ä»¥ä¸ã®ããã« yum ã« RPM ãã¡ã¤ã«ã® URL ãç´æ¥æå®ãã¦ã¤ã³ã¹ãã¼ã«ã§ãã¾ãã # yum install http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.6/MySQL-client-5.6.10-1.el6.x86_64.rpm \ http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.6/
1. MySQL Admin ãè¦ã Devs ã®å¸¸èã DBA ã¯é常è 2013/09/14 yoku0825@MyNA PHP Conference 2013 2. ï¼¼ããã«ã¡ã¯ï¼ï¼ â yoku0825 â ã¨ããä¼æ¥ã® DBA â MySQL æ´ 5 å¹´ããã â ãªã©ã¯ããªã â ãã¹ã°ããªã â å«ã®å¤« â ãããã®ç¶ â æ¥æ¬ MySQL ã¦ã¼ã¶ä¼ (MyNA) ã®ã¹ããæ å½ 3. ï¼¼ããã¹ããã¨ï¼ï¼ â æ¥å¸¸çã« MySQL ã®ã½ã¼ã¹ã³ã¼ãã«è§¦ããå¤æ DBA ãããã¼ã® Devs ã«æããæã®ããµã«ãªé ( ã®ã¤ãã ) â ã¦ãã®éçºè¨èªã¯ PHP > Java >> Ruby ãããã§ã â ã¦ãã§ã¯ DBA ããµã¼ãã¼ã®æ§ç¯ã Devs ãè¨è¨ã» ãã¼ãã«æ§ç¯ã»éå¶ã DBA ã¯ãã©ãã«ã·ã¥ã¼ããæ¹ åææ¡ ( éç¨ ) ãã¨ãããµã¤ã¯ã«ã§åãã¦ãã¾ãã
ãã¤ãmysqlã®ä¸èº«ãè¦ãæã«å·¨å¤§åãã¦ãããã¡ã¤ã«ãè¯ãè¦ããã¦ãã¾ãããã (ã´_ãï½)ï¾ï½°ï¾ã£ã¦ãããããã«ããæã£ã¦ããªãã£ãã®ã§ ibdata*ã¨ib_logfile*ã«ã¤ãã¦èª¿ã¹ã¦ã¿ã¾ãã(ΦÏΦ)ï¾ï¾ï¾â¦ ç°¡åãªèª¬æãããã¨ã ibdata*ã¯å ±æãã¼ãã«ã¹ãã¼ã¹(å ¨ãã¼ã¿ã管çãã¾ããï¼ ib_logfile*ã¯ããã°ãã¡ã¤ã«ãããã§ãã ãã¼ã¿ã¯ç´æ¥ãã¼ãã«ã¹ãã¼ã¹ã«æ´æ°ããããã®ã§ã¯ãªãã ä¸æ¦ãã°ãã¡ã¤ã«ã«æ´æ°å 容ãæ¸ãè¾¼ã¾ããã ãã®å¾ã«ããã¼ãã«ã¹ãã¼ã¹ã«åæ ãããæµãã«ãªã£ã¦ãããããã ãã¼ãã«ã¹ãã¼ã¹ã®æ´æ°ã¯ã³ã¹ããé«ãã®ã§ããã«åæ ããã®ã§ã¯ãªãã ãã°ãã¡ã¤ã«ã«æ¸ãã¦ãããã¨ã§ãæ¸ãè¾¼ã¿ã®æ§è½ãããã¦ãããã(´ã»âã»ï½)ï¾ï½° ãã®ãããInnoDBã®ãã¼ã¿ã¯ããã¼ãã«ã¹ãã¼ã¹ã¨ãã°ãåããã¦å®å ¨ãªæ å ±ã¨ãªããããã âå®éã®ãã¡ã¤ã«ã¯ããã¤ãã§ãï¾
æ¨æ¥ä¸åº¦ã¨ã³ããªãæ¸ãã ãã¤ã¤éä¸ã§é¢åããããªã£ã¦ç ´æ£ããã®ã§ããããã£ã±ãç°¡åã«ã¡ã¢ã ãæ®ãã¦ããã¾ããæ®ããªãã¨åå¹´å¾ãããã«ãµãããªå¿ãããã§ï½ å¶éäºé ã¾ã¨ã å ã«å¶éäºé ãã¾ã¨ãã¦ããã¾ã ãã®1 innodb_data_file_pathã«åæã§ãããã¼ã¿ãã¡ã¤ã«ã®å®ç¾©æ°ã¯æ大ã§999ã¾ã§ã 1000å以ä¸ã®ãã¼ã¿ãã¡ã¤ã«å®ç¾©ãè¡ãã¨ãmysqldã®èµ·åæã®innodbåæå¦çã§æå³çã«ã¨ã©ã¼ãè¿ããã¦ãinnodbãåæ¢ããç¶æ ã§mysqldãèµ·åãã¾ãã ãã®2 innodb_data_file_path=file1:1G;file2:1G ... ã¨ããå ·åã«åæãã¦ãã£ãéã«ã¤ãã¤ãæ¸ããã®ã¯4096bytesæªæºã 4096bytesãè¶ããåã¯æ¹è¡ãã¦ãªãã¦ãæ¹è¡ããã¨è¦ãªããã¦(å¤ãã®ã±ã¼ã¹ã§ã¯)my.cnfãã¼ã¹æã«ã¨ã©ã¼ã«ãªãmysqldãèµ·åãã¾ããã æ
mysqlãµã¼ãã稼åãããä¸ã§æä½éæ¤è¨ãå¿ è¦ã ã¨æã£ã¦ããè¨å®ãã¡ã¢ãã¦ããã â ã³ã³ãã£ã°è¨å® # vi /etc/my.cnf [mysqld] ### åºæ¬è¨å® ### # ãã¼ã¿ãã¼ã¹ã®ãã¼ã¿ãã¡ã¤ã«ããã¼ãã«ãä¿ç®¡ãããã£ã¬ã¯ã㪠datadir = /var/lib/mysql/ # mysqldãlistenãããã¼ãçªå· port = 3306 # mysqlã¤ã³ã¹ã¿ã³ã¹ã®å®è¡OSã¦ã¼ã¶ user = mysql # ãµã¼ããèå¥ããçªå· # ãã¹ã¿ãã¹ã¬ã¼ãæ§æãã¨ãå ´åã«åDBãµã¼ããã¨ã«ã¦ãã¼ã¯ãªå¤ãæå®ãã server-id = 1 # UNIXã½ã±ãããã¡ã¤ã«ã«ããæ¥ç¶ã®ããã®ãã¡ã¤ã« # ãã¼ã«ã«ã§ã¯TCP/IPã使ããªã socket = /var/lib/mysql/mysql.sock # æåã³ã¼ãé¢é£ character-set-server
æ¡å¼µããç¶ãã InnoDB ã®ãã¼ã¿ãã¡ã¤ã«ã®ãµã¤ãºãå°ããããæ¹æ³ 2006-07-07-2: [MySQL] MySQL ã§ãã©ã³ã¶ã¯ã·ã§ã³ãå¯è½ã«ããã¹ãã¬ã¼ã¸ã¨ã³ã¸ã³ã¨ã㦠InnoDB ãããã¾ãï¼ InnoDB ã®ãã¼ã¿ãã¡ã¤ã«ã¯ï¼MyISAM ãã¼ãã«ã¨ç°ãªã£ã¦ï¼ããã©ã«ãã§ã¯ ibdata1 ã¨ãããã¡ã¤ã«ã«ãã¼ã¿ãèç©ããã¦ããã¨ãã«ãªãã¾ãï¼ MySQL ã® datadir ã«èªåæ¡å¼µãã 10 MB ã® ibdata1 ãã¡ã¤ã«ã 1 ã¤ã¨ã5 MB ã® ib_logfile ãã°ãã¡ã¤ã«ã 2 ã¤ä½æããã¾ã - 7.5.3. InnoDB èµ·åãªãã·ã§ã³ http://dev.mysql.com/doc/refman/4.1/ja/innodb-start.html ãã® ibdata1 ã¯ï¼å¤§éã®ãã¼ã¿ã追å ãã¦ããã¨ï¼èªåçã«ãµã¤ãºãæ¡å¼µãã¦ããã¾ãï¼ ãã
MySQLã®ã¤ã³ã¹ãã¼ã«ãè¡ãéã ã¤ã³ã¹ãã¼ã«å¾ä¸åº¦ãµã¼ããèµ·åããã確èªãããã¨ã«ã MySQLã®ãã©ã¡ã¼ã¿è¨å®ãè¡ã人ãå¤ããã¨æãã¾ãã innodbã使ç¨ããå ´åãmy.cnfã® innodb_data_file_path ã®è¨å®ã è¡ãæ¹ãå¤ãã¨æãã¾ãã è¨å®å¾ãMySQLãèµ·åã¨ã©ã¼ã«ãªã£ã¦ãã¾ã£ãå ´åã®å¯¾å¦æ³ããç¥ãããã¾ãã ã¾ããinnodb_data_file_pathã®ãã©ã¡ã¼ã¿ã®æå³ã«ã¤ãã¦ç°¡åã«èª¬æãã¾ãã innodbã§ã¯ ib_dataãib_log ã§å§ã¾ãååã®ãã¡ã¤ã«ã«ãã¼ã¿ããã°ãæ¸ãè¾¼ã¾ãã¾ãã è¨è¿°æ³ã¯ä»¥ä¸ã®ããã«ãªãã¾ãã innodb_data_file_path = ibdata1:2000M;ibdata2:10M:autoextend ãã®è¨å®ã§ã¯ãibdata1 ã¨ãããã¡ã¤ã«ã2GB確ä¿ãã 足ããªããªã£ãå ´å㯠ibdata2
æè¿ãInnoDBã®ãã¼ã¿é åï¼ãã¼ãã«ã¹ãã¼ã¹ï¼ãæé·ãã¦ãã¾ã£ã¦å ã«æ»ããã¨ãåºæ¥ãªãå ´åã®å¯¾å¦ã«ã¤ãã¦ãã質åãããã®ã§ãä»æ¥ã¯ãã¼ãã«ã¹ãã¼ã¹ãæé·ãããã¨ã¸ã®å¯¾çã«ã¤ãã¦èª¬æããããï¼ããã®ã¨ããMySQLãã¿ãç¶ãã¦ããããPlanet MySQLæ¥æ¬èªçãæèãã¦ããããã§ã¯ãªãã®ã§ãããããï¼ï¼ï¼ï¼ãã³ãããï¼ï¼ï¼ä¿ºï¼ InnoDBã®ãã¼ãã«ã¹ãã¼ã¹ãæé·ãã¦ãã¾ãã®ã¯ããºããªèªåæ¡å¼µãã¦ããããã§ããããã¼ãã«ã¹ãã¼ã¹ã«å¯¾ãã¦ä½ããªãã·ã§ã³ãæå®ããªãã¨ãããã©ã«ãã§ã¯æ¬¡ã®ãããªè¨å®ã¨åããã¼ãã«ã¹ãã¼ã¹ãä½æãããã [mysqld] innodb_data_file_path=ibdata1:10M:autoextend ãµã¤ãºã¯10MBãããªãããèªåæ¡å¼µããã®ã§ãããèªåæ¡å¼µãã¦ãã¾ãã¨ä½ãåé¡ãªã®ãã¨ããã¨ããã¼ã¿ãå¢ããå ´åã«ãã¡ã¤ã«ã·ã¹ãã ã®ç©ºãé åã使ãå
file_get_contentsé¢æ°ä½¿ç¨æã«åå¾å ãµã¼ãã«æ¥ç¶ã§ããªãå ´åãªã©ããã©ã«ãã§ã¿ã¤ã ã¢ã¦ãã¯60ç§ã«è¨å®ããã¦ããã¾ãã60ç§ã ã¨Ajaxã§éåæã§ä½ã£ã¦ããªãã¨ç»é¢æåã¾ã§60ç§å¾ ã¤ãã¨ã«ãªãã¾ãã ã¿ã¤ã ã¢ã¦ãã®å¤ã¯ããã°ã©ã ãã ini_seté¢æ°ã§å¤æ´å¯è½ã§ãã é¢æ°åã¯ããããå ¨ã¦ã® ini ã®å¤ãå¤æ´ã§ããããªé°å²æ°ã§ããå¤æ´ã§ããªãå¤ããã確èªãå¿ è¦ã§ãã ç¾å¨ã®ã¿ã¤ã ã¢ã¦ãæéã®åå¾ ã¿ã¤ã ã¢ã¦ãæéã¯php.iniã«è¨å®ãããããã¾ãã ; Default timeout for socket based streams (seconds) default_socket_timeout = 60 ã¿ã¤ã ã¢ã¦ãæéãåå¾ãã echo ini_get('default_socket_timeout')."\n"; // 60 file_get_content
This webpage was generated by the domain owner using Sedo Domain Parking. Disclaimer: Sedo maintains no relationship with third party advertisers. Reference to any specific service or trade mark is not controlled by Sedo nor does it constitute or imply its association, endorsement or recommendation.
åç½®ã MySQL 5.1ã§ãInnoDBãªãã¼ã¿ãã¼ã¹ã使ã£ã¦ä½ããéçºãã¦ããæä¸ã«ã¯ããã©ã³ã¶ã¯ã·ã§ã³ãã³ããã(ã¾ãã¯ãã¼ã«ããã¯)ãããåã«ããã°ã©ã å´ã®å¦çã(Fatal errorãªã©ã§)ç°å¸¸çµäºããããã¦ããã©ã³ã¶ã¯ã·ã§ã³ãããã¯ãåå¾ããã¾ã¾æ¾ç½®ç¶æ ã«ãªã£ã¦ãã¾ããã¨ãããããããã(è¬)ã ãããªæãMySQLã®ã³ãã³ãã©ã¤ã³ããæ´æ°ã¯ã¨ãªãçºè¡ããã¨ããã°ããå¾ã«æ¬¡ã®ãããªã¨ã©ã¼ãè¿ã£ã¦ãããã¨ãããã ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction ä¸å¿åèã¾ã§ã«æ¸ãã¦ããã¨ããã®ã¨ã©ã¼ãè¿ã£ã¦ããã¾ã§ã®æéã¯ã次ã®ã³ãã³ãã§ç¥ããã¨ãã§ããã mysql> show global variables like 'innodb_lock_wait_timeout';
Djangoã使ã£ã¦ãã¦ããã¾ã«syncdbï¼ã¢ãã«ããã¼ã¿ãã¼ã¹ã«æ´æ°ãããä½æ¥ï¼ãããã¨ãå¿çããªããªãæãããã¾ãã MySQLã¯æ´æ°çã®ãã¤ããªãã°ãæ®ãã¦ãã¦ããªã¹ãã¢ï¼å¾©æ§ï¼ããããããã«è¨è¨ããã¦ãã¾ãã ããã¯ã¢ããï¼ã¹ãããã·ã§ããï¼ãã©ããã®æç¹ã§ã¨ã£ã¦ããã¦ããã®ãã¨ã®æµãããã¤ããªãã°çã§è£å®ãããããªéç¨ãèãããã¾ãã ä¸æ¹ãæ´æ°ãå¤ããµã¼ãã¹ã¯ããã®ãã¤ããªãã°ãæ¾ç½®ãã¦ããã¨ããã¼ã¿å®¹éã大ãããªãããã¦ãã¾ãã¾ãã ä»åã¯ããã®è¨å®ãå¤æ´ãã¦ãé©åãªãã£ã¹ã¯å®¹éã使ããããã«ãããã¨æãã¾ãã å¿çããªããªãã³ãã³ãä¾ï¼æ³¨ï¼ãããã¼ã¿ãã¼ã¹ã®ã¹ãã¼ã¿ã¹ã確èªãã¾ããããï¼ #python ./manage.py syncdb ãã¼ã¿ãã¼ã¹ã®å®¹éç¢ºèª ãã®å ´åã¯å©ç¨ãã¦ãããã¼ã¿ãã¼ã¹ï¼MySQLï¼ã®ã¹ãã¼ã¿ã¹ã確èªãã¦ã¿ã¾ãããã ãã¼ã¿ãã¼ã¹ãµã¼ãã«æ¥ç¶
ãµã¼ãéç¨ã«ãããåºæ¬çãªç£è¦ã«ãã£ã¹ã¯ã®å®¹éç£è¦ãããã¾ãã ãã£ã¹ã¯ã®ä½¿ç¨çã100%ã«ãªãã¨ãµã¼ãã¹ã«å½±é¿ãã§ãã®ã¯ãã¡ããã§ããã ãµã¼ã管çè ã¨ãã¦100%ã«ãªãã¾ã§æ°ãä»ããªãã¨æ¥ããããã£ãããã¾ãã (è½ã¡ãåå ã¯ãªãã ãï¼ï¼ï¼ â ãããã£ã¹ã¯ã®ä½¿ç¨çã100%ã§ã(///)ã£ã¦ãªã) ãªã®ã§ã ããã90%ãé¾å¤ã«ãã£ã¹ã¯ã®ä½¿ç¨çç£è¦ããã¦ããã®ã§ããã ã¢ã©ã¼ããæ¤ç¥ãã¦ãããMySQLã®åãã¦ããµã¼ãã ã¨ãã¤ããªãã°ã®è¥å¤§åãçãã¾ãã ãã¤ããªãã°ã¯æ´æ°ç³»ã®ãã°ãè¨é²ããã¾ãããæ¾ã£ã¦ããã¨ééãªãå¢ããã®ã§ ãã£ã¹ã¯é¼è¿«ã®åå ã«ãªã£ã¦ãã¾ãã¾ãã ã®ã§ä¸è¦ãªãã°ã¯å®æçã«åé¤ããããã¾ããããã®ã¾ã¨ãã expire_logs_days my.cnfã« [mysqld] expire_logs_days=10ã¨è¨å®ããããset global 㧠mysql> s
mysqldumpã®ãªã³ã©ã¤ã³ããã¯ã¢ãã mysqldumpã®ãªãã·ã§ã³ mysqldumpæã«ããã¯ããããªããªãã·ã§ã³ã¯ã--single-transactionãã§ãã --single-transaction ãã®ãªãã·ã§ã³ã¯ãµã¼ããããã¼ã¿ããã³ãããåã«BEGIN SQLã¹ãã¼ãã¡ã³ããçºè¡ãã¾ããInnoDBã¨ãã£ããã©ã³ã¶ã¯ã·ã§ã³ãã¼ãã«ã«å¯¾ãã¦ã®ã¿ä¾¿å©ã§ãããªããªããã¢ããªã±ã¼ã·ã§ã³ããããã¯ããã«ãBEGINãçºè¡ãããå½æã®ãã¼ã¿ãã¼ã¹ã®ç¶æ ããã³ãããããã§ãã ãã®ãªãã·ã§ã³ã使ç¨ãã¦ããã¨ãã¯ãä¸å®ã®ç¶æ ã§ãã³ããããã®ã¯InnoDBãã¼ãã«ã®ã¿ã ã¨ãããã¨ãçæãã¦ãã ãããä¾ãã°ããã®ãªãã·ã§ã³ã使ç¨ä¸ã«ãã³ããããMyISAMãMEMORYãã¼ãã«ã¯ç¶æ ãå¤åããå¯è½æ§ãããã¾ãã mysqldump â ãã¼ã¿ãã¼ã¹ããã¯ã¢ããããã°ã©ã ãªãã¡ã¬ã³ã¹
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}