MySQL初始化之后启动报错(mysqld: Table ‘mysql.plugin‘ doesn‘t exist)

报错场景

初始化之后,服务无法启动。错误日志error-log 报错如下:(mysql库下的系统表不存在)

2023-10-26T06:03:08.150163-00:00 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-10-26T06:03:08.496623-00:00 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
mysqld: Table 'mysql.plugin' doesn't exist
2023-10-26T06:03:09.141007-00:00 0 [ERROR] [MY-010735] [Server] Could not open the mysql.plugin table. Please perform the MySQL upgrade procedure.
2023-10-26T06:03:09.141244-00:00 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-10-26T06:03:09.141429-00:00 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-10-26T06:03:09.141599-00:00 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-10-26T06:03:09.141826-00:00 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-10-26T06:03:09.141960-00:00 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-10-26T06:03:09.142082-00:00 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-10-26T06:03:09.142198-00:00 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-10-26T06:03:09.471237-00:00 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-10-26T06:03:09.593702-00:00 0 [Warning] [MY-010015] [Repl] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-10-26T06:03:09.597026-00:00 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2023-10-26T06:03:09.597086-00:00 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2023-10-26T06:03:09.692911-00:00 0 [Warning] [MY-010441] [Server] Failed to open optimizer cost constant tables
2023-10-26T06:03:09.693231-00:00 0 [ERROR] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-001146 - Table 'mysql.component' doesn't exist
2023-10-26T06:03:09.693248-00:00 0 [Warning] [MY-013129] [Server] A message intended for a client cannot be sent there as no client-session is attached. Therefore, we're sending the information to the error-log instead: MY-003543 - The mysql.component table is missing or has an incorrect definition.
2023-10-26T06:03:09.693314-00:00 0 [Warning] [MY-000067] [Server] unknown variable 'loose_rpl_semi_sync_master_enabled=1'.
2023-10-26T06:03:09.693319-00:00 0 [Warning] [MY-000067] [Server] unknown variable 'loose_rpl_semi_sync_slave_enabled=1'.
2023-10-26T06:03:09.693323-00:00 0 [Warning] [MY-000067] [Server] unknown variable 'loose_rpl_semi_sync_master_timeout=30000'.
2023-10-26T06:03:09.693326-00:00 0 [Warning] [MY-000067] [Server] unknown variable 'loose_rpl_semi_sync_master_wait_for_slave_count=1'.
2023-10-26T06:03:09.693329-00:00 0 [Warning] [MY-000067] [Server] unknown variable 'loose_rpl_semi_sync_master_wait_no_slave=0'.
2023-10-26T06:03:09.693331-00:00 0 [Warning] [MY-000067] [Server] unknown variable 'loose_clone=FORCE_PLUS_PERMANENT'.
2023-10-26T06:03:09.693606-00:00 0 [ERROR] [MY-010326] [Server] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2023-10-26T06:03:09.693646-00:00 0 [ERROR] [MY-010952] [Server] The privilege system failed to initialize correctly. For complete instructions on how to upgrade MySQL to a new version please see the 'Upgrading MySQL' section from the MySQL manual.
2023-10-26T06:03:09.693723-00:00 0 [ERROR] [MY-010119] [Server] Aborting
2023-10-26T06:03:11.193205-00:00 0 [System] [MY-010910] [Server] /data/mysql/4407/base/bin/mysqld: Shutdown complete (mysqld 8.0.32)  MySQL Community Server - GPL.

在这里插入图片描述

问题要点

系统表 不存在,数据库刚进行完初始化呀,不合理呀?

# 初始化数据库
/data/mysql/3306/base/bin/mysqld --defaults-file=/data/mysql/3306/my.cnf.3306 --initialize-insecure --user=mysql
  • 排出了目录权限问题

问题原因和处理方式

  • 半同步插件的参数在初始化的时候不能开启
  • 处理方式是注释掉 下面参数,重新初始化。
# Semisync config 
#plugin-load                                             = "rpl_semi_sync_source=semisync_source.so;rpl_semi_sync_replica=semisync_replica.so"
#rpl_semi_sync_source_enabled                            = 1
#rpl_semi_sync_replica_enabled                           = 1                

完结撒花。