![mysql_upgrade - 无法创建数据库“performance_schema”](https://linux22.com/image/163272/mysql_upgrade%20-%20%E6%97%A0%E6%B3%95%E5%88%9B%E5%BB%BA%E6%95%B0%E6%8D%AE%E5%BA%93%E2%80%9Cperformance_schema%E2%80%9D.png)
我托管许多生产站点的 VPS 空间不足。我发现里面有一个2GB+的文件/var/log/mysqld.log
该文件包含类似的行:
2019-11-01T12:21:57.708857Z 30600 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name. Please run mysql_upgrade
2019-11-01T12:21:57.709106Z 30600 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name. Please run mysql_upgrade
2019-11-01T12:21:57.709135Z 30600 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name. Please run mysql_upgrade
2019-11-01T12:21:57.709380Z 30600 [Warning] InnoDB: Table mysql/innodb_table_stats has length mismatch in the column name table_name. Please run mysql_upgrade
2019-11-01T12:21:57.709399Z 30600 [Warning] InnoDB: Table mysql/innodb_index_stats has length mismatch in the column name table_name. Please run mysql_upgrade
我做了mysqldump
备份。我尝试运行mysql_upgrade -u root -p
但失败了:
~]# mysql_upgrade -u root -p
Enter password:
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
mysql_upgrade: [ERROR] 1006: Can't create database 'performance_schema' (errno: 15749056)
请提出什么问题。我在 stackoverflow 和 google 上进行了研究,但我找不到任何可以帮助我解决这个问题的东西。任何想法都非常感激。
这是我的版本:
Server version: 5.7.23 MySQL Community Server (GPL)
在 Centos 7 上运行。
更新:我也尝试过(如下建议):
chown -R mysql:mysql /usr/local/mysql/data
但是在文件夹/usr/local/中没有mysql相关的文件夹。
然后我尝试了chown -R mysql:mysql /var/lib/mysql
命令没问题。但问题仍然存在。
问候