【MySQL】MySQL 5.7 error和warnings无具体信息显示

【问题描述】:


版本:MySQL 5.7.18 
安装方式:二进制值包解压后直接初始化
现象:只有错误代码,无错误详情,通过show errors和show warings都无法获取message。


  1. mysql> USE ccadacdasc;
  2. ERROR 1049 (42000): Unknown error 1049
  3. mysql> SHOW ERRORS;
  4. +-------+------+----------+
  5. | Level | Code | Message  |
  6. +-------+------+----------+
  7. | Error | 1064 |          |
  8. +-------+------+----------+
  9. 1 row in set (0.00 sec)
  10. mysql> CREATE DATABASE mysql;
  11. ERROR 1007 (HY000): Unknown error 1007
  12. mysql> STOP SLAVE;
  13. Query OK, 0 rows affected, 1 warning (0.00 sec)
  14. mysql> SHOW WARNINGS;
  15. +-------+------+-----------+
  16. | Level | Code | Message   |
  17. +-------+------+-----------+
  18. | Note  | 3084 |           |
  19. +-------+------+-----------+
  20. 1 row in set (0.00 sec)


虽然不影响使用,也可以到文档手册去查询具体情况,但总归不方便。

检查错误日志发现:
2017-06-16T06:40:03.292520Z 0 [ERROR] Can't find error-message file '/data/mysql57/bin/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.

发现errmsg.sys找不到,并且发现在bin目录中查找。


【解决方案】:

检查配置文件发现:
# grep basedir my57.cnf 
basedir = /data/mysql57/bin

basedir指定的位置有误。修改一下:
basedir = /data/mysql57


重新启动,发现无报错。
再手工产生一些error和warning,已经可以正常产生信息了。

  1. mysql> STOP SLAVE;
  2. Query OK, 0 rows affected, 1 warning (0.00 sec)
  3. mysql> SHOW WARNINGS;
  4. +-------+------+--------------------------------------------------------------------------+
  5. | Level | Code | Message                                                                  |
  6. +-------+------+--------------------------------------------------------------------------+
  7. | Note  | 3084 | Replication thread(s) for channel '' are already stopped.                |
  8. +-------+------+--------------------------------------------------------------------------+
  9. 1 row in set (0.00 sec)
  10. mysql> fdsfas;
  11. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fdsfas' at line 1
  12. mysql> use afdasfds;
  13. ERROR 1049 (42000): Unknown database 'afdasfds'

原因:该实例启动时被指定错误了basedir导致无法找到errmsg.sys,所以无法显示具体error或warning的详情。
修正my.cnf重新启动mysqld即可。

这个文件在$basedir/share中存放名在此处为:
errmsg-utf8.txt 
errmsg-utf8.txt: UTF-8 Unicode Pascal program text, with very long lines
用于存储各类error和warning的详情。


这个问题目前只存在于MySQL 5.7等更高版本的MySQL中。

在MySQL 5.6版本中,若因为指定了错误的basedir,导致无法找到errmsg.sys时,在启动时就会报错:
2017-06-16 15:02:49 11234 [ERROR] Can't find messagefile '/data/mysql-base/mysql56/bin/share/errmsg.sys'

而在MySQL 5.7版本中,虽然在启动时会报错并记录在错误日志中,但mysqld仍然是可以起来的。



作者微信公众号(持续更新)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29773961/viewspace-2140844/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29773961/viewspace-2140844/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PowerCommands 1.1 is a set of useful extensions for the Visual Studio 2008 adding additional functionality to various areas of the IDE. The source code is included and requires the VS SDK for VS 2008 to allow modification of functionality or as a reference to create additional custom PowerCommand extensions. Below is a list of the included in PowerCommands for Visual Studio 2008 version 1.1. Refer to the Readme document for additional command details and screenshots. Enable/Disable PowerCommands in Options dialog This feature allows you to select which commands to enable in the Visual Studio IDE. Point to the Tools menu, then click Options. Expand the PowerCommands options, then click Commands. Check the commands you would like to enable. Note: All power commands are initially defaulted Enabled. Format document on save / Remove and Sort Usings on save The Format document on save option formats the tabs, spaces, and so on of the document being saved. It is equivalent to pointing to the Edit menu, clicking Advanced, and then clicking Format Document. The Remove and sort usings option removes unused using statements and sorts the remaining using statements in the document being saved. Note: The Remove and sort usings option is only available for C# documents. Note: Format document on save and Remove and sort usings both are initially defaulted OFF. Clear All Panes This command clears all output panes. It can be executed from the button on the toolbar of the Output window. Copy Path This command copies the full path of the currently selected item to the clipboard. It can be executed by right-clicking one of these nodes in the Solution Explorer: The solution node; A project node; Any project item node; Any folder. Email CodeSnippet To email the lines of text you select in the code editor, right-click anywhere in the editor and then click Email CodeSnippet. Insert Guid Attribute This command adds a Guid attribute to a selected class. From the code editor, right-c

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值