Connector/Net reference not found - mysql

I'm getting this error message
BC30002: Type 'MySql.Data.MySqlClient.MySqlConnection' is not defined.
However, there is a MySql.Data.dll file within Bin and there is a reference to it in web.config. It is imported in the aspx.vb file too.
I should add that when running locally through Visual Studio this application works fine - all I've done is copied the files to a remote server and this message comes up
Does anyone have any ideas?

If you're using Mysql Connector you should reference to the same version of mysql connector dll file which is installed on remote computer.

Related

Error while attempt to connect to MySQL server from Delphi Windows application

I see that this has been a problem for many users, way back. I have read and tried most of the tips from these questions and answers without success. My connection works well on the development PC ("devPC"). The problem starts when I attempt to run it on a PC without Delphi installed. I think the problem is that it looks for libmysql.dll in the same directory as it was found on devPC. I have put this libmysql.dll in the same folder as the EXE file and also have the INI files for FireDac there. Anyone who knows how I get the the program to look for this .DLL at the right folder? Can I change this somewhere? The error message is:
Loading driver MySQL ...
Error: [FireDAC][Phys][MySQL]-314. Cannot load vendor library
[C:\Users\sjubu\Documents\Embarcadero\Studio\Projects\Win32\Debug\libmysql.dll]. The specified module was not found.
Hint: check it is in the PATH or application EXE directories, and has x86 bitness.

Could not load file or assembly MySql.data error when invoking VB.net application

I made an application in Visual Studio 2013 using VB.net that works with my MySql database.
the program compiles and runs well when invoked through visual studio. However, when I run the application in the debug folder, I get the following error.
I have.
copied the MySql.data dll to the C:\Windows\Microsoft.NET\assembly\GAC_MSIL\MySql.Data\v4.0_4.0.0.0__b77a5c561934e089
and referenced my project to that dll. -> Error does not go away.
i set local to true for this dll in VS -> Error does not go away.
Do you know how to solve this problem?
i had a similar problem. For your application to run, you need to install the MySQL DotNet Connector msi. here is the link https://dev.mysql.com/get/Downloads/Connector-Net/mysql-connector-net-6.9.8.msi. Download and install. Your application should now run ok

Release Management will not deploy to a SQL 2014 database

