显示标签为“mysql_install_db”的博文。显示所有博文
显示标签为“mysql_install_db”的博文。显示所有博文

2013年9月24日星期二

ERROR 1146(42S02):表不存在

Original post: http://anothermysqldba.blogspot.com/2013/09/error-1146-42s02-table-doesnt-exist.html

因此,一些你可能遇到過下面的錯誤安裝MySQL 5.6時:
  • ERROR 1146(42S02):表'mysql.innodb_index_stats'不存在
  • ERROR 1146(42S02):表'mysql.innodb_table_stats'不存在
  • ERROR 1146(42S02):表'mysql.slave_master_info'不存在
  • ERROR 1146(42S02):表'mysql.slave_relay_log_info'不存在
  • ERROR 1146(42S02):表'mysql.slave_worker_info'不存在
您可能會驚訝,你看到這個錯誤在一個全新的數據庫安裝。 你並不孤單。 儘管該問題是可以解決的。

最安全的做法是重新安裝mysql數據庫,通過下面的命令:mysql_install_db的
最近,我不得不這樣做對每一個新安裝的MySQL 5.6(是的,它的發生不止一次)在Solaris SPARC環境中。

您可以嘗試使用以下方法來創建丟失的表,但我發現,最好讓所有的一切清潔,並確保所有的設置與mysql_install_db的。
有人建議我在上面提到的“啟動修復,但我喜歡,我說我喜歡mysql_install_db的掛鉤,以確保一切正確安裝。

我有其他的博客文章,包括有關使用此命令的例子:

關於這一主題的相關文章:
如果你碰到這種表mysql_install_db的範圍之外看到彼得的博客文章,以幫助您開始:

2013年5月6日星期一

[警告] .....因為用戶設置為'mysql的'早在命令行上

Original Post: http://anothermysqldba.blogspot.com/2013/05/warning-because-user-was-set-to-mysql.html

shell> scripts/mysql_install_db --basedir=/usr/local/demouser --datadir=/var/lib/demodb --user=demouser --ldata=/var/lib/demodb

Installing MySQL system tables...


[Warning] Ignoring user change to 'demouser' because the user was set to 'mysql' earlier on the command line


Installation of system tables failed !
 

這是一個錯誤,讓你回頭看看你剛才輸入的命令,並開始懷疑自己。 這個錯誤是不是因為它出現。 如果到服務器已經安裝或曾經安裝MySQL的my.cnf文件很可能是目前已到位。 這個文件可能是非常有效的活動服務器,它是確定在這些情況 ​​下被單獨留在家中。 修復此錯誤是覆蓋默認值,使MySQL服務器拉從一個不同的文件,包括你喜歡的用戶名。 您可以更改文件中的用戶名,但它很可能是你正在尋找測試和做其他的事情,所以下面是一個例子,如何獲得向上的上述錯誤,並再次運行。


shell> cp support-files/my-small.cnf /etc/demodb.cnf

shell> vi /etc/demodb.cnf
端口= 3307
插座/ tmp / demodb.sock中的

用戶= demouser
的PID_FILE =的/ var / lib中/ demodb的/ demodb.pid

外殼腳本/ mysql_install_db的-默認文件= / ETC / demodb.cnf的   - BASEDIR =的/ usr /本地/ demouser - DATADIR =的/ var / LIB / demodb的的-用戶= demouser“ - LDATA =的/ var / lib中/ demodb的

安裝MySQL系統表...

正在灌裝幫助表...



同樣,如果目前的my.cnf文件存在mysql_install_db的將嘗試使用該文件。 經常在該文件中的用戶名設置導致錯誤“ 的用戶,在命令行設置'MySQL的早期 ”


shell> chown -R demouser /var/lib/demodb/*
shell> # bin/mysqld_safe --defaults-file=/etc/demouser.cnf --user= demouser --datadir=/var/lib/demodb/ --port=3307

# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/demodb.server

shell> # bin/ mysql --port=3307 --socket=/tmp/ demodb .sock
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.30 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.