Front end developers must read! Starting from scratch, teach you to build a low code website platform in stages>>>
MySQL error 1558 (HY000): column count of mysql.user is wrong
1. The following error was reported when creating database with MySQL today:
mysql> CREATE USER 'dev'@'%' IDENTIFIED BY '123456';
ERROR 1558 (HY000): Column count of mysql.user is wrong. Expected 43, found 42. Created with MySQL 50560, now running 50643. Please use mysql_upgrade to fix this error.
2. Solutions
The main reason for this error is that I upgraded the database and did not use it. Just use the following command:
[root@vm172-31-0-6 ~]# mysql_upgrade -u root -p
Enter password:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log 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.proxies_priv OK
mysql.servers OK
mysql.slow_log 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
Running 'mysql_fix_privilege_tables'...
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.
OK
3. Create the database again
mysql> CREATE USER 'dev'@'%' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.00 sec)
Discovery successfully created
Similar Posts:
- MySQL he server quit without updating PID file [How to Solve]
- mysql ERROR 1044 (42000): Access denied for user ‘
- ERROR 1044 (42000): Access denied for user ‘root’@’localhost’
- [Solved] MYSQL8 Error: ERROR 2003 (HY000): Can’t connect to MySQL server on ‘localhost’ (10061)
- ERROR 1040 (08004): Too many connections
- [Solved] Error 1054 (42s22) unknown column ‘password’ in ‘field list’ when updating the password of mysql5.7 or above
- [Solved] ERROR 1805 (HY000): Column count of mysql.user is wrong. Expected 45, found 42. The table is probably corrupted
- Mysqldump backup problems got error: 1045, error 1045 (28000), got error: 1449
- NodeJS Connect MYSQL Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
- How to solve the error of PHP connection to mysql8