简体   繁体   English

当使用32位版本的MySQL的.net连接器连接到64位版本的MySQL时,我得到“等待表元数据锁定”

[英]When using 32bit version of MySQL's .net connector to connect to a 64bit version of MySQL I get “ Waiting for table metadata lock ”

I have .net application that is compiled with 'AnyCPU' flag. 我有使用“ AnyCPU”标志编译的.net应用程序。 This application uses MySQL for persistent storage. 该应用程序使用MySQL进行持久存储。

I have run into a strange problem ie When I run my application on a 32 bit machine and hook it to 64 bit version of MySQL running on a different machine, my queries end up in state " Waiting for table metadata lock ". 我遇到了一个奇怪的问题,即当我在32位计算机上运行我的应用程序并将其挂接到运行在另一台计算机上的64位版本的MySQL时,我的查询最终处于“等待表元数据锁定”状态。

I have already tested that it works fine when both, my application and MySQL, are running on the same platform ie both on 32bit or both on 64bit. 我已经测试过,当我的应用程序和MySQL都在同一平台上运行时,即在32位或64位上均运行正常。

Here is my theory which can be totally wrong :) 这是我的理论,这可能是完全错误的:)

Since my application is loaded as 32 bit application, consequently the .net connector assembly (which I presume is compiled with 'anycpu') will be loaded as 32 bit as well. 由于我的应用程序是作为32位应用程序加载的,因此.net连接器程序集(我认为是用“ anycpu”编译的)也将也加载为32位。 My guess here is that something goes wrong when a 32bit .net connector communicates with 64bit MySQL. 我的猜测是,当32位.net连接器与64位MySQL通信时,出现了问题。

Is my theory correct? 我的理论正确吗?

a) If no, please let me know, what would be the easiest way to find out whats going wrong? a)如果否,请告诉我,找出问题所在的最简单方法是什么?

b) if yes, what can I do about it. b)如果是,我该怎么办。 The reason being I can't force the .net framework to load mysql's .net connector assembly in 64bit mode for my 32bit application. 原因是我无法为我的32位应用程序强制.net框架以64位模式加载mysql的.net连接器程序集。 Even if that was possible ( within the same process), how in the world am I going to know, before loading the connector, what type of MySQL will my application be connecting to ....? 即使有可能(在同一过程中),在加载连接器之前,我将如何知道我的应用程序将要连接到哪种类型的MySQL。

PS My gut feeling is that its highly unlikely that this theory is correct as according to Google, no else has encountered this problem before. PS我的直觉是,按照Google的说法,这种理论是正确的可能性很小,以前没有其他人遇到过这个问题。

This doesn't sound like it has anything to do with 64/32 bit from the error message given. 听起来这与给出的错误消息中的64/32位无关。

Have a look at this SO question and answer and see if that gives any clues: How do I find which transaction is causing a "Waiting for table metadata lock" state? 看看这个SO问题和答案,看看是否能提供任何线索: 如何找到哪个事务导致“等待表元数据锁定”状态?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM