äžè¬çã«ãããã¯ãã®ãããªãã®ã§ãã...
ãšã³ããªãŒ
ãããŠãããæŽããæ¥ãéšéé·ããããŒãããŒã«é»è©±ããããMySQL Server 5.1ãDBMSãšããŠäœ¿çšããŠãã®æ©é¢ã®ã·ã¹ãã ãéçºããã¿ã¹ã¯ãä»»ããŸããã ç§ãã¡ã¯ã·ã¹ãã ãéçºããŸããã誰ããéåžžã«æºè¶³ããŠããããããå®è£ ããæãæ¥ãŸããã æã ã¯ã管çè ã®ãããããäžèšã®MySQL 5.1ã®ãµãŒããŒã«èšç«ãããéèæ©é¢ã®äºåæã«æ¥ãŠã圌女ã®ããŒã¹ãéå§ããŠããäœã®åé¡ããªããèªåã®ãã·ã³ã«ã€ã³ã¹ããŒã«ãããã¯ã©ã€ã¢ã³ãã¢ããªã±ãŒã·ã§ã³ã¯ãå®è£ ããã»ã¹ãéå§ããŸããã æœèšã®åŸæ¥å¡ã¯ã·ã¹ãã ã«éåžžã«æºè¶³ããŠããŸããããäœæ¥è² è·ãäŒè°ãäŒè°ãåžæ°ã®èšŽããªã©ã«ããããã£ãããšç¿åŸããŸããã ãã£ãããšæ å ±ãå ¥åãããã倧ãã«ã䌞ã³ãåã³ãã äžã€ã¯ãã§ã«éãã«ãããã¯ã¢ãã/ãªã«ããªæŠç¥ã«ã€ããŠèãå§ããŠããããç§ã¯ç®¡çè ãšéçºè ããããŸããã®ã§ãããã¯ãæ¬åœã«äœãç§ã®ä»äºã§ã¯ãªããšæãããŸãã ãããã管çè ã¯ãŸã£ããç¡é¢å¿ã§ããã ç§èªèº«ã¯ãããã§ããå°ãã§ã誰ãããã¯ã¢ãããäœæããããã«éå§ããªãå Žåã¯ãç§ã¯ãã§ã«å§ããŸãããããããŸã§ã»ãšãã©æ å ±ãšããäºå®ã«ãã£ãŠã®ã¿æ °ãã æ¯ãè¿ã£ãŠã¿ããšããã®åŸã®ã€ãã³ããäºæž¬ããã®ãã©ãã»ã©ç°¡åããããããŸããã
ãã°ãããããšãäž»èŠãªåŸæ¥å¡ã®äžã€ããæããããã£ããã¢ããããæéã®éåžžã«å°ããªæéã«å€§éã®æ å ±ã¯ãã»ãšãã©ãã¹ãŠã®æéã§å ¥åã§ããæ å ±ã®ãã·ã¹ãã ã«å ¥åãããŠããŸãã ç§ã¯ãã¹ãŠãå¯äžã®åœŒãã®è«æã§ã以åã®ããã«ã圌ãã¯ãŸãããã£ãããšã·ã¹ãã ãçã£ããŸã äœãæ¬åœã«èªåèªèº«ãåããŠãå ¥åããŠããªããšèããããã«ã€ããŠèããšæããŸããã åŸæ¥å¡ã¯ããã«æ å ±ãå ¥åãã1ãæéäŒæãåããŸããã
äž»ãªæŠã
ãããŠãå¥ã®ãçŸãããæ¥ãæ¥ãŠããµãŒããŒãã¯ã©ãã·ã¥ããŸããã ããã«ããœãããŠã§ã¢ã§ã¯ãªããããŒããŠã§ã¢-ããŒããã©ã€ãããé£ã³ãŸãããã ããã«ãããŒããã©ã€ãã¯ãããŒã¿åŸ©æ§ã«åŸäºããŠããäŒç€Ÿã«å ¥ããæ å ±ã®å€ãã¯ã圌ã«åŸ©å ãããŸããã ãã ãã管çè ã¯ãµãŒããŒèªäœã埩å ãããšãã«ããã£ã¹ã¯Dãããã¹ãŠã®æ å ±ã®ã¿ã埩å ããMySQLã«ã€ããŠèª°ãæãåºããŸããã§ããïŒã幞éãªããšã«ããã£ã¹ã¯Cã«ä¿åãããŸããïŒã ãã¹ãŠã®ãã®æéãç§ã¯ãããã®ã€ãã³ãã«ã€ããŠã¯ãä»ã®ãããžã§ã¯ããšå¹³åã«åŸäºããŠãããšç¥ã£ãŠç¥ããŸããã§ããã
ããå°ãæéãçµã¡ãåè¿°ã®æ©é¢ã®åŸæ¥å¡ã¯äŒæãé¢ããŸãã ç§ã«é»è©±ããŠã圌ã¯ãã°ã€ã³ã§ããªããšèšããŸãã ç§ããã€ãã®ããã«ãã·ã¹ãã ãæäŸããåæã«äœã®ã¡ãã»ãŒãžå°ãããã¹ãŠã®ããšã¯ãããã«äœããããŒã¿ããŒã¹ãžã®æ¥ç¶ã«åé¡ãããããšãèªèããŠããŸãã ããã«ããµãŒããŒã¯ã©ãã·ã¥ã«é¢ãããã®è©±ã圌女ããæ¢ã«ç¥ã£ãŠããã®ã§ã圌ãã¯ãäœããå€ãããã®ã§ãç§ã®ç解ã¯ããã«æ·±ãŸããŸããä»ã§ã¯ãããŒã¿ããŒã¹ããµãŒããŒäžã«ãŸã£ãããªãããšã«æ°ä»ããŸããã ããã«ãå€æããããã«ãããŒã¿ããŒã¹ãDBMSããããŸããã 管çè ã«ãäœããã£ãã®ããäœã埩å ãããã®ããäœã埩å ãããªãã£ãã®ããå°ããŸããç§ã¯ãæ ¹æ ããªããšããæ®å¿µãªçµè«ã«è³ããŸããã倧ããªåé¡ã¯ã埩å ã§ãããã©ããã§ãã ç§ã¯æ®ºå®³åŸ©å ããããŒã¿ãããŒããã©ã€ãã®ã³ããŒãåãããããæãäžããããã«å§ããŸãã
ãŸããMySQLãããã©ã«ãã§ã€ã³ã¹ããŒã«ãããProgram Filesãã©ã«ããŒãæ¢ããŠããŸãã ç§ã¯ãããç§ãã¡ã®ããŒã¹ã®ã»ãšãã©ã®ååã®ãã©ã«ããèŠã€ããããšãããã¡ã€ã«ãã©ã«ãã®MySQLããŒã¿ããŒã¹ãèŠã€ããããšãã§ããŸããã ããããªæ¥œèŠ³è«ãç§ã®çµ¶æã®é²ããããã«åæ£ãããŸãããã...çè«çã«ã¯ããŒãã«ãšã³ããªãå¿ èŠãª* .MYDãã¡ã€ã«ãèŠããšãå ¥åãããæ å ±éã«å¯ŸããŠãµã€ãºãå°ããããããšãããããŸãã ãã€ããªãã°ãå«ãŸããŠãããããã®ãªãã·ã§ã³ã¯èªåçã«æ¶ããŸããã ç§ã¯ãã®åé¡ã«ã€ããŠèãå§ããç§ãè¡ã£ããã¹ããµãŒããŒã®éçºããŒã¹ãèŠãããšãã§ããããšãèŠããŠããŸãã ããã§ãã»ãšãã©ã®ããŒãã«ïŒããã³æãéèŠãªããŒãã«ïŒãInnoDBãšã³ãžã³ã§åäœããããšã確èªããŸãããã€ãŸãããããã®ã¬ã³ãŒãã¯ibdata *ãã¡ã€ã«ïŒç§ã®å Žåã¯ibdata1ã®ã¿ïŒã«åå¥ã«æ ŒçŽãããŸãã 1ã€äžã®ã¬ãã«ã«ç§»åãããšããã®å€§åãªãã¡ã€ã«ã衚瀺ãããŸãã ãŸããInnoDBãšã³ãžã³ã®2ã€ã®ãã°ib_logfile0ããã³ib_logfile1ãè¿ãã«ãããŸã ã ãè©æ¬ºåž«ãã®éã§ããã¹ããšãã£ã¿ãŒã§è¡šç€ºããããã«ãã°ã®1ã€ãéããåŸãæ å ±èªäœã®æçã確èªããå°ãªããšãçè«çã«ã¯ããŒã¿ããŒã¹ã埩å ã§ããããšã«æ°ä»ããŸããã
è»ãéžæããå¿ èŠããããŸãããããã§ã¯ãåºå°èªäœã埩å ããããšè©Šã¿ãŸããã ãªããªã éçºäžã«ããã¹ããµãŒããŒã䜿çšããŸãããã¡ã€ã«ã·ã¹ãã ã¬ãã«ã§ã¯ã誰ãåæã«ç§ã«äžããããšã¯ã§ããŸãããWindowsXPãå®è¡ããŠããéçºãã·ã³ã«MySQL Server 5.1ãšMySQL GUIããŒã«ãçŽæ¥ã€ã³ã¹ããŒã«ããããšã«ããŸãã ãããã£ãŠããã¹ãŠã®ã³ã¹ããããããDBMSãå®è¡ãããŠãããã¿ã¹ã¯ãžã®ã¢ãããŒãæ¹æ³ãèããã®ã§ããŸããã¹ããµãŒããŒããããŒã¿ããŒã¹äœæã¹ã¯ãªããããšã¯ã¹ããŒããããããåŸã§èªåã®ã³ã³ãã¥ãŒã¿ãŒã§å®è¡ããããšã«ããŸãã ããã§ãå®å šã«åäžã®æ§é ãšãã¹ãŠã®ã¹ãã¢ãããã·ãŒãžã£ãæã€ç©ºã®ããŒã¿ããŒã¹ãã§ããŸããã MySQLãµãŒãã¹ãåæ¢ããã¯ã©ãã·ã¥ãããµãŒããŒã®ããŒã¿ããŒã¹åã®ãã©ã«ããŒãããã¹ãŠã®ã³ã³ãã³ãããæ°ããã€ã³ã¹ããŒã«ãããMySQLããŒã«ã«ã®åããã©ã«ããŒã«ã³ããŒããŸãïŒããŒã¿ããŒã¹åã®ãã©ã«ããŒã¯ãMySQLã®ã€ã³ã¹ããŒã«äžã«æå®ãããããŒã¿ãã¡ã€ã«ãä¿åãããã¹ã«æ²¿ã£ãããŒã¿ãã©ã«ããŒã«ãããŸãïŒ ã ããªãã¯ããŒã«ã«ã®MySQLãµãŒããã»ããã¢ãããããšããç§ã¯ãããŒã¿ãããã«ibdata1ãšåŸ©å ããããã¡ã€ã«ããªãã«æããå¥ã®ãã©ã«ãããã¡ã€ã«ã®InnoDBã«æå®ããããšã決ããŸããã ãã®åŸãInnoDBãã°ãã¡ã€ã«ïŒ ib_logfile0ããã³ib_logfile1 ïŒãããŒã¿ãã©ã«ããŒã«çŽæ¥è»¢éããŸãããããã¯ããã©ã«ãã§ããã¯ãã§ãã
MySQLãèµ·åããå¥ã®è©Šã¿ã¯åã³å€±æããŸããã DBMSã®ç®¡çã«ãããå®éã®æŠéçµéšã¯ãããŸããïŒã³ãŒã¹ã§åŸãçµéšãé€ããä»ã®DBMSã§ãåæ§ã§ãïŒãç§ã¯å®éšãè¡ãããšã«ããŸããããä»ã§ã¯ãŸã£ããå¿ èŠãªãããšãç解ããŠããŸãã InnoDBãã°ãã¡ã€ã«ãåé€ããMySQLãµãŒãã¹ãéå§ããŠãåãååã§ãµã€ãºã20 MBã®InnoDBãã°ãã¡ã€ã«ãäœæãããããšã確èªããŸãã
ç§ã¯ãã¯ã©ãã·ã¥ãããµãŒããŒã®ãã°ããããèªåããã¡ã€ã«ã®ãµã€ãºãèŠãŠããããå€§å¹ ã«ç°ãªãã81Mbã§ããããšãããããŸãã ããŠ...ãµãŒããŒãåæ¢ããMySQL管çè ãä»ããŠ[ã¹ã¿ãŒãã¢ããå€æ°]èšå®ã®[InnoDB]ã¿ãã«ç§»åããŸãã ç§ã¯81ã¡ã¬ãã€ãã®ãã°ã»ãã¡ã€ã«ã®ãµã€ãºãèšå®ãããããã°ãã¡ã€ã«ãããã¯ã¹ããŒããŸãã MySQLã¯èµ·åããŸããããèå³ã®ããããŒãã«ã«ããŒã¿ã衚瀺ãããŸããã§ããïŒMyISAMãšã³ãžã³ã§å®è¡ãããŠããããŒãã«ã«æ¢ã«åŸ©å ãããŠããŸããïŒã ãããã¯ãŒã¯ãå°ãæ€çŽ¢ããåŸãMySQLããªã«ããªã¢ãŒãã§èµ·åããå¿ èŠãããããšãèªã¿ãŸããããã®ãããéå§å€æ°InnoDB_force_recoveryã6ã«èšå®ããå¿ èŠããããŸãã .iniãŸãã¯my.cnf [MySQLã®ããŒãžã§ã³ãšéžæãããOSã«å¿ããŠ]ãæåã§ïŒãããã³äœããå®äºããªãã£ãããäœããèŠèœãšããŸããããæãŸããçµæã衚瀺ãããŸããã§ããã MySQLã¯éåžžã©ããèµ·åããŸãããããªã«ããªã«ã€ããŠã¯äœãèšããŸããã§ããã ããã®åŸãäœãã -ç§ã¯èãã- ãã³ã³ãœãŒã«ãè©ŠããŠã¿ãŠãã ããããããŠåã³æ確ãªãã·ã§ã³innodb_force_recoveryãåŠæ¹ããŸããã
Windowsã³ãã³ãã©ã€ã³ãèµ·åããŠã次ã®ããã«å ¥åããŸãã
> mysqld --console --innodb_force_recovery=6
å¿çãšããŠåãåããã®ïŒ
110727 10:31:52 [Note] Plugin 'FEDERATED' is disabled.
110727 10:31:52 InnoDB: Initializing buffer pool, size = 40.0M
110727 10:31:52 InnoDB: Completed initialization of buffer pool
110727 10:31:52 InnoDB: Operating system error number 32 in a file operation.
InnoDB: The error means that another program is using InnoDB's files.
InnoDB: This might be a backup or antivirus software or another instance
InnoDB: of MySQL. Please close it to get rid of this error.
ã¢ã³ããŠã€ã«ã¹ã®çœªã¯ããŸãæå³ããªãã£ãã®ã§ãCTRL + breakã䜿çšããŠã³ãã³ããåæ¢ããã¿ã¹ã¯ãããŒãžã£ãŒãæå¹ã«ããŠã³ãã³ããå床繰ãè¿ãããšã«ããŸããã å®è¡ã³ãã³ããå®è¡ããåã«ãããã»ã¹ã®ãªã¹ããèŠãŠãMySQLãµãŒãã¹ã®ã€ã³ã¹ã¿ã³ã¹ãå®è¡ãããŠããªãããšã確èªããŸããã ãããŠåã³åœŒã¯åœä»€ãç¹°ãè¿ããã åãã¡ãã»ãŒãžãèŠããšããã¿ã¹ã¯ãããŒãžã£ãŒã調ã¹ãŠãäœããã®çç±ã§2ã€ã®ããã»ã¹ãmysqldãšããååã§èµ·åãããŠããããšã確èªããŸããã1ã€ã¯ã·ã¹ãã ãšããŠããã1ã€ã¯ãŠãŒã¶ãŒãšããŠèµ·åãããŸããã ã·ã¹ãã ããã»ã¹ã殺ããç§ã¯ãæªåŸªç°ãæã¡åãããããã³å®è¡ã¯ç¶ããŸããïŒ
> mysqld --console --innodb_force_recovery=6
110727 10:31:52 [Note] Plugin 'FEDERATED' is disabled.
110727 10:31:52 InnoDB: Initializing buffer pool, size = 40.0M
110727 10:31:52 InnoDB: Completed initialization of buffer pool
110727 10:31:52 InnoDB: Operating system error number 32 in a file operation.
InnoDB: The error means that another program is using InnoDB's files.
InnoDB: This might be a backup or antivirus software or another instance
InnoDB: of MySQL. Please close it to get rid of this error.
110727 10:32:02 InnoDB: Operating system error number 32 in a file operation.
InnoDB: The error means that another program is using InnoDB's files.
InnoDB: This might be a backup or antivirus software or another instance
InnoDB: of MySQL. Please close it to get rid of this error.
110727 10:32:12 InnoDB: Operating system error number 32 in a file operation.
InnoDB: The error means that another program is using InnoDB's files.
InnoDB: This might be a backup or antivirus software or another instance
InnoDB: of MySQL. Please close it to get rid of this error.
InnoDB: The user has set SRV_FORCE_NO_LOG_REDO on
InnoDB: Skipping log redo
110727 10:32:22 InnoDB: Started; log sequence number 0 0
InnoDB: !!! InnoDB_force_recovery is set to 6 !!!
110727 10:32:22 [Note] Event Scheduler: Loaded 0 events
110727 10:32:22 [Note] mysqld: ready for connections.
Version: '5.1.58-community' socket: '' port: 3306 MySQL Community Server (GPL)
ãããŸã§ã®ãšããç§ã¯äžåºŠã«2ã€ã®ããã»ã¹ãå®è¡ããããã«ããªãããã¯ãäœã ã£ãèãåºãããŠããŸããã åã³ãç§ãå ã¿èŸŒãã®ã§å«ããããã³MySQLã®ããã¬ãšã«ãä»ããŠããŒã¿ããŒã¹ã«æ¥ç¶ããç§ã¯ããŒã¿åŸ©æ§ããããšãèŠãŸããïŒ ãã®åã³ã¯ããã¹ãŠã®è³ªåãèæ¯ã«æŒãäžããŸããã
åå©ã®æèãšã³ã³ãããŒã«ã·ã§ãã
ãã¬ãžããéžè±ããããšãªãããããŒã¿ããŒã¹ããã³ãããŠäœæ¥çšãµãŒããŒã«åŸ©å ããŸãããã®ãããšã話ãã®äž»äººå ¬ã¯ãããŒããã©ã€ããå€æŽããŠã·ã¹ãã ãåã€ã³ã¹ããŒã«ããŸããã
> mysqldump --routines -u "user" -p db_name > [path\]db_name.sql
ãã¹ã¯ãŒããå ¥åãããšããã©ã¡ãŒã¿ãŒã§æå®ããããã©ã«ããŒå ã®db_name.sqlãã¡ã€ã«å ã®ãã¹ãŠã®ã¹ãã¢ãããã·ãŒãžã£ãšåæ§ã«ããã¹ãŠã®ããŒã¿ããŒã¹ããŒãã«ãäœæããã³èšå®ããã¹ã¯ãªãããååŸãããŸãã æ å ±ãä¿åãããŸããïŒ
次ã«ãå®çšŒåãµãŒããŒã«MySQLèªäœãã€ã³ã¹ããŒã«ããæ§æãã空ã®ããŒã¿ããŒã¹ãäœæããŠããã³ãããã³ãããŸãã
> mysql -u "user" âp db_name < [path\]db_name.sql
ã¯ã©ã€ã¢ã³ãã¢ããªã±ãŒã·ã§ã³ã®èšå®ã§ã¯ãäœãå€æŽããå¿ èŠã¯ãããŸããã§ããã IPã¢ãã¬ã¹ããã³ãããã¯ãŒã¯åã¯åããŸãŸãããã¯ç§ã®åã§ããã ç§ãã¡ã¯ã·ã¹ãã ã«å ¥ãããã§ãã¯ããŸãã-ãããå¥è·¡ã§ãïŒ -ãã¹ãŠã®æ å ±ãæŽã£ãŠããŸãã ãããããšã話ãçµäº...ãããã«ãã ããã話ã®æèšãã
çµè«ãšçµè«
ç§èªèº«ã«ãšã£ãŠãããã€ãã®éèŠãªããšãã€ãŸã次ã®ããšãããäžåºŠç解ããŸããã
- ããã¯ã¢ãã/ãªã«ããªæŠç¥ã¯ãéçºæ®µéã§ãã§ã«æ±ºå®ãããŠããå¿ èŠããããŸãã
- ããã¯ã¢ããã®åé¡ã§/埩å ã¯ãããªãããããèªåã§è¡ãããšãã§ããã°ã管çè ã®åžæããå¿ èŠã¯ãããŸããã ãããŠãã以äžã«ãããªãã¯ããªãã®ããã«ïŒéåžžã®æ段ã«ãã£ãŠãããªããã£ãã¬ãã«ã§äœãããšã¯å¯èœã§ããïŒããã®ããã»ã¹ãèªååããããã«å€ãã®åªåãããŠããªãå Žåã
- ITãæ±ãå ŽåãäŒæ¥ã®çµç¹ãšç¹å®ã®åãããžã§ã¯ãã«ãããååŸæ¥å¡ã®è²¬ä»»ã®æ確ãªèŠå¶ãéåžžã«éèŠã§ãã ãããŠIT-äŒæ¥å åæ¥ã®çŸä»£ã®åºæºã¯ã©ããããšããªããéåžžã«ãéåžžã«é¢é£ããŠã¢ããããŠããŸãã
- ããã§ããåºå°ãé£ãã§ããã¯ã¢ããããªãå Žå-ããã¯ããã«çµ¶æããŠãããããçç±ã§ã¯ãããŸããã
æåã¯ããã®å Žåã«äœãã©ã®ããã«è¡ããã«ã€ããŠç°¡åãªæ瀺ãäžããããšãèããŸãããããŸããååãšããŠããã®ãããªæ瀺ã¯ãããã¯ãŒã¯äžã§å©çšå¯èœã§ãã ãããŠã第äºã«ã圌ã¯ãèœãšãç©Žããšãšã©ãŒã§ããã¹ãŠãçŸç¶ã®ãŸãŸè©³çŽ°ã«èª¬æããããšã«æ±ºããŸããã ãŸãããã®ãããªåœ¢åŒã®ãã¬ãŒã³ããŒã·ã§ã³ã®æ¹ãããèå³æ·±ããããããªããšèããŸããã å®éãç§ã¯å°æ°æŽŸããã®ãããªèœãšãç©ŽïŒããæ£ç¢ºã«ã¯å°ããªå°ç³ïŒã«ééããããšã確信ããŠããŸãããããã§ããããããèšè¿°ãããããšã¯éèŠã ãšæããŸãã
ãããŠæåŸã«ãInnoDBããŒã¿ãšãã°ãã¡ã€ã«ã®ã¿ãInnoDBããŒãã«ãæã€äœæ¥ããŒã¹ããæ®ãããŠããå Žåã®åæ§ã®ç¶æ³ã§äœããã¹ããã®ç°¡åãªã¬ã·ãïŒ
- ããŒãã«ã®ããŒã¿ãã¡ã€ã«ãšèª¬æãã¡ã€ã«ãããŒã¿ãã©ã«ããŒã«çœ®ãæããŸãïŒ * .frm ã * .MYIããã³* .MYDãã¡ã€ã«ããã©ã«ããŒå ã®ãã¹ãŠãããŒã¿ããŒã¹åã«ãªããŸããã€ãŸãããã©ã«ããŒå šäœãã³ããŒãããŸãïŒã
- InnoDBããŒã¿ãã¡ã€ã«ïŒããã©ã«ãã§ã¯ãã»ãšãã©ã®å Žåãããã¯ããŒã¿ããŒã¹åã®ãã€ããªãã°ãšãã©ã«ããŒãä¿åãããããŒã¿ãã©ã«ããŒã§ããç§ã®å ŽåãInnoDBããŒã¿çšã«å¥ã®ãã©ã«ããŒãäœæããŸããïŒã§ããã¹ãŠã®ibdata *ãã¡ã€ã«ãåé€ããŸãã ããã§ã¯ãããããããã¡ã€ã«ã®ãµã€ãºãæå®ããèšå®ãäžèŽããªããã°ãªããªãããšã«çæãã¹ãã§ãã ãµã€ãºãç°ãªãå Žåã¯ããããè¡ãããšãã§ããŸãïŒãµãŒããŒã«ãã£ãŠæåã§äœæããããã¡ã€ã«ãåé€ããæ¢åã®ãµã€ãºãšåããµã€ãºã®æ°ããïŒãŸãã¯ãããã«å¿ããŠæ°ããïŒãäœæãããµãŒããŒãèµ·åããŠåæ¢ããããã«ãã£ãŠäœæããããã¡ã€ã«ã®ä»£ããã«ç¬èªã®ãã¡ã€ã«ã眮ãæããŸãã MySQL管çè ã¯ããã®æäœã容æã«ããããšãã§ããŸã-èšå®ãæåã§æäœããå¿ èŠããªãããã«ã ãŸãã¯ããã¹ãŠã®ãã¡ã€ã«ïŒãŸãã¯ãã¡ã€ã«ïŒããå ŽåïŒïŒãå€æŽããèšå®ãã¡ã€ã«my.ini / my.cfgã®ãµã€ãºãå€æŽããã ãã§ãããã«ç°¡åã«ã§ããŸã-ããã¯çè«çã«ã¯åäœããã¯ãã§ãã
- InnoDBãã°ãæ¢åã®å Žæã«ããããããŸãïŒæ¢ã«ååšããå Žåã¯çœ®ãæããŸãïŒïŒããã©ã«ãã§ã¯ãããã¯ããŒã¿ãšèª¬æãå«ããã¡ã€ã«ãä¿åãããŠããåãããŒã¿ãã©ã«ããŒã§ããããããèšå®ã§å€æŽã§ããŸãïŒã
- ïŒæåã§ããã° - ãã€ãåäœã§ãMySQLã®ç®¡çè ãªãã° - MBåäœïŒã®InnoDBãã°ã®ãµã€ãºã¯ãç§ãã¡ã®ãã°ã®ãµã€ãºã«èšå®ããŸãã
- MySQLããŒã¢ã³ãèµ·åãã
> mysqld --console
ãã°ã泚ææ·±ãèŠãŠããµãŒãã¹ãéå§ããå埩ãå®è¡ããå¿ èŠããããŸãã - ãªã«ããªãçºçããªãå Žåã¯ãæ§æãŸãã¯ãã©ã¡ãŒã¿ãŒã§innodb_force_recovery = 1ãèšå®ããå®è¡ããŠã¿ãŠãã ããã ããªãã¯åæ Œããªããªãã°ãæã ã¯innodb_force_recovery = 2ãå ¥ããŠå®è¡ããŠã¿ãŠãã ããã ç 6ãŸã§ã
- æåŸã«ãæã ã¯æã ã®ããŒã¿ãã©ãããèŠãŠããã®å Žã§ã¹ããããããã° - ãããŠãæ¬çªãµãŒããŒäžã§è¡ãããããŒã¿ããŒã¹ã®ãã³ãããè¡ããŸãã
LinuxãŸãã¯å¥ã®Unixã©ã€ã¯ã·ã¹ãã ã§ã®åæ§ã®æäœã¯ã次ã®ããã«ãªããŸãã ããã«ãç§ãç解ããŠããããã«ãMySQLã®ããŒã¿ãã¡ã€ã«ãšãã°ïŒããã³ãã€ããªãã°ãšInnoDBãã°ïŒã¯ãã¹ãŠã®ã·ã¹ãã ã§å ±éã§ãããWindowsã«èœã¡ããã®ã¯LinuxãOS Xã MySQLèªäœãåäœããä»ã®ã·ã¹ãã ã
åç §è³æ
InnoDBãšã³ãžã³ã®ããã¥ã¡ã³ã
ããã«
PhantomTLTã¯ã³ã¡ã³ããæ±ããŸã ïŒåœŒã®ã¢ããã€ã¹ã«åºã¥ããŠãäžèšã®ã¡ã¢ãå°ã調æŽããŸããïŒïŒ
datadirå šäœãä¿åããå Žåãåäžã®æ§é ãæã€ç©ºã®ããŒã¿ããŒã¹ãäœæããå¿ èŠã¯ãããŸããã ãã¹ãŠã®ãã¡ã€ã«ã眮ãæããŠãInnoDBãã°ã®ãµã€ãºã調æŽããã ãã§ãã
次ã«ãMySQLãèµ·åããŠããã°ã泚ææ·±ã調ã¹ãŸãã ãªã«ããªãéå§ããŠå®è¡ããå¿ èŠããããŸãã
ãªã«ããªã倱æããå Žåãconfig set innodb_force_recovery = 1ïŒhttp://dev.mysql.com/doc/refman/5.1/en/forcing-innodb-recovery.htmlïŒã§éå§ããŠã¿ãŠãã ããã ç§ãã¡ã¯éå§ããªãéããæã ã¯innodb_force_recovery = 2ãå ¥ããŠèµ·åããŠã¿ãŠãã ããã ç 6ãŸã§ã
ããªãã¯innodb_force_recovery = 6ã§ããã«æã¡äžããå Žåã¯ãäžè²«æ§ã®ãªãç¶æ ã§ã®ããŒã¿ããŒã¹ã®ãªã¹ã¯ãå®è¡ããŸãã ã€ãŸã ããŒã¿ã®æŽåæ§ïŒäžè²«æ§ïŒãæãªãããå¯èœæ§ããããŸãã
innodb_force_recovery = 6ã«éããããã圹ã«ç«ããªãã£ãå Žåãããã¯éåžžã«æ²ããã§ã-åæåã¢ãŒãã§åŸ©å ããå¿ èŠããããŸãã