unable to create connection to mysql from C++Builder - mysql

I have C++Builder Community Edition. I am trying to create a connection from a blank project to mysql server. When I do a test, after supplying the right username and password, I get this error message:
Error: [FireDAC][Phys][MySQL]-314. Cannot load vendor library [libmysql.dll, libmariadb or libmysqld.dll]. The specified module could not be found
I was under the impression that one of the selling points of C++Builder is how easy to create a Windows form for database programming?

It is Relatively easy! However you do need to read the docs and understand how FireDac works with C++ Builder/Delphi. One big consideration is the correct bitness of your executable, x86/x64, and which client libs you have on your machine?
If it is x86 then you can use the FireDAC Explorer from within the IDE to get connected, if you have set up the connection definitions correctly and, as Spektre wrote, have MySQL running locally, it will connect? The community version only supports local connections.
Specifically you need to ensure that the MySQL connection definition or string contains all the needed entries. If you're using Windows look in the file located at C:\Users\Public\Documents\Embarcadero\Studio\FireDAC\FDConnectionDefs.ini and make sure it is setup with the proper information.
Read the docs to see how FireDAC uses connection definition files and/or strings. It does take a little effort to get it all working together so you have to be willing to learn it! If after doing some of this, post again with what you've found and be specific and you may find people be willing to help you more.
Embarcadero FireDAC Docs

Related

Creating custom MySQL servers in VB.NET at runtime

I was wondering if it is possible to create custom MySQL servers in VB.NET while working in visual studio at runtime so that if the server already exists it connects and if it isn't there, the code creates the server. I have searched for this everywhere but couldn't find anything. I would appreciate it a lot if someone guides me to the right path.
You could certainly write some .net code to start a MySQL server on your Windows box when an attempt to connect fails. You simply get a cmd.exe console with administrator privileges and give the command net start mysql.
But MySQL must already be installed on the box for that to work.
You might investigate Sqlite. It provides SQL locally to a .net program, storing your tables in a file called whatever.db. It has very similar .net API access to MySQL's Connector/Net and SQL Server's connector. It's in a NuGet package.
I don't completely understand your "custom MySQL servers" requirement. Sqlite gives you a way to use SQL in your application without connecting to a shared server. That may do what you need.
MySQL does have a CREATE SERVER statement in its SQL dialect. The purpose of this statement is to create a connection to another, remote, MySQL server. With that connection you can use the FEDERATED storage engine to access tables in the remote server. Of course, there is no way to run this CREATE SERVER statement unless your program is already connected to a MySQL server.
With respect, your "task which states to create a server at runtime" doesn't make much sense. Is there more to this requirement? What workflow needs this step? Is it part of the installation of some application software on a new box?

When do I use libmysql-6.1.dll vs libmysql.dll?

I'm using HeidiSQL to edit a MYSQL database, and it's asking which library I want to use for the edits:
libmysql-6.1.dll
libmysql.dll
How do I know which one to use?
These alternative libmysql*.dll and libmariadb*.dll libraries are there to solve (SSL) connectivity issues on newer MySQL and MariaDB servers. For example on MySQL 5.7, some users reported the following error with the older libmysql.dll:
ASN: bad other signature confirmation
Using libmariadb.dll may cause another error:
Unknown SSL error (0x80090308)
Especially when you provide a SSL certificate, you may run into such issues.
For this and any other connectivity issue, HeidiSQL provides alternative libraries the user can try. Apart from that, I never heard of any other advantage or disadvantage of one or another of these libraries.
While the question of which library to use for MariaDB seems pretty obvious (libmariadb.dll), what to make of the other two?
As a clue, I looked a the file properties.
libmysql.dll shows ProductVersion 5.6.6.0
libmysql-6.1.dll shows ProductVersion 6.1.11.0
Given that these files are included in HeidiSql v11.3, I concluded they are NOT generated by building HeidiSql. So, where did those version numbers come from?
Poking around in C:\Program Files\MySQL\MySQL Server 8.0\lib, I see a libmysql.dll there too (ProductVersion 8.0.25).
So, my guess is that HeidiSql acquired those files from builds of MySQL. And the newer one (libmysql-6.1.dll) is probably the better bet for current releases of MySQL.
That does leave open the question of where the number "6.1" came from. It doesn't appear there was ever a 6.1 release of MySQL?
And it also doesn't address which one is best for MSSQL, PostgreSQL, etc. But that wasn't the question here.

