Delphi 7, dbExpress V3, MySQL 5
I am trying to connect to a remote server. At Design time, I am able to do this, but at run time, I get the above error, even though I do not have a local server running
Can't connect to MySQL server on 'localhost'
-
- Posts: 3
- Joined: Mon 27 Feb 2006 06:23
-
- Posts: 3
- Joined: Mon 27 Feb 2006 06:23
Invalid Username/Password SQL server error: Can't connect on 'localhost' (10061)
Hi Anteus
I hope this answers your questions:
I am using a TSQLConnection, which connects fine at design time (by setting connected to true). I have tried leaving it open with the same settings (ie not changing the params at run time), and by changing the params at runtime, per the following code, but I still get the error message
conn.params.Clear;
conn.params.Add('hostname=xxxx');
conn.params.Add('database=yyyy');
conn.params.Add('user_name=root');
conn.params.Add('password=zzzz');
conn.open;
The component is set up as follows:
ConnectionName - MySQL (Core Lab)
DriverName - MySQL (Core Lab)
GetDriverFunc - getSQLDriverMySQL
KeepConnection - True
LibraryName - dbexpmda.dll
LoadParamsOnConnect - False
LoginPrompt - False
Name - Conn
Params - see above
VendorLib - libmysql.dll
I hope this answers your questions:
I am using a TSQLConnection, which connects fine at design time (by setting connected to true). I have tried leaving it open with the same settings (ie not changing the params at run time), and by changing the params at runtime, per the following code, but I still get the error message
conn.params.Clear;
conn.params.Add('hostname=xxxx');
conn.params.Add('database=yyyy');
conn.params.Add('user_name=root');
conn.params.Add('password=zzzz');
conn.open;
The component is set up as follows:
ConnectionName - MySQL (Core Lab)
DriverName - MySQL (Core Lab)
GetDriverFunc - getSQLDriverMySQL
KeepConnection - True
LibraryName - dbexpmda.dll
LoadParamsOnConnect - False
LoginPrompt - False
Name - Conn
Params - see above
VendorLib - libmysql.dll
-
- Posts: 3
- Joined: Mon 27 Feb 2006 06:23
Can't connect - problem resolved
3 steps
1) Remove dbExpMysql from the uses clauses in all units in the application
2) Remove connection.params.clear from the connection to the Tsqlconnection statement
3) Clean up any old libmysql.dll's that may be on the system
1) Remove dbExpMysql from the uses clauses in all units in the application
2) Remove connection.params.clear from the connection to the Tsqlconnection statement
3) Clean up any old libmysql.dll's that may be on the system
We asked you to send us settings from *.dfm file to be sure that parameters have values you want. Please, try to set up parameters of the SQLConnection using object inspector, do NOT use double-click on its icon. If it won't help, open *.dfm file with text editor (Notepad, for example) and copy description of the connection from it. It looks like this:
Code: Select all
object SQLConnection: TSQLConnection
ConnectionName = 'MySQL (Core Lab)'
...
end