中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

ERROR 3009 (HY000) : Column count of mysql.user is wrong

2018-07-02    來源:importnew

容器云強勢上線!快速搭建集群,上萬Linux鏡像隨意使用

在測試備份還原時,使用XtraBackup還原數(shù)據(jù)庫后,創(chuàng)建一個測試賬號時遇到了下面錯誤:?

mysql> grant all on house.* to test@'192.168.%' identified by 'test1249';

ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 43. Created with MySQL 50620, now running 50721. Please use mysql_upgrade to fix this error.

mysql>

因為備份的數(shù)據(jù)庫版本為MySQL 5.6.20,目標數(shù)據(jù)庫的MySQL版本為5.7.21,因為兩個數(shù)據(jù)庫版本不一致,在還原過后,忘記升級數(shù)據(jù)庫(還原后沒有使用mysql_upgrade升級數(shù)據(jù)結(jié)構(gòu))。其實從錯誤信息也能看出一二,需要執(zhí)行mysql_upgrade命令會檢查所有數(shù)據(jù)庫中的所有表與當前版本的MySQL服務(wù)器是否不兼容。 mysql_upgrade還會升級系統(tǒng)表,以便你可以使用一些新特性或功能。

# mysql_upgrade -u root -p
Enter password: 
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv OK
mysql.db OK
mysql.db_database_info OK
mysql.db_instance_info OK
mysql.db_server_info OK
mysql.engine_cost OK
......................................................
......................................................
Upgrade process completed successfully.
Checking if update is needed.

關(guān)于mysql_upgrade的官方介紹如下,具體細節(jié)參考“4.4.7 mysql_upgrade — Check and Upgrade MySQL Tables”:

mysql_upgrade examines all tables in all databases for incompatibilities with the current version of MySQL Server. mysql_upgrade also upgrades the system tables so that you can take advantage of new privileges or capabilities that might have been added.

If mysql_upgrade finds that a table has a possible incompatibility, it performs a table check and, if problems are found, attempts a table repair. If the table cannot be repaired, see Section 2.11.3, “Rebuilding or Repairing Tables or Indexes” for manual table repair strategies.

You should execute mysql_upgrade each time you upgrade MySQL.

參考資料:

  • https://dev.mysql.com/doc/refman/5.7/en/mysql-upgrade.html

標簽: Mysql 服務(wù)器 數(shù)據(jù)庫

版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請與原作者聯(lián)系。

上一篇:JVM堆內(nèi)存使用率持續(xù)上升的一種排查思路

下一篇:RocketMQ 源碼學習 1 : 整體結(jié)構(gòu)