RE: [lazarus] MySQL Connection

2006-03-14 Thread Panagiotis Sidiropoulos
>Then you don't have mysql 4.1 on your client, but 4.0.24...
>(this can be different from the server version)

You are right, I had client version 4.0. I did not know about server and
client versions difference, thank you.

>As far as I know, this is not a valid SQL statement in MySQL.
>The MySQL command-line client treats it specially, and uses 
>the MySQL API to show the result of the statement.
>Try something like
>'select * from user';

You are right again. I tested this statement "show databases" from
within MyAdmin or other MySQL clients and had proper results, thus I did
not investigating tha direction. It is OK now, it is connected and
exetuce above mentioned command.

Panagiotis

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Michael Van Canneyt
Sent: Tuesday, March 14, 2006 12:56 AM
To: lazarus@miraclec.com
Subject: RE: [lazarus] MySQL Connection




On Mon, 13 Mar 2006, Panagiotis Sidiropoulos wrote:

> > 2. I expect TSQL40Connection to give problems with MySQL
4.1.12-standard.
> > I think you should use TSQL41Connection.
> > Unfortunately they are not binary compatible.
> > (Complaints should go to to [EMAIL PROTECTED])
>
> TSQL41Connection raises an exception with message:
>
> "TSQL41Connection can not work with the installed MySQL client version

> (4.0.24)."

Then you don't have mysql 4.1 on your client, but 4.0.24...

(this can be different from the server version)

>
> I checked this and thought that is caused because of MySQL version but

> I'm not sure.
>
> > 1. Did you set the 'Database' property of your TSQLQuery component ?
>
> Sorry, TSQLQuery-TSQLConnection relation somehow was broken, I should 
> check once again, I apologise. Now, all seem to be in place but 
> running following code I get error:
> - http://www.magentadb.gr/ftp/sql-conn.png
>
> at lines:
>
> SQLQuery1.SQL.Text := 'show databases';
> showmessage( SQLQuery1.SQL.Text );
> SQLQuery1.Open;
>
> SQL statement is just "show databases", as you can before executing I 
> check is once again using showmessage(). Trying from Windows Delphi, 
> It is connected using same user account.

As far as I know, this is not a valid SQL statement in MySQL. The MySQL
command-line client treats it specially, and uses the MySQL API to show
the result of the statement.

Try something like
'select * from user';

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] MySQL Connection

2006-03-13 Thread Michael Van Canneyt


On Mon, 13 Mar 2006, Panagiotis Sidiropoulos wrote:

> > 2. I expect TSQL40Connection to give problems with MySQL 4.1.12-standard.
> > I think you should use TSQL41Connection.
> > Unfortunately they are not binary compatible.
> > (Complaints should go to to [EMAIL PROTECTED])
>
> TSQL41Connection raises an exception with message:
>
> "TSQL41Connection can not work with the installed MySQL client version
> (4.0.24)."

Then you don't have mysql 4.1 on your client, but 4.0.24...

(this can be different from the server version)

>
> I checked this and thought that is caused because of MySQL version but
> I'm not sure.
>
> > 1. Did you set the 'Database' property of your TSQLQuery component ?
>
> Sorry, TSQLQuery-TSQLConnection relation somehow was broken, I should check 
> once again, I apologise.
> Now, all seem to be in place but running following code I get error:
> - http://www.magentadb.gr/ftp/sql-conn.png
>
> at lines:
>
> SQLQuery1.SQL.Text := 'show databases';
> showmessage( SQLQuery1.SQL.Text );
> SQLQuery1.Open;
>
> SQL statement is just "show databases", as you can before executing
> I check is once again using showmessage(). Trying from Windows Delphi,
> It is connected using same user account.

As far as I know, this is not a valid SQL statement in MySQL.
The MySQL command-line client treats it specially, and uses
the MySQL API to show the result of the statement.

Try something like
'select * from user';

Michael.

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] MySQL Connection

