关闭 iODBC 跟踪
我在 OS X 10.6.8 上使用我正在编写的 C 程序中的 MySQL (mysql-connector-odbc-5.1.8) 上的 iODBC,但跟踪所有 ODBC 库调用,这应该被关闭默认是开启的。
我在 /etc
和 /Library/ODBC/
中找到了一组 odbc.ini
和 odbcinst.ini
文件code>,但它们都不包含“Trace = yes”,并且向这些文件中的任何一个添加带有“Tracing = no”的 [ODBC]
部分似乎没有执行任何操作。我的工作目录、我的主目录或其他任何地方也没有任何私有 .odbc.ini
或 .odbcinst.ini
文件。
我可以关闭跟踪的唯一方法是在分配连接句柄后调用SQLSetConnectAttr()
将SQL_ATTR_TRACE
设置为SQL_OPT_TRACE_OFF
,但此时,跟踪文件 sql.log
已在工作目录中创建。
任何有关跟踪跟踪打开位置(默认情况下应该关闭)的帮助,或者如何将其关闭以便永远不会创建日志文件,将不胜感激。
I'm using iODBC on OS X 10.6.8 agains MySQL (mysql-connector-odbc-5.1.8) from a C program that I'm writing, but tracing of all ODBC library calls, which is supposed to be turned off by default, is turned on.
I have found a set of odbc.ini
and odbcinst.ini
files in /etc
and in /Library/ODBC/
, but none of them contains "Trace = yes", and adding an [ODBC]
section with "Tracing = no" to any of these files doesn't seem to do anything. I also do not have any private .odbc.ini
or .odbcinst.ini
files in the working directory nor in my home directory nor anywhere else.
The only way I can turn tracing off is to call SQLSetConnectAttr()
to set SQL_ATTR_TRACE
to SQL_OPT_TRACE_OFF
after allocating a connection handle, but at that point, the trace file, sql.log
, has already been created in the working directory.
Any help with tracking down where tracing is turned on (it's supposed to be off by default), alternatively, how to turn it off so that the log file never gets created, would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定为什么您要使用 odbc 而不是标准连接器,但是您是否尝试过在 odbc.ini 中将 TraceFile 的选项设置为 /dev/null 。如果您无法让 Trace = OFF 自行工作,这至少可以删除该文件。
办公室里没有我的 Mac 来测试这个,但看起来它应该可以工作。
I'm not sure why you would be using odbc instead of the standard connector, but have you tried setting the option for the TraceFile to /dev/null in odbc.ini. This may at least remove the file if you can't get the Trace = OFF to work by itself.
Don't have my Mac at the office to test this, but seems like it should work.
Mac OS X 上 ODBC 的默认设置文件位于 --
前两个用于系统级设置和 DSN;后者用于用户级别。
一些有缺陷的安装程序和库会在 -- 这些位置创建文件,
这可能会导致麻烦。此命令将显示所有潜在的麻烦文件 -
最好的方法是 -
(Ob免责声明:我是 OpenLink Software 的员工,负责维护和支持 iODBC 项目,这是 Apple 选择用于 Mac OS X 的 ODBC 驱动程序管理器,自 Jaguar (10.2.x) 起捆绑。)
The default settings files for ODBC on Mac OS X are found at --
The first two are for system-level settings and DSNs; the latter are for user-level.
Some buggy installers and libraries create files at --
These can lead to trouble. This command will reveal all potentially trouble-making files --
Best is to --
(ObDisclaimer: I am an employee of OpenLink Software, who maintain and support the iODBC project, which is the ODBC Driver Manager chosen by Apple for Mac OS X, bundled since Jaguar (10.2.x).)