PHPMyadmin不显示mysql错误消息 [英] PHPMyadmin does not show mysql error messages
问题描述
我在自己的网站上安装了phpMyAdmin,并且可以正常工作.但是当我输入错误的查询时,它不会仅显示错误代码,而不会显示mysql错误消息.
I installed phpMyAdmin on my site and it works. But when I mistype a query it does not show the mysql error message only the error code.
1064-
我希望以下几点:
1064-你有错,等等...
1064 - You have and error in your blah blah...
没有错误消息,很难知道出了什么问题.
Without an error message it's difficult to know what's wrong.
在我的PHP脚本中,我能够通过mysql_error()得到错误消息.但是myAdmin什么也没显示.
In my php scripts I'm able to get the error message via mysql_error(). But myAdmin shows nothing.
我在Google上搜索了很多,但没有发现有用的东西.
I googled a lot but I didn't find anything useful.
如何显示错误消息?
有什么想法吗?
推荐答案
从您获得#1064-"作为输出的事实来看,我只能在phpMyAdmin 3.3.9.2源代码中找到两个可能出错的地方.发生.第一个是对mysql_error
或mysqli_error
的调用,具体取决于安装所使用的后端.我看到你说mysql_error
正常工作;如果您在首次登录时看到的phpMyAdmin信息页面指示正在使用mysqli,则您可能也要进行检查.
Judging by the fact that you get "#1064 -" as output, I can find only two places in the phpMyAdmin 3.3.9.2 source where the error could be occurring. The first is in the call to mysql_error
or mysqli_error
, depending on which backend your installation is using. I see you said that mysql_error
works fine; if the phpMyAdmin information page you get when first logging in indicates that mysqli is being used, you might want to check that too.
但是,如果mysql_error起作用,则问题似乎更可能出在library/database_interface.lib.php中的phpMyAdmin的字符集转换函数PMA_DBI_convert_message
中.您可以通过在该函数的顶部插入return $message;
来绕过其中的所有其他内容,从而很容易地确认这一点.如果这样(或多或少)有效,您可能想要确定$server_language
和$GLOBALS['charset']
设置为什么;查看转换是否使用iconv
,recode_string
,libiconv
或mb_convert_encoding
;然后尝试找出其中任何一个未能正确转换错误消息的原因.
But if mysql_error works, it seems more likely that the problem is in phpMyAdmin's character set conversion function PMA_DBI_convert_message
in libraries/database_interface.lib.php. You can confirm this easily enough by inserting return $message;
at the very top of that function, bypassing everything else in there. If that makes it (more or less) work, you'd probably want to determine what $server_language
and $GLOBALS['charset']
are getting set to; see if the conversion is using iconv
, recode_string
, libiconv
, or mb_convert_encoding
; and then try to work out why whichever of those is failing to convert the error message properly.
这篇关于PHPMyadmin不显示mysql错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!