2006-03-13 Thread Panagiotis Sidiropoulos
> 2. I expect TSQL40Connection to give problems with MySQL 4.1.12-standard.
> I think you should use TSQL41Connection.
> Unfortunately they are not binary compatible.
> (Complaints should go to to [EMAIL PROTECTED])

TSQL41Connection raises an exception with message:

"TSQL41Connection can not work with the installed MySQL client version
(4.0.24)."

I checked this and thought that is caused because of MySQL version but
I'm not sure.

> 1. Did you set the 'Database' property of your TSQLQuery component ?

Sorry, TSQLQuery-TSQLConnection relation somehow was broken, I should check 
once again, I apologise.
Now, all seem to be in place but running following code I get error:
- http://www.magentadb.gr/ftp/sql-conn.png

at lines:

SQLQuery1.SQL.Text := 'show databases';
showmessage( SQLQuery1.SQL.Text );
SQLQuery1.Open;

SQL statement is just "show databases", as you can before executing 
I check is once again using showmessage(). Trying from Windows Delphi,
It is connected using same user account.

The code from sample aplication is:

procedure TFormTryMySQL.ConnectButtonClick(Sender: TObject);
begin
  // Check if we have an active connection. If so, let's close it.
  if MySQLConnection1.Connected then begin
SQLTransaction1.Active := False;
MySQLConnection1.Close;
  end;
  // Set the connection parameters.
  MySQLConnection1.HostName := HostEdit.Text;
  MySQLConnection1.UserName := UserEdit.Text;
  MySQLConnection1.Password := PasswdEdit.Text;
  MySQLConnection1.DatabaseName := 'mysql'; // MySQL is allways there!
  ShowString('Opening a connection to server: ' + HostEdit.Text);
  MySQLConnection1.Open;
  // First lets get a list of available databases.
  if MySQLConnection1.Connected then begin
ShowString('Connected to server: ' + HostEdit.Text);
ShowString('Retreiving list of available databases.');
SQLQuery1.SQL.Text := 'show databases';
showmessage( SQLQuery1.SQL.Text );

SQLQuery1.Open;
while not SQLQuery1.EOF do begin
  DatabaseComboBox.Items.Add(SQLQuery1.Fields[0].AsString);
  SQLQuery1.Next;
end;
SQLQuery1.Close;
ShowString('List of databases received!');

  end;
end;

Panagiotis

> Στις 13-03-2006, ημέρα Δευ, και ώρα 16:54 +0100, ο/η Michael Van Canneyt 
> έγραψε:
> 
> On Mon, 13 Mar 2006, Panagiotis Sidiropoulos wrote:
> 
> >> You need the latest svn-version from fpc.
> >> All non-visible components are part of
> >> the FCL of fpc.
> >
> > OK, Everything is installed and available for use. I use
> > TSQL40Connection on MySQL 4.1.12-standard. Sample program TryMySQL
> > (ptrmysql) connects but on any SQL statement it raises an exception with
> > message "Database not assigned". I double checked login user privileges
> > and it is OK, I even try with admin privileges.
> 
> 1. Did you set the 'Database' property of your TSQLQuery component ?
> 
> 2. I expect TSQL40Connection to give problems with MySQL 4.1.12-standard.
> I think you should use TSQL41Connection.
> Unfortunately they are not binary compatible.
> (Complaints should go to to [EMAIL PROTECTED])
> 
> 
> Michael.
> 
> _
>  To unsubscribe: mail [EMAIL PROTECTED] with
> "unsubscribe" as the Subject
>archives at http://www.lazarus.freepascal.org/mailarchives
> 

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] MySQL Connection

2006-03-13 Thread Michael Van Canneyt



On Mon, 13 Mar 2006, Panagiotis Sidiropoulos wrote:


You need the latest svn-version from fpc.
All non-visible components are part of
the FCL of fpc.


OK, Everything is installed and available for use. I use
TSQL40Connection on MySQL 4.1.12-standard. Sample program TryMySQL
(ptrmysql) connects but on any SQL statement it raises an exception with
message "Database not assigned". I double checked login user privileges
and it is OK, I even try with admin privileges.


