MySQL报错ERROR 1558 (HY000): Column count of mysql.user is wrong.
1.今天在使用MySQL创建数据库时出现如下报错:
mysql> CREATE USER 'dev'@'%' IDENTIFIED BY '';
ERROR (HY000): Column count of mysql.user is wrong. Expected , found . Created with MySQL , now running . Please use mysql_upgrade to fix this error.
2.解决方法
出现这个错误主要是因为我升级了数据库没有使用过,使用如下命令即可:
[root@vm172--- ~]# 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.再次创建数据库
mysql> CREATE USER 'dev'@'%' IDENTIFIED BY '';
Query OK, rows affected (0.00 sec)
发现成功创建!
随机推荐
BZOJ 2743: [HEOI2012]采花
2743: [HEOI2012]采花 Time Limit: 15 Sec Memory Limit: 128 MBSubmit: 2056 Solved: 1059[Submit][Status ...
[刘阳Java]_什么是MyBatis_第1讲
1.什么MyBatis,我们先通过百度百科先进行一个简单的了解 MyBatis 本是apache的一个开源项目iBatis, 2010年这个项目由apache software foundation ...
深入理解计算机系统(4.1)---X86的孪生兄弟,Y86指令体系结构
引言 各位猿友们好,计算机系统系列很久没更新了,实在是抱歉之极.新的一年,为了给计算机系统系列添加一些新的元素,LZ将其更改为书的原名.这本书非常厚,而且难度较高,L ...
gulp的常用api
gulp是什么? http://gulpjs.com/ 相信你会明白的! 与著名的构建工具grunt相比,有什么优势呢? 易于使用,代码优于配置 高效,不会产生过多的中间文件,减少I/O压力 易于学习 ...
c语言,数据类型转换
在执行算术运算时,计算机比C语言的限制更多.为了让计算机执行算术运算,通常要求操作数有相同的大小(即位的数量相同),并且要求存储的方式也相同.计算机可能可以直接将两个16位整数相加,但是不能直接将16 ...
TP5 中实现支付宝支付 利用model层调用支付宝类库
《C++ Primer Plus 第6版》学习笔记
第三章.基本数据类型 整形 short:至少16位 int:至少与short一样长 long:至少32位,且至少与int一样长 long long:至少64位,且至少与long一样长 字符类型 cha ...
puttygen 命令行 id_rsa.pub 转 ppk
网上只有puttygen GUI程序的说明,我是linux下的环境,懒得切换到win下了,putty 也有linux版本的,不过可用软件会少点,且GUI会没win下完善. 其实 一条命令搞定: put ...
python基本数据类型之列表和元组
python基本数据类型之列表与元组 python中list与tuple都是可以遍历类型.不同的是,list是可以修改的,而元组属于不可变类型,不能修改. 列表和元组中的元素可以是任意类型,并且同一个 ...
sql server 小技巧(2) 删除sql server中重复的数据
with list_numbers as ( select Name, AuthorOrTime, Url, Price, EstimatePrice, Size, Category, ROW_NUM ...