Installing mysql.data.mysqlclient using mysql connector but no bin folder? - mysql

I would like to connect to our remote mysql db using VB.NET but I'm having issues with installing a .dll file. I need to add mysql.data.mysqlclient reference but can't find bin folder containing .dll file. I did many google and stack overflow searches but haven't stumbled on any solutions.
I downloaded mysql connector
Unzipped it
Opened Visual Studio 2010 Express and created new project
Under solutions explorer, right clicked to add reference
Then browsed to unzipped mysql connector folder to find bin folder
This bin folder isn't anywhere to be found. I'm missing something, any help is appreciated.

You have to install the mysql connector to your machine. Then open your project, right click, and click 'add reference', find 'mysql.data' at the '.NET' tab.

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.

Connector/Net reference not found

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.

MySQL for Visual Studio 2015

For the last 12 hours I've tried to make the MySQL Database appear in Visual Studio 2015. I've downloaded the installer and installed everything. Since that didn't make anything appear in the list of new database connections (Tools > Connect to Database), I started to google. Most of the posts are pre 2013 though. (I also tried 2013 but no luck there either).
I've tried to install EntityFramework, MySql.data, MySql.Data.Entity and so on from the NuGet Package Manager. I've edited the app.config and the packages.config as seen from other tutorials.
But most of what I've read was just "Install and it should work".
Though the MySQL Connector/NET doesn't appear in the list when pressing "About Microsoft Visual Studio". (Should it? I saw someone else have it).
It is 1 am so I'm pretty tired right now.
Does it matter if I have the MySQL installation on a other hard drive? I later reinstalled it on the same hard drive but no difference.
Not sure if you are still searching for a solution to this question given it was asked 6 months ago.
If you are download: MySQL Installer (v5.7.12 # 2016-05-18)
Run the installer and add "MySQL for Visual Studio". Sometimes you have to remove and re add the package for it to work. Add the Connector/Net (v6.9.8 # 2016-05-18) if it is not installed.
The result is:
Download the Zip MySql for Windows and extract
Open your Solution/Project in Visual Studio and open project properties
Select references -> Add -> Browse (Downloaded file directory)
Open the top foldder e.g. 14.0v14 and select MySql.data.dll and add
Go to Form1.vb or Similar and Imports MySql.Data.MySqlClient
Enjoy!!!

Application does not connect to database when deployed on another computer

I built a qt application that connects and queries a database using mysql . it works perfectly fine on my development computer (the computer with Qt Creator on it). but when I deploy it using windeployqt.exe and run it on another computer it doesn't connect to the database for some odd reason.
Note that I do have a working database (mysql as well) on the other computer (the one that fails to connect to the database)
I'm not sure what to do, I tried using addLibraryPaths but it didn't work (I'm not even sure if I did it correctly).
I'm using :
mysql server 5.5.36
workbench 6.0
Qt Creator 5.4.0
I also tried looking into statically building my application but I failed to understand the procedures in doing so.
I would greatly appreciate it if any of you Qt gods could help with this.
i finally found the problem and solved it.
problem: for some reason the target computer wasnt recognizing or reading libmysql.dll in C:\Windows ,and thanks to #Marco i used db.LastError and got my application to display the error , it was "Driver not Loaded Driver not Loaded" which meant that there was something wrong with libmysql.dll (note i copied this dll from MySql folder installed on the target machine )
Solution : i had to copy libmysql.dll from my development machine and place it in C:\Windows on the target machine (i noticed that libmysql.dll on my target machine was smaller in size than the one i used on my development machine)
for some reason the program only operates when the libmysql.dll from the development machine is present in C:\Windows in the target machine
this solution should fix any "Driver not loaded" or "QMySQL driver not loaded "(etc) errors . thanks everyone for trying to help , thanks again #Macro
I assume you built your application in release mode instead of debug mode.
If you have libmysql.dll and qsqlmysql.dll alongside your executable. Create a directory/folder and name it sqldrivers. Place qsqlmysql.dll in the directory you created and deploy it alongside your executable.
PS: I didn't see nnb's comment earlier. I think he's saying the same thing as my answer
From the comment we have cleared that there is a problem loading the driver, I am confident that you have the put qsqlmysql.dll in the correct place, as you have used the deploying utility, so I suspect that the problem is qsqlmysql.dll needs another dll that cannot be found in the system path.
I suggest that you run this tool:
http://www.dependencywalker.com/ on the qsqlmysql.dll
That will help you finding out what is missing, when you find that out, you will probably have to modify the system path or to install a dll that is missing.
I know this thread is old, but I've been having the same issue, and the solution was very easy (once you know).
The problem is that when you execute your application inside Qt, it will find the needed dll to load the drivers (libmysql.dll) if you located it in the correct Qt folder (Qt/path_to_compiler/bin), in my case: C:\Qt\5.9.1\msvc2017_64\bin. But when you try to execute the deployed executable, it is not able to find it. You will notice that the problem is solved if you paste the dll in C:\Windows, as #Nelioussness said. But that's not the solution, as it won't work in a different computer.
Just go to MySQL installation folder and look for the file libmysql.dll if you didn't do it before. In my case, it was located in C:\Program Files\MySQL\MySQL Server 5.7\lib. Once you find it, copy it to your release folder, exactly at the same level as the executable. It didn't work for me when I put it inside 'sqldriver' folder and everything was solved by just putting it outside, next to the .exe
Hope this helps :)

Connect to MYSQL with VB.NET

I am trying to connect to a MYSQL database using VB.NET to handle some simple tasks at a page level. Usually the connections are made to a MYSQL database. I have downloaded a MYSQL-CONNECTOR 6.0.7. How do I reference or add this to my web project so that I can create the connection and use the provided methods?
In the unzipped package I download I do not see any dll files so not sure what to do with this ATM, I am used to seeing a bin folder which contains this. Maybe I have a bad download any suggestions?
If you downloaded the ZIP archive, then generally this is the source code distribution. You need to open MySQLClient.sln in Visual Studio and build the MySql.Data project to produce MySql.Data.dll in the bin folder.
the last version is 6.4.3 download from http://www.mysql.com/downloads/connector/net/ , add reference for the unzip folder and us it as sqlClient it has the same class only have to append My to the class name