[ERROR] Can't open the mysql.plugin table

甲骨文技術支援發表於2017-11-03

centos7下的mysql 5.7.17,執行命令啟動資料庫的時候報錯:

systemctl start mysqld.service

  1. 2017-11-03T19:08:28.363912+08:00 0 [Note] /usr/sbin/mysqld (mysqld 5.7.17-log) starting as process 21010 ...
  2. 2017-11-03T19:08:28.367804+08:00 0 [Note] InnoDB: PUNCH HOLE support available
  3. 2017-11-03T19:08:28.367836+08:00 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
  4. 2017-11-03T19:08:28.367844+08:00 0 [Note] InnoDB: Uses event mutexes
  5. 2017-11-03T19:08:28.367849+08:00 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
  6. 2017-11-03T19:08:28.367853+08:00 0 [Note] InnoDB: Compressed tables use zlib 1.2.3
  7. 2017-11-03T19:08:28.367859+08:00 0 [Note] InnoDB: Using Linux native AIO
  8. 2017-11-03T19:08:28.367878+08:00 0 [Note] InnoDB: Adjusting innodb_buffer_pool_instances from 8 to 1 since innodb_buffer_pool_size is less than 1024 MiB
  9. 2017-11-03T19:08:28.368450+08:00 0 [Note] InnoDB: Number of pools: 1
  10. 2017-11-03T19:08:28.368574+08:00 0 [Note] InnoDB: Using CPU crc32 instructions
  11. 2017-11-03T19:08:28.370795+08:00 0 [Note] InnoDB: Initializing buffer pool, total size = 256M, instances = 1, chunk size = 128M
  12. 2017-11-03T19:08:28.386993+08:00 0 [Note] InnoDB: Completed initialization of buffer pool
  13. 2017-11-03T19:08:28.390005+08:00 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
  14. 2017-11-03T19:08:28.423716+08:00 0 [Note] InnoDB: Highest supported file format is Barracuda.
  15. 2017-11-03T19:08:28.532555+08:00 0 [Note] InnoDB: Creating shared tablespace for temporary tables
  16. 2017-11-03T19:08:28.532627+08:00 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
  17. 2017-11-03T19:08:28.630549+08:00 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
  18. 2017-11-03T19:08:28.631466+08:00 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
  19. 2017-11-03T19:08:28.631483+08:00 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
  20. 2017-11-03T19:08:28.632485+08:00 0 [Note] InnoDB: Waiting for purge to start
  21. 2017-11-03T19:08:28.683674+08:00 0 [Note] InnoDB: 5.7.17 started; log sequence number 1210395
  22. 2017-11-03T19:08:28.684392+08:00 0 [Note] InnoDB: Loading buffer pool(s) from /alidata1/mysql/data/ib_buffer_pool
  23. 2017-11-03T19:08:28.684694+08:00 0 [Note] Plugin 'FEDERATED' is disabled.
  24. mysqld: Table 'mysql.plugin' doesn't exist
  25. 2017-11-03T19:08:28.684846+08:00 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
  26. 2017-11-03T19:08:28.688758+08:00 0 [Note] InnoDB: Buffer pool(s) load completed at 171103 19:08:28
  27. 2017-11-03T19:08:28.692784+08:00 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
  28. 2017-11-03T19:08:28.696746+08:00 0 [Note] Found ca.pem, server-cert.pem and server-key.pem in data directory. Trying to enable SSL support using them.
  29. 2017-11-03T19:08:28.696945+08:00 0 [Warning] CA certificate ca.pem is self signed.
  30. 2017-11-03T19:08:28.698203+08:00 0 [Note] Server hostname (bind-address): '192.168.2.71'; port: 3306
  31. 2017-11-03T19:08:28.698235+08:00 0 [Note] - '192.168.2.71' resolves to '192.168.2.71';
  32. 2017-11-03T19:08:28.698270+08:00 0 [Note] Server socket created on IP: '192.168.2.71'.
  33. 2017-11-03T19:08:28.701031+08:00 0 [Warning] Failed to open optimizer cost constant tables

  34. 2017-11-03T19:08:28.701146+08:00 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
  35. 2017-11-03T19:08:28.701186+08:00 0 [ERROR] Aborting

解決辦法是:先初始化出來一個資料庫,datadir和my.cnf裡的一致


  1. mysqld --initialize --datadir=/alidata1/mysql/data




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20893244/viewspace-2146811/,如需轉載,請註明出處,否則將追究法律責任。

相關文章