原 关于MySQL配置数据库密码出错和进入数据库时#3167错误问题解决办法
2697 | 1 | 0
应该有很多人跟我一样在配置MySQL数据库时密码出错,
提示:
”MySQL 服务无法启动,服务没有报告任何错误,请键入 NET HELPMSG 3534
以获得更多的帮助。”
然后我们可以输入:
mysqld --initialize-insecure自动生成无密码的root用户,
再输入mysqld --initialize
自动生成带随机密码的root用户。
data文件夹不为空是不能执行这个命令的,然后我们就可以成功配置了。
但是有的人在登陆MySQL提示SQL执行错误#3167,这时候我们就需要进入cmd,
以下转自http://blog.csdn.net/xcmonline/article/details/50441330
--从mysql5.7.6开始information_schema.global_status已经开始被舍弃,为了兼容性,此时需要打开 show_compatibility_56
MySQL> select * from information_schema.global_status limit 3;
ERROR 3167 (HY000): The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled; see the documentation for 'show_compatibility_56'
--查看show_compatibility_56其值
mysql> show variables like '%show_compatibility_56%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| show_compatibility_56 | OFF |
+-----------------------+-------+
1 row in set (0.01 sec)
--把show_compatibility_56打开
mysql> set global show_compatibility_56=on;
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like '%show_compatibility_56%';
+-----------------------+-------+
| Variable_name | Value |
+-----------------------+-------+
| show_compatibility_56 | ON |
+-----------------------+-------+
1 row in set (0.00 sec)
mysql> select * from information_schema.global_status limit 3;
+-----------------------+----------------+
| VARIABLE_NAME | VARIABLE_VALUE |
+-----------------------+----------------+
| ABORTED_CLIENTS | 0 |
| ABORTED_CONNECTS | 0 |
| BINLOG_CACHE_DISK_USE | 0 |
+-----------------------+----------------+
3 rows in set, 1 warning (0.00 sec)
0
239****@qq.com 2017-05-14 14:52:20
138****6482
0人已关注
领课教育 29749
7932
update 44183
3695
领课教育 16318
husheng 19444
请更新代码 40301
凯哥Java 864
凯哥Java 971
凯哥Java 696