1. Did you set the 'Database' property of your TSQLQuery component ?

2. I expect TSQL40Connection to give problems with MySQL 4.1.12-standard.
   I think you should use TSQL41Connection.
   Unfortunately they are not binary compatible.
   (Complaints should go to to [EMAIL PROTECTED])


Michael.

_
To unsubscribe: mail [EMAIL PROTECTED] with
   "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] MySQL Connection

2006-03-13 Thread Panagiotis Sidiropoulos
>You need the latest svn-version from fpc. 
>All non-visible components are part of 
>the FCL of fpc.

OK, Everything is installed and available for use. I use
TSQL40Connection on MySQL 4.1.12-standard. Sample program TryMySQL
(ptrmysql) connects but on any SQL statement it raises an exception with
message "Database not assigned". I double checked login user privileges
and it is OK, I even try with admin privileges.

OS is Linux
Lazarus revision 8935
FPC 2.1.1 revision 2909

Any idea?

Regards, Panagiotis

-Original Message-
From: Joost van der Sluis [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 10, 2006 10:30 AM
To: lazarus@miraclec.com
Subject: RE: [lazarus] MySQL Connection


On Thu, 2006-03-09 at 20:33 +0200, Panagiotis Sidiropoulos wrote:
> >Yes, and maybe that you can update the wiki?
> 
> Although I don't feel confident advising because of my limited skills,

> I made this amendment to the wiki:

That doesn't matter. Anyone has to learn. And besides of that, if only
the developpers, who knows all ins and outs, can update the Wiki, it
will never happen. ;)

> >Reading the WIKI-text above, you'll see
> >immediately what's wrong: 
> >you're not using the latest SVN version 
> >of Lazarus.
> 
> I run "svn update" into Lazarus folder every day and not only once. 
> This moment's Lazarus revision is 8893.

Ok, another error in the wiki. You need the latest svn-version from fpc.
All non-visible components are part of the FCL of fpc. The Lazarus-
package is only a wrapper around the real components. So an update of
lazarus is only needed if a new component is added. (or deleted)

> >Sorry, but I can't resist:
> >'I've written some code and it raises 
> >an exception. Can anyone help me?'
> >What is the exception: 'Incorrect 
> >password'? Or maybe: 'Can not resolve 
> >hostname'?
> 
> I understand the way you feel not getting enough information to figure

> the problem out. Information I had last time just before posted this 
> request seemed useless to me so I did not include it, don't know, 
> can't remember what exactly was, I believe it was totally general. I'm

> sure that if it was providing something useful such as 'Incorrect 
> password' or 'Can not resolve hostname' I wouldn't judge it the way I 
> did.

Offcourse. But information that looks like useless to you, can mean
everything to the programmer.

> In the mean time, I read again article mentioned, followed every one 
> of suggestions there and made some cleaning and privileges checking. 
> Running sample application again, I get segfault mentioned on your 
> reply. After svn-ing fpc from scratch I got revision 2820.
> 
> Now, after svn-ing fpc and try to compile it (I have to do it, don't 
> I?) using comamnd "make all" I get an error "cannot find -lgpm". Let 
> me find the cause and be back if necessary.

You need to install the gpm-devel package. This is how it's called on
Fedora, I'm not sure how to handle this on Knoppix.

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] MySQL Connection

2006-03-10 Thread Joost van der Sluis
On Thu, 2006-03-09 at 20:33 +0200, Panagiotis Sidiropoulos wrote:
> >Yes, and maybe that you can update the wiki?
> 
> Although I don't feel confident advising because of my limited skills, I
> made this amendment to the wiki:

That doesn't matter. Anyone has to learn. And besides of that, if only
the developpers, who knows all ins and outs, can update the Wiki, it
will never happen. ;)

> >Reading the WIKI-text above, you'll see 
> >immediately what's wrong: 
> >you're not using the latest SVN version 
> >of Lazarus.
> 
> I run "svn update" into Lazarus folder every day and not only once. This
> moment's Lazarus revision is 8893.

