I have a problem my project made in vb2008 .net and using 32bit proccessor architecture and using mysql as a back end. And mysql.data and mysql odbc connector. In 32 bit architecture my system is working very well. But when i deploy it in 64bit i cant connect to database.. but i can open the database using the mysql administrator or mysql browser. And i got error "the type initializer for threw an exception" this is when checking if the connection state is close. Please help me.. sorry for bad english
Related
Ok, I've spent all day on this, and I am stuck, so I'm going to ask for help.
I previously installed Delphi 11 Enterprise in a virtual machine, and also installed MySQL 8.0.27 (64-bit). After obtaining some 32-bit MySQL dlls I was able to easily connect to my database using the FireDAC MySQL driver and from the Data Explorer in the Delphi IDE.
I have now created a new VM and installed both Delphi 11.1 Enterprise and MySQL 8.0.28. After exporting my database from the previous VM, and importing it into this new MySQL server, I tried to attach to the database using FireDAC. Using the same parameters as in the last VM, and the same dlls copied to C:\Windows\SysWOW64, testing the connection fails and produces the following error:
[FireDAC][Phys][MySQL] SSL connection error: unknown error number
I've compared the parameters for connecting to the two databases between the two VMs, and they are the same. And, the connections in MySQL to the two databases also appear to be the same.
One thing that is odd (and I think I know why) is that in the VM where the connection fails, if I view the Info tab of the FireDAC Connection Editor, it says it is using libmysql.dll in the c:\Windows\System32 folder (there's no such file in that folder). But that is also true from the Connection Editor in the VM where FireDAC successfully connects, so I am assuming that System32 is being mapped to C:\Windows\SysWOW64.
If anyone can affirm that they are successfully connecting to MySQL 8... using Delphi 11.1 and FireDAC, and can offer a suggestion for what I need to fix, I will be grateful.
= = = = = = = = = = = = == = = = = = = = =
Update: I've uninstalled MySQL 8.0.28, and reinstalled it using the Development Computer template. I still cannot connect to MySQL using the FireDAC Connection Editor, but I can connect at runtime so long as I employ an FDPhysMySQLDriverLink component, and set the VendorLib property to either libmariadb.dll or libmysql.dll, the 32-bit versions that are stored in the C:\Windows\SysWOW64 folder (thanks Ian Barker for your sample code!). I'm still working on this, since I really want to connect from the IDE, but at least I've had some success.
I have had the same issue today, as part of a whole batch of problems with mysql not running so I updated it and then hit the error above.
My 64 bit Delphi 10.3 Programs would not connect at all - so I changed the physical driver to libmariadb.dll and that has resolved the issue.
Be sure from where your app is loading the libmysql.dll by calling h:= loadlibray('libmysql.dll') /without path/ and then GetModulePath(h) to see its full path.
Remember that Delphi is 32bit and it needs to use 32bit version of lobmysql.dll while a 64bit compiled program would need the same bitbness.
This was nuts. I installed and uninstalled MySQL (and MySQL Workbench and MySQL Script) probably 10 times. The last install worked. I have no idea why this was necessary.
I'm getting errors while trying to access an Oracle view through an SSIS package. First, since, I'm running 64-bit windows, I installed the 64-bit Oracle 12c Client. But when I tested the connection I got this error:
Test connection failed because of an error in initializing provider. Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
Then I tried installing the 32-bit Oracle 12c Client but got another, different error.
Test connection failed because of an error in initializing provider. ORA-12154: TNS:could not resolve the connect identifier specified
Lastly I tried installing both clients together but the last error persisted. Not sure what's going on here...
The first error comes from the fact that Visual studio is 32 bit and it's trying to use 32 bit drivers by default. You can change the runtime settings like this: https://stackoverflow.com/a/28235255/5605866
The second error might refer to tnsnames.ora file not having all the settings correctly, like in here: https://stackoverflow.com/a/40399744/5605866
I get the following different error when trying to use MS SQL SERVER native connection with Use Integrated Security box checked.
Error connecting to database [Kettle_ETL native] : org.pentaho.di.core.exception.KettleDatabaseException: Error occurred while trying to connect to the database
Driver class com.microsoft.sqlserver.jdbc.SQLServerDriver could not be found, make sure the 'MS SQL Server (Native)' driver (jar file) is installed. com.microsoft.sqlserver.jdbc.SQLServerDriver
Using Pentaho Spoon version 5.3 on a Windows 64-bit machine with jre1.8.0_45 installed, I copied the sqljdbc_auth.dll (x64 version) and sqljdbc41.jar files to the /data-integration/lib folder and removed the existing sqljdbc.jar file.
Any insight into this error would be greatly appreciated.
The sqljdbc_auth.dll should be copied into the data-integration\libswt\win64 directory.
Even if you are on a 64 bit machine, it's possible that Java/PDI is running in 32 bit, so ot's advisable to also add the 32 bit version of the sqljdbc_auth.dll into the data-integration\libswt\win32 directory.
Am trying to connect to a db (actually am put on an already built project :) ) . The code was connecting ok but after a windows issue and restroring, the following error shows up each time a DB connection is attempted.
Activation error occured while trying to get instance of type Database, key "core_erp" ..
have installed mysql .net connector but the error still shows up.
As said that the project is already built but when the code was ported to this computer, the issue started to show up (reason to tell this is that the issue is not in the code rather possibly on the configurations)
any help appreciated.
USING MYSQL, ENT.LIBRARY , WCF, ASP.Net MVC-3
issue solved by installing the newer MYSQL .net connector (6.8.3).
hope this helps someone else :)
I am using MYSQL and EF5(DB first) with connector/net 6.8.3.0. Everything works fine on my local machine but when I upload it to server it throws exception "Facet 'Precision' must not be specified for type 'datetime'".
Please let me know what is the reason.
Precision for datetime is added with MYSQL version 5.6 and I have generated the entities with latest MYSQL, so by default precision is added to the ssdl.
But on my server older version of MYSQL server was installed. This is the reason why it was throwing the exception.
Now with MYSQL server 5.6 we can have datetime(5) where 5 is the precision.
So we can have microsecond for datetime in MYSQL.
I too have been getting the "Facet 'Precision' must not be specified for type 'datetime'" error after publishing, but the cause of my problem differs from the OP's.
My Personal Solution
I have two independent servers: 'server1' with the EF5 web app, 'server2' with the database server1 references. Debugging the app on my local machine was no problem; but after I published to server1 the app kept crashing while trying to load. After much searching and testing I narrowed it down to either a configuration issue either with my application or MySQL. Finding this post (thank you kindly, user3275493, for answering your own question), I checked server2's MySQL config but alas it was already running MySQL Server 5.6. Just to be thorough (in reality this took me several days to realize), I decided to check MySQL Connecter and discovered that my local machine's was version 6.8.3 while server1's was version 5.6. After I updated Connector, I published my web app and it ran without flaw!
Simple Explanation
Not only will this error be caused by a MySQL version disagreement between Entity Framework and MySQL Server, but also between Entity Framework and MySQL Connector!