Recent

Author Topic: Mysql5 + Lazarus + Ubuntu  (Read 6205 times)

zevang

  • New member
  • *
  • Posts: 6
Mysql5 + Lazarus + Ubuntu
« on: June 26, 2007, 10:29:20 pm »
Hello all,

I installed Lazarus on Ubuntu 7.04, on a AMD64 machine.

Decided to use the provided connection tools, since Lazarus seems to have Mysql as a native SGBD system.

Configured the BD server, all running, access checked and working.

When it comes to configure a connection inside Lazarus, that's a problem. I coudn't find any place where to indicate the Port number (3306 as a default), so the component can connect to MySql.

I receive an error message every time I try to accomplish connection that states:
"Server Connect failed" (I know this is the most generic message...)

The components I'm using are:
TMySQL50Connection
TSQLTransaction
TSQLQuery

Is there anything else I must do to make things work?

thanks in advance

Zevang

wryoung98

  • Newbie
  • Posts: 2
RE: Mysql5 + Lazarus + Ubuntu
« Reply #1 on: June 29, 2007, 07:39:08 am »
What use did you create for mysql?  did you user localhost to connect and not your host name. mysql by default listens to localhost I believe.

wryoung98

  • Newbie
  • Posts: 2

zevang

  • New member
  • *
  • Posts: 6
RE: Mysql5 + Lazarus + Ubuntu
« Reply #3 on: July 02, 2007, 05:08:13 am »
Hi wryounq98,

As a test basis, I created only "root" user with a weak password. Inside Lazarus my connector looks at a host "localhost" (I've tried 127.0.0.1 as well, no results though).
I can connect to the BD (wich BTW has tables and registers in it) via Query Browser and MSQL Administrator with no problem at all.
I will take a good look at the address you pointed.

thanks a lot,

Zevang

zevang

  • New member
  • *
  • Posts: 6
Mysql5 + Lazarus + Ubuntu
« Reply #4 on: July 04, 2007, 01:14:28 am »
Hi again ;-)

I downloaded the demo application into my Kubuntu Lazarus.
Created a common user with privileges to access my test Database (called "atendimento") and loaded the app into the IDE.

I then changed the line where the database name is filled into the property of MySQLConnection, where I put "atendimento".

Got it to run, and the main form pops up in my screen.

Filled fields with the proper information, like "localhost", "username", "password".

After a hit in the "connect" button three messages appear at the memo box:
"18:13:14.944: Opening a connection to server: localhost
18:13:15.170: Connected to server: localhost
18:13:15.170: Retreiving list of available databases"

And a message box pops up like this:
Title: "ptrymysql"
"MySQLConnection1: Server connect failed
Press OK to ignore..."

Everything appears to be right, I manage to connect to Mysql using Query brower and Administrator. I can even make backups, retrieve them, create users, etc...
Only Lazarus couldn't complete the connection.
What would I have done wrong? ... :-)

regards,

Zevang

zevang

  • New member
  • *
  • Posts: 6
Spicing up...
« Reply #5 on: July 04, 2007, 07:51:59 pm »
Let me spice up the topic a little bit.

So, I came back to Windows (XP) and did exactly what a did in Ubuntu.
Surprise!!! Everything worked... (Funny that I was disappointed...)

I used the same user name, password, permission type.
The installation was also the same. Port number, host name, application, everything was simply equal.

What would be a plausible explanation for Ubuntu version to keep giving me that "Server connect failed" message?

Zevang