Ok, another error in the wiki. You need the latest svn-version from fpc.
All non-visible components are part of the FCL of fpc. The Lazarus-
package is only a wrapper around the real components. So an update of
lazarus is only needed if a new component is added. (or deleted)

> >Sorry, but I can't resist: 
> >'I've written some code and it raises 
> >an exception. Can anyone help me?'
> >What is the exception: 'Incorrect 
> >password'? Or maybe: 'Can not resolve 
> >hostname'?
> 
> I understand the way you feel not getting enough information to figure
> the problem out. Information I had last time just before posted this
> request seemed useless to me so I did not include it, don't know, can't
> remember what exactly was, I believe it was totally general. I'm sure
> that if it was providing something useful such as 'Incorrect password'
> or 'Can not resolve hostname' I wouldn't judge it the way I did.

Offcourse. But information that looks like useless to you, can mean
everything to the programmer.

> In the mean time, I read again article mentioned, followed every one of
> suggestions there and made some cleaning and privileges checking.
> Running sample application again, I get segfault mentioned on your
> reply. After svn-ing fpc from scratch I got revision 2820.
> 
> Now, after svn-ing fpc and try to compile it (I have to do it, don't I?)
> using comamnd "make all" I get an error "cannot find -lgpm". Let me find
> the cause and be back if necessary.

You need to install the gpm-devel package. This is how it's called on
Fedora, I'm not sure how to handle this on Knoppix.

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


RE: [lazarus] MySQL Connection

2006-03-09 Thread Panagiotis Sidiropoulos
>Yes, and maybe that you can update the wiki?

Although I don't feel confident advising because of my limited skills, I
made this amendment to the wiki:

"...called TMySQLConnection (depicted by a dolphin).

If can't find $Lazarus/components/sqldb/mysql directory and
mysql4connlaz.lpk then this mean that you are using a newer version in
which mysql4connlaz.lpk merged with sqldblaz.lpk. It is OK, installing
sqldblaz.lpk you will get all components mentioned into same Lazarus IDE
toolbar TAB.

If you do not know how to install components..."

Please approve information and English syntax.

>Reading the WIKI-text above, you'll see 
>immediately what's wrong: 
>you're not using the latest SVN version 
>of Lazarus.

I run "svn update" into Lazarus folder every day and not only once. This
moment's Lazarus revision is 8893.

>Sorry, but I can't resist: 
>'I've written some code and it raises 
>an exception. Can anyone help me?'
>What is the exception: 'Incorrect 
>password'? Or maybe: 'Can not resolve 
>hostname'?

I understand the way you feel not getting enough information to figure
the problem out. Information I had last time just before posted this
request seemed useless to me so I did not include it, don't know, can't
remember what exactly was, I believe it was totally general. I'm sure
that if it was providing something useful such as 'Incorrect password'
or 'Can not resolve hostname' I wouldn't judge it the way I did.

In the mean time, I read again article mentioned, followed every one of
suggestions there and made some cleaning and privileges checking.
Running sample application again, I get segfault mentioned on your
reply. After svn-ing fpc from scratch I got revision 2820.

Now, after svn-ing fpc and try to compile it (I have to do it, don't I?)
using comamnd "make all" I get an error "cannot find -lgpm". Let me find
the cause and be back if necessary.

Panagiotis

-Original Message-
From: Joost van der Sluis [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 09, 2006 5:48 PM
To: lazarus@miraclec.com
Subject: Re: [lazarus] MySQL Connection


On Wed, 2006-03-08 at 09:37 +, Panagiotis Sidiropoulos wrote:
> I try to connect into a MySQL server hosted on a local network. All 
> comments following are related to information povided at: 
> wiki.lazarus.freepascal.org/index.php/MySQLDatabases#Connect_to_a_serv
> er
> 
> >Another possibility is the installation of the package in the 
> >$Lazarus/components/sqldb directory. In this directory you see a 
> >package file called sqldblaz.lpk. You need to install this package 
> >and the mysql4connlaz.lpk from the $Lazarus/components/sqldb/mysql 
> >directory.
> 
> Package in /sqldb folder is succesfuly installed. Package 
> mysql4connlaz.lpk is not found into /sqldb/mysql folder, this folder 
> does not even exist. I suppose some merging happened here, I just need

> to know if it is enough to install main package found into /sqldb 
> folder.

Yes, and maybe that you can update the wiki?

> >Note. In latest SVN version of Lazarus you will find 3 
> >MySQLConnection components. These are TMySQL40Connection, 
> >TMySQL41Connection and TMySQL50Connection. Make sure you use the 
> >correct one to connect to your server. So if you are running MySQL 
> >4.1 use the TMySQL41Connection.
> 
> After installing sql component packages, I get general use components,

> not related to a specific MySQL server version, not TMySQL40Connection

> found but TMySQLConnection etc.

Reading the WIKI-text above, you'll see immediately what's wrong: you're
not using the latest SVN version of Lazarus.

> What is the problem:
> TSQLConnection.Open raises an exception, not ".connected = false", 
> just an exception.

Sorry, but I can't resist: 'I've written some code and it raises an
exception. Can anyone help me?'

What is the exception: 'Incorrect password'? Or maybe: 'Can not resolve
hostname'?

Or do you've got a segfault? Then it could be this bug:
http://www.lazarus.freepascal.org/mantis/view.php?id=1711

And if it's about database-issues, please tell us which version of fpc
you are using. The development of sqldb goes relatively fast. So you'd
better always use the latest svn version from fpc.

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


Re: [lazarus] MySQL Connection

2006-03-09 Thread Joost van der Sluis
On Wed, 2006-03-08 at 09:37 +, Panagiotis Sidiropoulos wrote:
> I try to connect into a MySQL server hosted on a local network. All
> comments following are related to information povided at:
> wiki.lazarus.freepascal.org/index.php/MySQLDatabases#Connect_to_a_server
> 
> >Another possibility is the installation of the package in the
> >$Lazarus/components/sqldb directory. In this directory you see a
> >package file called sqldblaz.lpk. You need to install this package and
> >the mysql4connlaz.lpk from the $Lazarus/components/sqldb/mysql
> >directory.
> 
> Package in /sqldb folder is succesfuly installed. Package
> mysql4connlaz.lpk is not found into /sqldb/mysql folder, this folder
> does not even exist. I suppose some merging happened here, I just need
> to know if it is enough to install main package found into /sqldb
> folder.

Yes, and maybe that you can update the wiki?

> >Note. In latest SVN version of Lazarus you will find 3 MySQLConnection
> >components. These are TMySQL40Connection, TMySQL41Connection and
> >TMySQL50Connection. Make sure you use the correct one to connect to
> >your server. So if you are running MySQL 4.1 use the
> >TMySQL41Connection.
> 
> After installing sql component packages, I get general use components,
> not related to a specific MySQL server version, not TMySQL40Connection
> found but TMySQLConnection etc.

Reading the WIKI-text above, you'll see immediately what's wrong: you're
not using the latest SVN version of Lazarus.

> What is the problem:
> TSQLConnection.Open raises an exception, not ".connected = false", just
> an exception.

Sorry, but I can't resist: 'I've written some code and it raises an
exception. Can anyone help me?'

What is the exception: 'Incorrect password'? Or maybe: 'Can not resolve
hostname'?

Or do you've got a segfault? Then it could be this bug:
http://www.lazarus.freepascal.org/mantis/view.php?id=1711

And if it's about database-issues, please tell us which version of fpc
you are using. The development of sqldb goes relatively fast. So you'd
better always use the latest svn version from fpc.

-- 
Met vriendelijke groeten,

  Joost van der Sluis
  CNOC Informatiesystemen en Netwerken
  http://www.cnoc.nl

_
 To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives