English 中文(简体)
在升级期间,对MySQL服务器的错误进行“计算等于1行的贴现值”。
原标题:Fixing MySQL server error "Column count doesn t match value count at row 1" during upgrade
  • 时间:2024-05-05 02:55:15
  •  标签:
  • mysql

我在试图提升当地发展环境中的MySQL服务器时有以下错误信息:

2024-05-05T02:12:15.152874Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.37) starting as process 31012
2024-05-05T02:12:15.157727Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-05T02:12:15.640312Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-05-05T02:12:16.434948Z 4 [System] [MY-013381] [Server] Server upgrade from  80036  to  80037  started.
2024-05-05T02:12:17.935591Z 4 [ERROR] [MY-013178] [Server] Execution of server-side SQL statement  INSERT IGNORE INTO mysql.db VALUES ( localhost ,  performance_schema ,  mysql.session , Y , N , N , N , N , N , N , N , N , N , N , N , N , N , N , N , N , N , N );   failed with error code = 1136, error message =  Column count doesn't match value count at row 1 .
2024-05-05T02:12:17.938560Z 0 [ERROR] [MY-013380] [Server] Failed to upgrade server.
2024-05-05T02:12:17.938613Z 0 [ERROR] [MY-010119] [Server] Aborting

我尝试运行sudo mysqld --up levels=MINIMAL,并在位于/etc/mysql.conf.d/mysqld.cnf的档案中添加up levels=MINIMAL,也取得了相同结果。 此前,<代码>sudo 系统ctl开始我sql。 这提供了以下错误标识信息:

2024-05-05T02:25:13.151136Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.37) starting as process 32487
2024-05-05T02:25:13.155795Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-05-05T02:25:13.642077Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-05-05T02:25:14.433640Z 0 [Warning] [MY-013378] [Server] Server upgrade is required, but skipped by command line option  --upgrade=MINIMAL .
2024-05-05T02:25:14.527872Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-05-05T02:25:14.527917Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-05-05T02:25:14.542608Z 0 [Warning] [MY-013139] [Server] Cannot load from mysql.db. The table is probably corrupted!
2024-05-05T02:25:14.542651Z 0 [Warning] [MY-013139] [Server] Cannot load from mysql.columns_priv. The table is probably corrupted!
问题回答

我通过重新启用MySQL服务器来解决这个问题。 首先,我把数据移走,并重新整理数据来源:

sudo systemctl stop mysql
sudo mv /var/lib/mysql /var/lib/mysql-backup
sudo mkdir /var/lib/mysql
sudo chown mysql:mysql mysql

接着,我奉命重新启动我的SQL:sudo mysqld - 开始 - 根基

此时,我重新开始使用<代码>sudo 系统ctl开始我sql的服务,并注意到<代码>mysql.db的结构,尽管我也能够出口到文件表结构。 之后,我转开了数据手套,以恢复我的初始数据库:

sudo systemctl stop mysql
sudo mv /var/lib/mysql /var/lib/mysql0
sudo mv /var/lib/mysql-backup /var/libmysql
sudo systemctl start mysql

然后,我从<代码>/etc/mysql/mysql.conf.d/mysqld.cnf文档中删除了额外栏目,停止服务,删除<编码>=MINIMAL,并重新开始服务。 升级工作成功完成,所有工作都奏效。





相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签