I want to connect from Delphi to MySQL
downloaded mysql-connector-odbc-5.2.7-winx64.msi
Installed. I got Delphi XE, but this driver is not in the list in the "Create a new data source" list.
How to install it? Or somewhere to prescribe with pens, something you need?
2 answers
The fact is that you are using a 64-bit driver. And, Delphi both was, and now remained 32-bit. Therefore, Delphi and it does not "see."
The problem is usually solved by installing a 32-bit driver.
PS For version XE2 and above, this remark is also relevant. 64-bit there is, in fact, only a Win64 compiler. The IDE itself is still 32-bit and only sees 32-bit drivers.
- 2And you need to work with 32-bit drivers in a 64-bit system not from the control panel, but with pens starting
C:\Windows\SysWOW64\odbccad32.exe- kami - @kami, strange, but I do not have such a file in the OS. - I_CaR
- @Streletz, so how then to develop applications for 64-bit OSes? - I_CaR
It all depends on the target platform 32 whether 64 bits and the type of connection . If dbGo is used (TADOConnection) then for each (32/64) you need to install your ODBC Connector . And manually create a custom, file or system DSN by choosing MySQL driver accordingly. But the data provider still needs to choose Microsoft OLE DB Provider for ODBC!
But using DbExpress or FireDAC is not so straightforward. IDE can swear strongly with these words:
If you are a client, you can get the driver code.
or
[FireDAC] [Phys] [MySQL] = 314, Cannot load vendor library [libmysql.dll, or libmysqld.dll]. Cannot find the file specified.
The thing is that you need the appropriate library LIBMYSQL.DLL / LIBMYSQLD.DLL and the corresponding version for the server and especially for IDE! (for the latter - you need to see the version of \ bin \ dbxmys.dll). This can be viewed in detail in this video . And again - 32/64 bits. Put this file in any folder indicated in the system variable PATH. This is usually c: \ Windows \ system32 (or c: \ Windows \ syswow64). As a last resort - in \ bin of your IDE (but this is a moveton, IMHO) Then configure TSQLConnection.Driver (dbExpress) or TFDConnection.DriverName (FireDAC) and other necessary properties.
- For ADO (dbGo), the source must be created at least not in Delphi (it will not see the driver for x64). In other matters, this is stated above in the comments. For FireDac, you can safely put the driver dll in any folder. Although the folder with the program. Just need to configure the components. And, to put the driver in the IDE folder, it really is not very good. - Streletz