centos7 mysql µ¥¸ó ½ÇÇà¿¡·¯ - Table 'mysql.host' doesn't exist - ½ÇÀü
- ÀÛ¾÷ȯ°æ -
Database Version : MySQL 5.0.19
OS : Solaris 8. 2/02
(mysql ¼³Ä¡ µð·ºÅ丮°¡ /usr/local/mysql À̶ó°í °¡Á¤)
- »ç·Ê
¨Í MySQLÀ» Á¤»óÀûÀ¸·Î ¼³Ä¡ÈÄ µ¥¸óÀ» ½ÇÇàÇÏ·ÁÇßÀ¸³ª ¾Æ·¡¿Í °°Àº ¿¡·¯¸¦ ¹ß»ý½ÃÅ°¸ç µ¥¸óÀÌ ½ÇÇàÀÌ ¾ÈµÉ¶§.
¨Î MySQLÀ» Á¤»óÀûÀ¸·Î »ç¿ëÇÏ´øÁß ºñÁ¤»óÀûÀ¸·Î ¼¹ö°¡ Á×Àº µÚ¿¡ ÀçºÎÆÃÇÑ ÈÄ µ¥¸óÀ» ½ÇÇàÇÏ·Á ÇßÀ¸³ª ¾Æ·¡¿Í °°Àº ¿¡·¯¸¦ ¹ß»ý½ÃÅ°¸ç µ¥¸óÀÌ ½ÇÇàÀÌ ¾ÈµÉ¶§.
- Çö»ó (¾ÕÀ¸·Î ´õ Ãß°¡ ¿¹Á¤)
¨Í µ¥¸óÀ» ½ÇÇà½ÃÅ°·Á ÇßÀ¸³ª ¾Æ·¡¿Í °°Àº ¿¡·¯¸¦ ¹ß»ý½ÃÅ°¸ç µ¥¸óÀÌ ½ÇÇàÀÌ ¾ÈµÉ¶§.
shell> bin/mysqld_safe --user=mysql &
[1] 555
shell> Starting mysqld daemon with databases from /usr/local/mysql/data
STOPPING server from pid file /usr/local/mysql/data/vfms.pid
060323 17:24:19 mysqld ended
[1] + done ../bin/mysqld_safe --user=mysql
shell>
- È®ÀλçÇ×
¨Í MySQL¼³Ä¡½Ã mysql_install_db --user=mysql ¸í·ÉÀ» ½ÇÇàÇÏ¿´³ª?
<¼Ò½º·Î ¼³Ä¡ÇÑ °æ¿ì>
shell> ./scripts/mysql_install_db --user=mysql
<pkg·Î ¼³Ä¡ÇÑ °æ¿ì>
shell> ./bin/mysql_install_db --user=mysql
¨Î ±âº» DBµéÀÇ µ¥ÀÌÅÍ°¡ Á¸ÀçÇϴ°¡? mysql°ú test µð·ºÅ丮
<¼Ò½º·Î ¼³Ä¡ÇÑ °æ¿ì> shell> ls ./var
<pkg·Î ¼³Ä¡ÇÑ °æ¿ì> shell> ls ./data
shell> ls ./var ȤÀº ls ./data
ib_logfile0 mysql-bin.000001 mysql
ib_logfile1 mysql-bin.000002 test
ibdata1 mysql-bin.index host¸í.err
¨Ï mysql ÀÇ Error ·Î±×¸¦ ±â·ÏÇÏ´Â host¸í.err ÆÄÀÏÀÇ ³»¿ëÀ» È®ÀÎÇØ º¸¾Ò´Â°¡?
shell> vi ./var/host¸í.err
.
.
060323 17:24:18 mysqld started
060323 17:24:19 InnoDB: Started; log sequence number 0 43655
060323 17:24:19 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
060323 17:24:19 mysqld ended
¨Ï À§¿¡¼ È®ÀÎÇÑ °á°ú mysql°ú test() µð·ºÅ丮´Â Á¸ÀçÇÏÁö¸¸ mysqlÀÇ µð·ºÅ丮 ³»ºÎ¿¡´Â ¾Æ¹«·± µ¥ÀÌÅÍ°¡ ¾øÁö ¾ÊÀº°¡? (´Ü, test µð·ºÅ丮³»¿¡´Â ¾Æ¹«·± ÈÀÏÀÌ ¾ø¾îµµ ¹«°ü)
¾Æ·¡¿Í °°ÀÌ Å×À̺í¸í.MYD, Å×À̺í¸í.MYI, Å×À̺í¸í.frm µîÀÇ ÆÄÀϵéÀÌ Á¸ÀçÇؾßÇÑ´Ù.
shell> ls ./data/mysql
columns_priv.MYD proc.frm
columns_priv.MYI procs_priv.MYD
columns_priv.frm procs_priv.MYI
db.MYD procs_priv.frm
db.MYI tables_priv.MYD
db.frm tables_priv.MYI
func.MYD tables_priv.frm
func.MYI time_zone.MYD
func.frm time_zone.MYI
help_category.MYD time_zone.frm
help_category.MYI time_zone_leap_second.MYD
help_category.frm time_zone_leap_second.MYI
help_keyword.MYD time_zone_leap_second.frm
help_keyword.MYI time_zone_name.MYD
help_keyword.frm time_zone_name.MYI
help_relation.MYD time_zone_name.frm
help_relation.MYI time_zone_transition.MYD
help_relation.frm time_zone_transition.MYI
help_topic.MYD time_zone_transition.frm
help_topic.MYI time_zone_transition_type.MYD
help_topic.frm time_zone_transition_type.MYI
host.MYD time_zone_transition_type.frm
host.MYI user.MYD
host.frm user.MYI
proc.MYD user.frm
proc.MYI
- ÇØ°á ¹æ¹ý
¼³Ä¡½Ã ±âº» DBÀÇ Å×À̺íµéÀÌ Á¦´ë·Î »ý¼ºµÇÁö ¾Ê¾Ò°Å³ª ºÒ¿ÏÀüÇÑ mysqlÀÇ Á¾·á·Î ÀÎÇØ Áö¿öÁø °æ¿ì À̹ǷΠÁ¤»óÀûÀ¸·Î ¼³Ä¡µÈ mysqlÀÇ ±âº» DB°ü·Ã ÆÄÀϵéÀ» º¹»çÇؼ µ¤¾î¾²±âÇÏ¸é µÈ´Ù.
ºí·Î±×¿¡ ÷ºÎµÈ ÆÄÀÏÀº MySQL 5.0.19ÀÇ ±âº» DB(mysql)ÀÇ µ¥ÀÌÅ͵éÀ» tar·Î ¹Àº °ÍÀÌ´Ù.
ÇØ´ç ÆÄÀϵéÀ» ³»·Á¹ÞÀº ÈÄ mysqlÀÇ var/mysql ȤÀº data/mysql µð·ºÅ丮¿¡ º¹»çÇÑ´Ù.
ÀÌÀü¿¡ µî·ÏµÈ »ç¿ëÀÚµéÀÇ °èÁ¤°ú ºñ¹Ð¹øÈ£µéÀº ´ç¿¬È÷!! Á¸ÀçÇÏÁö ¾ÊÀ» °ÍÀ̸ç, ÃÖÃÊ ¼³Ä¡½Ã¿¡ Á¸ÀçÇÏ´Â root °èÁ¤¸¸ÀÌ Á¸ÀçÇÒ °ÍÀÌ´Ù. ¶ÇÇÑ root ÀÇ ºñ¹Ð¹øÈ£µµ ÃʱâȵǾî ÀÖÀ» °ÍÀÌ´Ù.
¶ÇÇÑ mysql DBÀÇ user Å×ÀÌºí¿¡ µî·ÏµÈ HostÀÇ À̸§(ÇöÀç´Â 'CHANGE'·Î ¼¼ÆÃ)À» ÀÚ½ÅÀÇ ¼¹ö ¸íÀ¸·Î ¹Ù²ãÁÖµµ·Ï Çϼ¼¿ä. ^^*
shell> cd /usr/local/mysql/var
shell> tar -xvf mysql_5.0.19.pkg_data.tar
..
.
shell> ../bin/mysqld_safe --user=mysql &
[1] 596
shell> Starting mysqld daemon with databases from /usr/local/mysql/data <--- Áö±×½Ã Enter¸¦ ´·¯ÁØ´Ù. ^^*
---------------------------------------------------------------------------------------