![]() |
#1
|
|||
|
|||
![]()
I have loaded MySQL 5.7
Then loaded MySQL 3.51 ODBC connector because the MySQL 5.7 connector 32 bit will not install (only 64 bit). started windows odbcad32.exe 32 bit from sysWOW64 directory Set up MySQL using the 'sys' database (already in MySQL) started Delphi 7, went DBExpress and placed TSQLConnection on form Renamed it to SqlConn double clicked form to get FormCreate HTML Code:
procedure TForm1.FormCreate(Sender: TObject); begin SqlConn.DriverName := 'dbxmysql'; SqlConn.GetDriverFunc := 'getSQLDriverMYSQL50'; SqlConn.VendorLib := 'libmysql.dll'; SqlConn.LibraryName := 'dbxopenmysql50.dll'; SqlConn.Params.Values['HostName'] := 'localhost';// as setup in dbcad32 SqlConn.Params.Values['Database'] := 'sys'; SqlConn.Params.Values['User_Name'] := 'root';// as setup in odbcad32 SqlConn.Params.Values['Password'] := 'admin';// as setup in odbcad32 SqlConn.LoginPrompt := false; SqlConn.Open;// error unable to load LibMySQL.dll // Delphi stops hear SqlConn.Free; end; dll as set by DBExpress. What is my options 1/ Use another MySQL connector 2/ is SqlConn.DriverName correct any other options The computer I'm using is fairly clean. But detail on testing has got past many errors |
#2
|
|||
|
|||
![]()
Do you have the 32 bit libmysql.dll either in the folder with your executable or in the c:\windows\sysWOW64 directory? (for 64bit either in the executable folder or in the c:\windows\system32 directory) If not, it's not going to be able to find the file. You can download the file from here. Pick the C Driver for MySQL (Connector C) then select the zip 32 and/or 64 bit and within the lib directory of the zip, you'll find libmysql.dll. Copy that file and place it in the appropriate directory.
(BTW: I did get the directories correct, sysWOW64 is for 32 bit and system32 is for 64 bit). Another option is to use ZEOS, but since you are using an older version of Delphi, you'll be stuck on an older version of the ZEOS connector, which you can download here. You'll also need libmysql.dll for ZEOS also though. |
#3
|
|||
|
|||
![]()
I found Custom install gave me a full x86 install that installed in 'Program files (x86)'.
That means I have a x86 libmysql.dll installed re ran C:\Windows\SysWOW64\odbcad32.exe and set up compared my odbcad32.exe new setting to DBExpress\SQLConnection Data source name: - MySQL sys tcp/ip:- localhost User: - root database: - sys delphi connection HTML Code:
SqlConn.DriverName := 'MySQL sys'; SqlConn.GetDriverFunc := 'getSQLDriverMYSQL50'; SqlConn.VendorLib := 'libmysql.dll'; SqlConn.LibraryName := 'dbxopenmysql50.dll'; SqlConn.Params.Values['HostName'] := 'localhost'; SqlConn.Params.Values['Database'] := 'sys'; SqlConn.Params.Values['User_Name'] := 'root'; SqlConn.Params.Values['Password'] := 'admin'; SqlConn.LoginPrompt := false; SqlConn.Open; // error unable to load LibMySQL.dll SqlConn.Free; Both found with start\run editor ok 2/ or is it these link details |
#4
|
|||
|
|||
![]()
I got a 3rd party program to log on with out a password
and it worked whats going on? |
#5
|
|||
|
|||
![]() Quote:
No idea how a 3rd party app can connecting without a password. I've got MySQL installed on my machine, and I can tell you I can connect with no problem, but it does need a username and password. I also noticed that you are connecting to the database as "root" You should probably create another username and associated password and connect your application using those credentials. Have you installed MySQL Workbench? It gives the facility to administer your server. |
#6
|
|||
|
|||
![]()
I have a MySQL database 5.7 working
The error was a bit funny, it mite be the data source name in inodbcad32.exe that I used, and I believe the custom install of mysql helped too. I now have a error : - Invalid Precision Value when using parameters So I guess i'm using data types that are not allowed I have integers //integer unsigned integers // DWord big integers // should be a int64 bit(1) // Boolean decimal 4, 2 for currency char or strings with size setting blob string called text 0-65355 // this is like a separate file I gather, and should be a anscii string what is not working with Delphi and especially for Data module I have set default values too like true, 0 and 0.00 |
#7
|
|||
|
|||
![]()
I found it Null does not work in Delphi
The database is working in Delphi Thanks rojam for talking me though |
![]() |
Tags |
delphi 7, mysql db, windows 7 |
Thread Tools | |
Display Modes | |
|
|