ÃֽŠ°Ô½Ã±Û(DB)
2019.02.11 / 13:20

[MYSQL] ±¸µ¿ ½Ã Active: failed (Result: exit-code) ÇØ°á¹ý

hanulbit
Ãßõ ¼ö 215

¼­¹ö ¾÷µ¥ÀÌÆ® ÈÄ ÀçºÎÆÃÇÏ´Â °úÁ¤¿¡¼­ MysqlÀÌ ±¸µ¿µÇÁö ¾Ê¾Ò´Ù.


$ service mysql status


¸í·É¾î¸¦ ÅëÇØ »óŸ¦ È®ÀÎÇغ¸´Ï ¾Æ·¡¿Í °°¾Ò´Ù.

 

¡Ü mysql.service - LSB: Start and stop the mysql database server daemon           

  Loaded: loaded (/etc/init.d/mysql)                                                            

  Active: failed (Result: exit-code) since Thu 2018-02-22 08:28:48 KST; 7s ago       

  Process: 2693 ExecStop=/etc/init.d/mysql stop (code=exited, status=0/SUCCESS)

  Process: 2761 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE) 


mysql error log¸¦ È®ÀÎÇØ º¸ÀÚ.


$ cd /var/log/mysql

$ vi error.log         


¸Ç ¾Æ·¡¿¡ º¸´Ï ´ÙÀ½°ú °°Àº ¿¡·¯°¡ ÀÖ¾ú´Ù.


mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Incorrect file format 'plugin'
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: Initializing buffer pool, size = 8.0M
InnoDB: Completed initialization of buffer pool
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Started; log sequence number 0 2248162432
[ERROR] Fatal error: Can't open and lock privilege tables: Incorrect file format 'host'

±¸±Û¸µÀ» ÅëÇØ ´ÙÀ½°ú °°ÀÌ ÇØ°áÇß´Ù.


1. MySQL config ÆÄÀÏÀ» ¼öÁ¤ÇÑ´Ù. °æ·Î´Â

CentOS/RHEL/CloudLinux  : /etc/my.cnf 
Ubuntu/Debian               :/etc/mysql/my.cnf


ÆÄÀÏÀ» ¿­¸é [mysqld] section¿¡¼­ skip-grant-tables ¸¦ Ãß°¡ÇÑ´Ù.

ex.


[mysqld]

#

# * Basic Settings

#

user            = mysql

port            = 3306

...

skip-grant-tables

 


2. Mysql À» Àç½ÃÀÛÇÑ´Ù.

$ service mysql restart



Ãâó: https://roxxy.tistory.com/entry/MYSQL-±¸µ¿-½Ã-Active-failed-Result-exitcode-ÇØ°á¹ý [AreYouÁغñ]