How do I migrate a SQLAnywhere 9 db running in a remote server into a mysql server on my machine?

I am working at a company that has some CRM software running in a remote Windows XP server that uses a SQLAnywhere 9 db to store its data; I have access to this remote server with an administrator account.
I would like to extract the db into a .sql file so that I can run the db locally on my machine without affecting the running db in the server (since it is key for the company's day to day operation).
The reason I need this is that we are going to test some BI Software and we need data from this database to test it, but we don't know the structure of the database since the developers of the CRM software didn't give us any documentation on it. So we need to have the database locally so that, without affecting the running CRM, we can:
understand the structure by looking at the DDL
make queries to it to get sample data
I researched a bit, and the most common solution to my problem was to use dbunload on the remote server to unload the db into a reload.sql file that contained what I needed. But most tutorials on the subject mention that I have to stop the db first (which would be catastrophic). If this is the only option, then I guess I am willing to do it on the weekend when the CRM is not used, but I wanted to know if there was another solution first.
If there is no other solution, can you point me to where I can find the proper and safer way to do this?
I have researched a lot, but prior to this day I have never even heard of SQLAnywhere, so I really need all the help I can get. My main concern is doing something that impacts negatively the CRM software.
Thank you.
You can run dbunload across the network, you just have to tell it to do an "external" unload. The default is to do an internal unload which would only work from the machine where the database server is running.
I don't have SQL Anywhere 9 documentation right now to look up the exact switch, but dbunload -? should show you all the possible switches.
Edit:
-an will create a new database and load the data and schema from another data
-xi switch will do external unload and internal reload.
-c parameters to connect to your remote database

ODBC-ODBC bridge

I have a mysql db running on one linux server.
With an odbc connection for a web server on another linux box.
I would like to be able to use the/an odbc connection to the web server, to access mysql. This would be for an external app that is running on client machines.
I have done some googling, and there might be something called an ODBC-ODBC bridge.
I would like to just get a correct direction to go. So I don't head in the wrong direction.
If someone could point me at a specific bridge software. Or a tutorial. Or if this is even possible, and bridge is the correct thing to look for. etc...
thanks
Your post seems rather confused as to what ODBC is/does.
You have a webserver, you have a database. ODBC wil not join them together. You need something to implement your code with on the webserver - PHP, Perl, Ruby, Python, Java, C....
Bindings are available for most languages to talk to the ODBC client - which typically talks using the databases native protocol to the DBMS. However:
1) ODBC is somewhat constrained in its functionality - since it has to offer the lowest common denominator of functionality across a range of backends
2) all the languages I've listed (and more besides) support native (i.e. full function) connections to MySQL, and to other DBMS
Which rather begs the question, why do you want to to use ODBC?
There are instances where an ODBC-ODBC bridge solves a specific problem - where a DBMS provides an ODBC interface which is not supported on your client. This does not appear to be your problem.
Is your objective here to get the data from the database presented via the webserver or is to build something (anything) using ODBC?
If it's the former then forget about ODBC - it's irrelevant.
your webserver should have odbc connection to connect to MySQL database, and yes that you have. and when you do have that connectivity, I guess you won't really need your clients to connect to the MySQL database directly. because whatever query you want to run (an insert, or query operation), you just submit it to the webserver and it'll give fetch the query results for you.

How do I setup my MySQL with Eclipse IDE?

I am using Eclipse EE IDE and I am using the MySql Connector/J driver. How do I set up a properties file with all the information(DB URL, DBusername,etc) Also I see that you need a DBname and DBurl for the properties file, How do I determine/create this name for the database. I have already looked at the mysql website for this and am still having trouble, if somebody could pleasee help me I would appreciate it.
Solution: I was able to get it working through the plugin available with Eclipse, but I soon realized this limited me with the use of my Tomcat server, so I re organized my directories and set up Tomcat to use with my Eclipse and also be available to other resources.
Eclipse doesn't use a database for anything, so even if you would create a properties file, it would ignore it.
If you're using the DB plugin, then you can use the UI to create a connection for the database. The wizard will ask for all the informations and save them somewhere (probably not as a property file).
If you need the database in your own project, then you must define the format of the property file yourself, read it at startup, and use the information to create a datasource.
You should use phpMyAdmin, or MySQL GUI tools for MySQL setup and management