Using Microsoft's Release Management Server for Team Foundation Server 2013 v12.0.31101.0, I keep getting an error (included later). I can however successfully run the sqlpackage command from my local machine, the build server and the target SQL Server.
Steps taken:
I took the dll's and the sqlpackage.exe from C:\Program Files (x86)\Microsoft SQL Server\120\DAC\bin and copied them to a folder on my desktop
In Release Management, I created a new Tool with the command: sqlpackage.exe /Action:Publish /SourceFile:__FileName__ /TargetDatabaseName:__DatabaseName__ /TargetServerName:__ServerName__
I then added the dll's and the SqlPackage.exe from the folder I created a step earlier
Save and Close
I then created a new component which basically just wraps this tool (The Build Drop Location is a backslash to indicate the dacpac is at the root of the build folder)
I then selected the Tool I created and it filled in everything. I updated my release template to include and use the component
Putting the folder I created on any desktop, I can run the following command and it run just perfectly
sqlpackage.exe /Action:Publish /SourceFile:MyDatabase.dacpac /TargetDatabaseName:MyDatabase /TargetServerName:MyDatabaseServer
I did this from my local PC, the Build Server and the SQL Server itself, but when I use Release Management, I get the error.
Error:
An unexpected failure occurred: The type initializer for 'Microsoft.SqlServer.Dac.DacPackage' threw an exception..
Unhandled Exception: System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Dac.DacPackage' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.SqlServer.Dac.DacServices' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SqlSchemaModelStaticState' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.TransactSql.ScriptDom, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Update 1: I noticed on the error email from Release Management that the Target Server was my web server and not the SQL Server, even though the SQL Server was correctly named in the command. I checked the log on the web server and found the errors. I copied over my folder of dlls to the desktop and ran the script and voila, I was able to recreate the error. I checked the installed programs in Control Panel and noticed that the installed version of Transact-SQL ScriptDom was for 2012, version 11.0.2100.60. So I installed SSDT here. The installation failed because I don't have Visual Studio installed, but it still managed to install the 12.0.2000.8 versions of Transact-SQL ScriptDom and related dlls. When I ran the script again, it successfully published the database! However, when I tried to build from Release Management, I got a new error.
Publishing to database 'Logging' on server 'BYDWVCMNSQ01'.
Initializing deployment (Start)
Initializing deployment (Failed)
*** Could not deploy package.
Unable to connect to target server.
Update 2: So, I've confirmed the reason it was failing at this point was because the account that the build server was using did not have a login account to the SQL Server. I added the account and then granted it ddladmin and securityadmin privileges at the database I'm targeting. This yields a new error that I'm unable to create a new user, but at least I'm getting closer.
Final Update: I had to also grant sysadmin so the account could create a login. This allowed the deployment step in RM to succeed. This obviously is not the way I will leave it, I'll either use a publish profile or command flags to prevent the dacpac from being created with security objects and let it run with least privilege.
The issue of getting RM to deploy to SQL 2014 has been solved. The main issue was in my release template, I placed the DACPAC component inline with the rest of the build for my web server. This causes the DACPAC command to be run from the web server, and for that to work I had to install SSDT on the web server. I don't like this, and I'll probably rearrange my release template so that the web server and sql server are parallel, but nested under the same rollback.
On the server running the deploy, run procmon with a filter for the missing dll, then copy it into one of the folders it is looking in.
The correct way would be to install ssdt and the scriptdom bits (search for creating a headless ssdt build machine)
I had luck with this answer, switching from the old "SqlPackage" to the new one, I think it's some sort of confusion of related dll's:
To fix this issue, change the path to sqlpackage.exe to the new '140' version. The new path to sqlpackage.exe should be:
"%ProgramFiles(x86)%\Microsoft Visual Studio
14.0\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\140\SqlPackage.exe"

No suitable driver found for jdbc:mysql://db4free.net:3306/partnerdb

I am trying to create a sample Spring application with JPA (MySQL DB) and Tomcat 7.0.28 under Mac OSX platform. I placed mysql-connector-java-5.1.22 jar under WEB-INF/lib folder of the application. But when I start the app, I get error mentioned in the Title. I tried to put the same jar under Tomcat lib folder as well but getting the same error.
Same application when I deployed in Glassfish server with driver jar under domain/lib/ext folder, application works fine.
Note: Glassfish was also throwing the same error without putting the driver jar under domain/lib/ext folder.
Does this How to fix: "No suitable driver found for jdbc:mysql://localhost/dbname" error when using pools? help ? Please check the second answer if you are connecting through program.

Mysql Connector Net 6.0.4 Setup - Failed to open XML file?

Attempting to install 'MySQL Connect Net 6.0.4' on a WinXP machine for integration with Visual Studio 2008.
Near the end of the install process a error message appears that states:
'Failed to open XML file C:\Program Files\MySQL\MySQL Connect Net 6.0.4\svctag.xml,system error: -2147024786'
After this message the install process fails.
What is causing this error message?
The following MySQL bug report describes the error in more detail:
link text
I also tried installing on a Windows 2003 server and the same error resulted - so its probably a bug with version 6.0.4.
The workaround for now is to install 6.0.3.
6.0.3 was available by browsing to the University of Waterloo's FTP site:
link text
For me using 6.0.3 is not working either.
Using 6.0.3 you will probably get the following error when creating a dataset :
"Cannot load type with name 'MySql.Data.VisualStudio.StoredProcedureColumnEnumerator'."
If you just need new MySql connector 6.0.4 assemblies you can just copy them to another location before pressing the okay button on the error message. You will find the assemblies in
C:\Program Files\MySQL\MySQL Connector Net 6.0.4\Assemblies\
Assemblies are deleted by failed installer before quitting.