2016-11-12 25 views
2

我使用MySQL的16年5月7日的社區和CentOS 7在mysqld.log沒有臨時密碼

我下面的視頻tutorial安裝mysql:

  1. wget的http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
  2. 百勝localinstall開發.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
  3. yum repolist enabled | grep的 「MySQL的。-community。
  4. 百勝安裝的MySQL社區服務器
  5. 服務mysqld的啓動

啓動MySQL後,我可以看到的狀態還活着(運行)與service mysqld status

但是,我不能得到任何東西:grep 'temporary password' /var/log/mysqld.log

msyqld.log(忽略正常原木):

[Warning] InnoDB: Cannot open table mysql/plugin from the internal data dictionary of InnoDB though the .frm file for the table exists. 
mysqld: Table 'mysql.plugin' doesn't exist 

[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 

[Warning] InnoDB: Cannot open table mysql/gtid_executed from the internal data dictionary of InnoDB though the .frm file for the table exists. 
mysqld: Table 'mysql.gtid_executed' doesn't exist 

[Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 

[Warning] InnoDB: Cannot open table mysql/server_cost from the internal data dictionary of InnoDB though the .frm file for the table exists. 

[Warning] Failed to open optimizer cost constant tables 

[Warning] InnoDB: Cannot open table mysql/time_zone_leap_second from the internal data dictionary of InnoDB though the .frm file for the table exists. 

[Warning] Can't open and lock time zone table: Table 'mysql.time_zone_leap_second' doesn't exist trying to live without them 

[Warning] InnoDB: Cannot open table mysql/servers from the internal data dictionary of InnoDB though the .frm file for the table exists. 

[ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist 

感謝任何幫助!

回答

5

我想通了。

  1. 我安裝了mysql選擇的centos 7,mysql版本是5.5。
  2. 刪除它:yum刪除mysql-serverl。
  3. 通過本教程安裝5.7.16。
  4. 有這些錯誤。
  5. yum刪除mysql-community-server,再次安裝5.7。
  6. 仍有這些錯誤。
  7. yum刪除mysql-community-server,但刪除目錄/ var/lib/mysql。
  8. 然後再次安裝,它的工作原理。

關鍵是需要手動刪除/ var/lib/mysql。

+1

謝謝,刪除'/ var/lib/mysql'並重新安裝mysql爲我做了! – Peter