Can't connect to Mysql server ... on XP machine
Can't connect to Mysql server ... on XP machine
Hi, I use Delphi XE with Mydac 6.10.0.7.
I could access the Mysql server from any PC running W7 but not on XP PC.
Do you have an idea, a clue ?
More stanger, I have a XP PC that has a .exe on my application that is old of a few month and it works.
Thanks
Yves
I could access the Mysql server from any PC running W7 but not on XP PC.
Do you have an idea, a clue ?
More stanger, I have a XP PC that has a .exe on my application that is old of a few month and it works.
Thanks
Yves
Error message are:
Can't connect to mysql server on localhost 10061
Socket error on connect. WSAJetLastError return 10061
in a new error window
Application error
The exception unknown software exception (0x0eedfade) occured in the application at location 0x7c812a5b
in a new error window
Erreur d'application
Exception EMyError dans le module Fmrq.exe en 0021AFD1
Can't connect to mysql server on localhost 10061
Socket error on connect. WSAJetLastError return 10061
I use Delphi XE update 1 with Mydac 6.10.0.7. and Mysql 5.5.22
Can't connect to mysql server on localhost 10061
Socket error on connect. WSAJetLastError return 10061
in a new error window
Application error
The exception unknown software exception (0x0eedfade) occured in the application at location 0x7c812a5b
in a new error window
Erreur d'application
Exception EMyError dans le module Fmrq.exe en 0021AFD1
Can't connect to mysql server on localhost 10061
Socket error on connect. WSAJetLastError return 10061
I use Delphi XE update 1 with Mydac 6.10.0.7. and Mysql 5.5.22
Can't connect to Mysql server ... on XP machine
More info, the first module that load in the application is a DataModule that execute this procedure. I put a trace with 2 messages and none of them show on screen with XP. On W7 I have no error and I could see both messages.
Code: Select all
procedure TDmFmrq.DataModuleCreate(Sender: TObject);
var
reg: TRegistry;
begin
// voir procedure TDmFmrq.adFmrqError(Sender: TObject; E: EDAError; var Fail: Boolean);
reg := TRegistry.Create;
reg.RootKey := HKEY_CURRENT_USER;
if reg.OpenKey('\Software\FMRQMySql\, False) then
begin
// ShowMessage('debug dmFmrq in ok 100');
MotDePasse := reg.ReadString('MotDePasse');
Serveur := reg.ReadString('Serveur');
PortAcces := reg.ReadString('PortAcces');
NomUsager := reg.ReadString('NomUsager');
adFmrq.Password := MotDePasse;
adFmrq.Server := Serveur;
adFmrq.Port := StrToInt(PortAcces);
adFmrq.Username := NomUsager;
reg.CloseKey;
reg.Free;
ShowMessage('L923 ' + MotDePasse + ', ' + Serveur + ', ' + PortAcces + ', ' + NomUsager);
try
ShowMessage('L925 ' + MotDePasse + ', ' + Serveur + ', ' + PortAcces + ', ' + NomUsager);
adFmrq.Connected := True;
except
FmLogin := TFmLogin.Create(self);
FmLogin.showmodal;
FmLogin.Free;
DmFmrq.Free;
// Application.Terminate;
end;
end
else
begin
reg.CloseKey;
reg.Free;
FmLogin := TFmLogin.Create(self);
FmLogin.showmodal;
FmLogin.Free;
DmFmrq.Free;
// Application.Terminate;
end;
end;
Hello,
In the code you sent, the ShowMessage methods are in the IF block, and if IF = false, you won't see these messages. You are trying to obtain data from the registry in your code:
and if this method returns False, this means that there is no such key in the registry or you don't have access, and this problem is not due to MyDAC. To check the opportunity to connect to the server, try to set the connection parameters explicitly in MyConnection and connect to the server.
In the code you sent, the ShowMessage methods are in the IF block, and if IF = false, you won't see these messages. You are trying to obtain data from the registry in your code:
Code: Select all
if reg.OpenKey('\Software\FMRQMySql\, False) then Hi,
but
I thing that I have found a clue.
Is it possible that the problem happen because TMyConnection is set connected = true in the IDE and because those XP pc have to establish a connection first they crash.
On the other hand, all W7 pc that I tested were mysql server itself and my development pc where XE is install.
Yves
Yes, I try this and it does not connect to the server.To check the opportunity to connect to the server, try to set the connection parameters explicitly in MyConnection and connect to the server.
but
I thing that I have found a clue.
Is it possible that the problem happen because TMyConnection is set connected = true in the IDE and because those XP pc have to establish a connection first they crash.
On the other hand, all W7 pc that I tested were mysql server itself and my development pc where XE is install.
Yves
Hello,
Please try connecting to your MySQL server using the following console application, and inform us about the results.
Please try connecting to your MySQL server using the following console application, and inform us about the results.
Code: Select all
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils, MyAccess;
var
MyConnection: TMyConnection;
begin
MyConnection := TMyConnection.Create(nil);
try
MyConnection.Server := host;
MyConnection.Port := 3306;//port
MyConnection.Database := database;
MyConnection.Username := login;
MyConnection.Password := password;
try
MyConnection.Connect;
Writeln('OK');
except
on E: Exception do
Writeln('Error: ' + E.Message);
end;
finally
MyConnection.Free;
Readln;
end;
end.Can't connect to Mysql server ... on XP machine
Hi, yes this work OK.
I did a lot of testing to.
The problem happen because TMyConnection was set connected = true in the IDE.
On XP PC for some reason, the application crash.
On W7 pc the application close the connection and establish a new one.
More tests with my app. with connected = false.
If I stop the service MySql.
- On XP PC I receive exact same error message that I describe in my first email and the application crash.
- On W7 pc the application give me the exact same error message that I describe in my first email but the application did not crash.
- With your console app. on XP, the pc did not crash and give me the same message 10061.
When TMyConnection is set connected = false in the IDE, I have no problem on XP or W7.
Thanks
I did a lot of testing to.
The problem happen because TMyConnection was set connected = true in the IDE.
On XP PC for some reason, the application crash.
On W7 pc the application close the connection and establish a new one.
More tests with my app. with connected = false.
If I stop the service MySql.
- On XP PC I receive exact same error message that I describe in my first email and the application crash.
- On W7 pc the application give me the exact same error message that I describe in my first email but the application did not crash.
- With your console app. on XP, the pc did not crash and give me the same message 10061.
When TMyConnection is set connected = false in the IDE, I have no problem on XP or W7.
Thanks
Hello,
In your case, AccessViolation occurs due to that the DataModule Free method calls itself after connection failure, and this behaviour is similar for any platform.
If you don't want the connection set in design-time to be opened when the application is executed, you should set the MyConnection.Options.KeepDesignConnected property to false. In this case, the connection won't be open automatically after the application is executed.
In your case, AccessViolation occurs due to that the DataModule Free method calls itself after connection failure, and this behaviour is similar for any platform.
If you don't want the connection set in design-time to be opened when the application is executed, you should set the MyConnection.Options.KeepDesignConnected property to false. In this case, the connection won't be open automatically after the application is executed.
Can't connect to Mysql server ... on XP machine
Hi, ok great.
I don't see any documentation that talk about that option ...
Thanks
Yves
I don't see any documentation that talk about that option ...
Thanks
Yves
Re: Can't connect to Mysql server ... on XP machine
Hello,
Thank you for the information. We will try to fix passage and positioning by F1 in the help.
Thank you for the information. We will try to fix passage and positioning by F1 in the help.