我删除了 MySQL 的 `performance_schema` 数据库,我该如何创建它?

Jun*_*r X 11 mysql

在修复 ibdata/log 问题时,我不小心丢失了我的performance_schema数据库,我想创建一个新的。

mysql> SHOW VARIABLES LIKE 'perf%';
+---------------------------------------------------+---------+
| Variable_name                                     | Value   |
+---------------------------------------------------+---------+
| performance_schema                                | ON      |
| performance_schema_events_waits_history_long_size | 10000   |
| performance_schema_events_waits_history_size      | 10      |
| performance_schema_max_cond_classes               | 80      |
| performance_schema_max_cond_instances             | 1000    |
| performance_schema_max_file_classes               | 50      |
| performance_schema_max_file_handles               | 32768   |
| performance_schema_max_file_instances             | 10000   |
| performance_schema_max_mutex_classes              | 200     |
| performance_schema_max_mutex_instances            | 1000000 |
| performance_schema_max_rwlock_classes             | 30      |
| performance_schema_max_rwlock_instances           | 1000000 |
| performance_schema_max_table_handles              | 100000  |
| performance_schema_max_table_instances            | 50000   |
| performance_schema_max_thread_classes             | 50      |
| performance_schema_max_thread_instances           | 1000    |
+---------------------------------------------------+---------+
16 rows in set (0.06 sec)
Run Code Online (Sandbox Code Playgroud)

这些变量对我来说似乎很好。

以下问题提出了同样的问题,但是用户得出结论,他们能够按照我在其中找不到此类说明的文档来创建它。

mysql:删除了performance_schema,是不是有问题?

有什么想法吗?

Cra*_*ein 18

在表performance_schema数据库的视图和临时表不存储数据永久收藏。该mysql_upgrade命令将恢复performance_schema数据库

从外壳

mysql_upgrade --user=root --password=password
Run Code Online (Sandbox Code Playgroud)

  • 做完之后重启`mysql`服务!它仅在我重新启动后才起作用。 (2认同)