0

I am trying to run MySql on my Virtual Machine. However, I encountered the following error and thus MySql cannot start up. I am new to MySql. Your help is really appreciated! Here is the message from the error log:

[Note] Plugin 'FEDERATED' is disabled.
/opt/mysql/mysql/sbin/mysqld: Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[Note] InnoDB: Using atomics to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Memory barrier is not used
[Note] InnoDB: Compressed tables use zlib 1.2.3
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, size = 128.0M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: Restoring page 0 of tablespace 0
[Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
[ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1
[ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
Amir
  • 1,328
  • 2
  • 13
  • 27
santi
  • 1
  • Good question for troubleshooting. But this is stackoverflow programming question – MaXi32 Sep 10 '20 at 06:30
  • To quote myself: [Can't open the mysql.plugin table. Please run mysql_upgrade to create it](https://stackoverflow.com/q/41531225). You didn't create a database. Edit your configfile to choose a data directory (or check where it is), then run the initialization. – Solarflare Sep 10 '20 at 06:35

2 Answers2

0
/opt/mysql/mysql/sbin/mysqld: Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

IF you read in carefully, first line enlightens the problem and the second line advises solution for it.

run mysql_upgrade to fix it.

Derviş Kayımbaşıoğlu
  • 28,492
  • 4
  • 50
  • 72
0

Seems, you didn't set path of your ibdata1 or you removed ibdata1 file. Please check my.cnf and set below parameter in my.cnf.

  • innodb_data_home_dir (path of innodb)

  • innodb_data_file_path (for example: ibdata1:10M:autoextend)

Note: If it's new setup then also enable innodb_file_per_table

ROHIT KHURANA
  • 903
  • 7
  • 13