解決警告:數據庫錯誤Column count of mysql.proc is wrong.

事實上,如果你使用phpMyAdmin的,你找不到錯誤問題出在哪裡?

  • 問題就因為你已升級MariaDB或MySQL數據庫版本。
  • 升級MariaDB或MySQL的數據庫版本後,數據結構未使用mysql_upgrade命令完成升級更新。
  • 之後,操作MySQL數據庫過程中,可能將顯示錯誤消息.

解決警告:數據庫錯誤Column count of mysql.proc is wrong.

WordPress外掛在自動備份過程期間,發生以下錯誤 ▼

警告: 數據庫錯誤Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 50560, now running 100406. Please use mysql_upgrade to fix this error 查詢SHOW FUNCTION STATUS

  • mysql.proc 這是5.1中的系統表,它記錄有關存儲過程或函數的信息。

如何解決警告:數據庫錯誤Column count of mysql.proc is wrong?

以下是陳溈亮記錄的解決方案。

第1步:保險做法是先dump或冷備份:

mysqldump -uroot -p123456 --quick --master-data=1 --all-databases --flush-logs --lock-tables >
  • 請將以上的“123456”,改成你的MySQL的root密碼。

第2步:使用以下mysql_upgrade 命令來解決

mysql_upgrade -u root --datadir=/var/lib/mysql/ --basedir=/ --password=123456

以下是SSH示範操作過程▼

[root@db lib]# mysql_upgrade -u root -p123456 -hdb --datadir=/var/lib/mysql/ --basedir=/
mysql_upgrade: the '--datadir' option is always ignored
mysql_upgrade: the '--basedir' option is always ignored
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--host=db'
Running 'mysqlcheck' with connection arguments: '--host=db'
mysql.columns_priv                                OK
mysql.db                                          OK
mysql.event                                       OK
mysql.func                                        OK
mysql.general_log
Error   : You can't use locks with log tables.
status  : OK
mysql.help_category                               OK
mysql.help_keyword                                OK
mysql.help_relation                               OK
mysql.help_topic                                  OK
mysql.host                                        OK
mysql.ndb_binlog_index                            OK
mysql.plugin                                      OK
mysql.proc                                        OK
mysql.procs_priv                                  OK
mysql.servers                                     OK
mysql.slow_log
Error   : You can't use locks with log tables.
status  : OK
mysql.student                                     OK
mysql.t1                                          OK
mysql.t2                                          OK
mysql.tables_priv                                 OK
mysql.time_zone                                   OK
mysql.time_zone_leap_second                       OK
mysql.time_zone_name                              OK
mysql.time_zone_transition                        OK
mysql.time_zone_transition_type                   OK
mysql.user                                        OK
................................................
test.newuser                                      OK
test.usertag                                      OK
Running 'mysql_fix_privilege_tables'...
WARNING: NULL values of the 'character_set_client' column ('mysql.proc' table) have been updated with a default value (latin1). Please verify if necessary.
WARNING: NULL values of the 'collation_connection' column ('mysql.proc' table) have been updated with a default value (latin1_swedish_ci). Please verify if necessary.
WARNING: NULL values of the 'db_collation' column ('mysql.proc' table) have been updated with default values. Please verify if necessary.
OK
[root@db lib]#

以下還有更多MySQL數據庫問題的解決方法▼

希望陳溈亮博客( https://www.chenweiliang.com/ ) 分享的《解決警告:數據庫錯誤Column count of mysql.proc is wrong.》,對您有幫助。

歡迎分享本文鏈接:https://www.chenweiliang.com/cwl-1096.html

歡迎加入陳溈亮博客的Telegram 頻道,獲取最新更新!

🔔 率先在頻道置頂目錄獲取寶貴的《ChatGPT 內容行銷AI 工具使用指南》! 🌟
📚 這份指南蘊含價值巨大,🌟難逢的機遇,切勿錯失良機! ⏰⌛💨
喜歡就分享和按贊!
您的分享和按贊,是我們持續的動力!

 

發表評論

您的電子郵箱地址不會被公開。 必填項已用 * 標註

滾動到頂部