Re: long text insert failure

2005-08-11 Thread Elizabeth Bonifacio
Thanks a lot guys. I tried my insert using MYSQL Query Browser and
manage to insert the syslog. Remo, you're correct, the Windows Command
prompt limitation is the cause since i'm using windows xp cmd.exe.
I'll try to do import as you've suggested.

What a relief, i can proceed in building my syslog database.

Thanks again. You guys are the BEST! 

Liz

On 8/11/05, Remo Tex <[EMAIL PROTECTED]> wrote:
> Liz you didn't mention by I suppose you're using Windows client too i.e.
> mysql.exe. A quick test revealed that in such a case char limit is <=255
> i.e. that's limitation of Windows Command Prompt: command.com or in case
> of Win NT,2000,XP - cmd.exe
> try writing your long SQL command in text file and import from there ;-)
> try:
> mysql (your host, login etc. options here ) < import.sql
> or from within mysql prompt> source import.sql;
> 
> HTH
> 
> Elizabeth Bonifacio wrote:
> > Dear Guys,
> >
> > Can please anyone advice me how to successfully insert long text data
> > into my innodb table rawlog with table stucture as follows:
> > mysql> desc rawlog;
> > +---+--+--+-+-+---+
> > | Field | Type | Null | Key | Default | Extra |
> > +---+--+--+-+-+---+
> > | log   | longtext | YES  | | NULL|   |
> > +---+--+--+-+-+---+
> > 1 row in set (0.03 sec)
> >
> > here is one sample of the syslog data I'm trying to insert into the
> > table without success:
> >
> > insert into rawlog values ('<133>date=2005-07-25 time=12:38:23
> > device_id=FGT1002105200379 log_id=0022010001 type=traffic
> > subtype=allowed pri=notice vd=root SN=1321 duration=180 policyid=1
> > proto=17 service=29716/udp status=accept src=192.168.2.63
> > srcname=192.168.2.63 dst=193.11.28.37 dstname=193.11.28.37
> > src_int=internal dst_int=external sent=46 rcvd=86 sent_pkt=1
> > rcvd_pkt=1 src_port=10055 dst_port=29716 vpn=n/a tran_ip=202.189.48.98
> > tran_port=43957 dir_disp=org tran_disp=noop');
> >
> > I've already tried changing my column data type from varchar to text
> > types but still the insert statement cannot be typed all the way to
> > the end of statement.I can only type half of the syslog data.  Does it
> > has something to do
> > with my system? I'm using mysql version 4.1.11 running in windows xp
> > 32 bit. My max_allowed_packet is 1048576, do I need to increase this?
> > by how much?
> >
> > Please advice me as a need to insert lots of long syslog data in this table.
> > All the best.
> >
> > Elizabeth
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



long text insert failure

2005-08-10 Thread Elizabeth Bonifacio
Dear Guys,

Can please anyone advice me how to successfully insert long text data
into my innodb table rawlog with table stucture as follows:
mysql> desc rawlog;
+---+--+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
+---+--+--+-+-+---+
| log   | longtext | YES  | | NULL|   |
+---+--+--+-+-+---+
1 row in set (0.03 sec)

here is one sample of the syslog data I'm trying to insert into the
table without success:

insert into rawlog values ('<133>date=2005-07-25 time=12:38:23
device_id=FGT1002105200379 log_id=0022010001 type=traffic
subtype=allowed pri=notice vd=root SN=1321 duration=180 policyid=1
proto=17 service=29716/udp status=accept src=192.168.2.63
srcname=192.168.2.63 dst=193.11.28.37 dstname=193.11.28.37
src_int=internal dst_int=external sent=46 rcvd=86 sent_pkt=1
rcvd_pkt=1 src_port=10055 dst_port=29716 vpn=n/a tran_ip=202.189.48.98
tran_port=43957 dir_disp=org tran_disp=noop');

I've already tried changing my column data type from varchar to text
types but still the insert statement cannot be typed all the way to
the end of statement.I can only type half of the syslog data.  Does it
has something to do
with my system? I'm using mysql version 4.1.11 running in windows xp
32 bit. My max_allowed_packet is 1048576, do I need to increase this?
by how much?

Please advice me as a need to insert lots of long syslog data in this table.
All the best.

Elizabeth

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



how to link to crystal report

2005-08-08 Thread Elizabeth Bonifacio
Hi guys,
I'm new in database development, and has been wondering if anyone can
suggest a good reporting tool that will help me generate graphical
report for my database queries using visual c++? Can I use excell to
format my queries into graph?

My project involves the developement of syslog server in a windows xp
environment using mysql 4.1 and visual C++ version 6.0. Aside from the
graphical report, my syslog server should be receiving online logs
from few network devices such as fortinet and tripwire using sysrose
daemon.

Can anyone please advice me on which table type will be most suitable
for inserting and querying huge amount of syslog on a real time basis?

Hoping for your advice.

betcha

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: connection error from c application

2005-06-29 Thread Elizabeth Bonifacio
  Dear Guys,
  I have been stucked in loading file using "load data local infile" command.
At first it is loading a null value on my first record followed with
one record from my input file. The rest are ignored and i've been
receiving lots of warnings.

I tried converting the text file into a csv and was successful in
loading all the files but with a lot of null values and data going
another field. I used the "fields terminated by ',' lines terminated
by ','" instead of '\r\n' because the loading problem.

I tried reformatting my txt and csv file, check its spacing(tabs) one
by one but still the data seem to go haywire.

 I'm actually building an application that will accept continuous data
(syslog) using c++ that I need to store in Mysql. But just want to
handle one thing at a time so I'm just testing how it will accept
loading file from the mysql prompt.

I'm running on windows XP, mysql server 4.1.11. Kindly refer to the
table structure and the attached file. I know you guys are experience
and must have encounter this matter before.

Will appreciate all your help to a new developer like me,

Thanks,

Elizabeth

mysql> show create table log8;
| log8  |CREATE TABLE `log8` (
  `log_date` date default '-00-00',
  `log_time` time default '00:00:00',
  `device_id` varchar(17) default NULL,
  `log_id` varchar(11) NOT NULL default '',
  `type` varchar(7) default NULL,
  `subtype` varchar(7) default NULL,
  `pri` varchar(6) default NULL,
  `vd` varchar(4) default NULL,
  `serial_number` int(11) default NULL,
  `duration` int(5) default NULL,
  `policyid` tinyint(3) default NULL,
  `proto` tinyint(3) default NULL,
  `service` varchar(10) default NULL,
  `status` varchar(6) default NULL,
  `src` varchar(15) default NULL,
  `srcname` varchar(15) default NULL,
  `dst` varchar(15) default NULL,
  `dstname` varchar(15) default NULL,
  `src_int` varchar(8) default NULL,
  `dst_int` varchar(8) default NULL,
  `sent` int(11) default NULL,
  `rcvd` int(11) default NULL,
  `sent_pkt` tinyint(4) default NULL,
  `rcvd_pkt` tinyint(4) default NULL,
  `src_port` int(11) default NULL,
  `dst_port` int(11) default NULL,
  `vpn` varchar(5) default NULL,
  `tran_ip` varchar(15) default NULL,
  `tran_port` int(5) default NULL,
  `dir_disp` varchar(5) default NULL,
  `tran_disp` varchar(5) default NULL,
  PRIMARY KEY  (`log_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
1 row in set (0.08 sec)

mysql>

On 6/27/05, Gleb Paharenko <[EMAIL PROTECTED]> wrote:
> Hello.
> 
> 
> 
> Send an example of your file and your table's definition
> 
> (use SHOW CREATE TABLE for this purpose). Please, next time
> 
> send your replies to the list.
> 
> 
> 
> 
> 
> 
> 
> >
> 
> >Hope you're doing great today. Back to my question last week, I've
> 
> >been encountering this problem of loading my file using the "load data
> 
> >local infile" command for a particular text file.
> 
> >
> 
> >I cannot determine the error in my sql codes since i find no problem
> 
> >loading other text file into the database.
> 
> >
> 
> > mysql> load data local infile 'syslog5.txt' into table log4 fields
> 
> >
> 
> >>>
> 
> >>
> 
> >>>> > terminated by ' \t' lines terminated by '\n';
> 
> >>
> 
> >>>
> 
> >>
> 
> >>>> > Query OK, 2 rows affected, 513 warnings (0.03 sec)
> 
> >>
> 
> >>>
> 
> >>
> 
> >>>> > Records: 20  Deleted: 0  Skipped: 18  Warnings: 505
> 
> >
> 
> >
> 
> >I'm not familiar with this "warnings" myself. I can only load the
> 
> >first line in the "syslog5.txt" and the rest are ignored. From the two
> 
> >rows only the first line is stored and the rest are ignored.
> 
> >
> 
> >The result of my select statement from the log4 table includes all
> 
> >null value on the first row and the value of the second line for the
> 
> >second row.
> 
> >
> 
> >Would appreciate if you can teach me how to debug the warning or maybe
> 
> >enlighten me on the cause of the problem.
> 
> >
> 
> >Thanks for all your help.
> 
> >
> 
> >Elizabeth
> 
> >
> 
> >On 6/24/05, Gleb Paharenko <[EMAIL PROTECTED]> wrote:
> 
> >
> 
> >>> Hello.
> 
> >>>
> 
> >>>
> 
> >>>
> 
> >>> What 'SHOW WARNINGS' reports?
> 
> 
> 
> Elizabeth Bonifacio <[EMAIL PROTECTED]> wrote:
> 
> 
> 
> --
> For technical s

Re: connection error from c application

2005-06-24 Thread Elizabeth Bonifacio
Dear Gleb,

Thanks, i will try that as well, so far my program can access the
server now by using the old password. Now my problem is when i load
file, its only reading the first line and some more insert a null
record before the ist record.

here is the result i get after loading the text file:
mysql> load data local infile 'syslog5.txt' into table log4 fields
terminated by ' \t' lines terminated by '\n';
Query OK, 2 rows affected, 513 warnings (0.03 sec)
Records: 20  Deleted: 0  Skipped: 18  Warnings: 505

the first record shows all null values on all columns
the second record is correct but it is the first line in my text file
the rest of the lines in the text file is ignored.

I tried creating a table for my pc event logs, its all working fine,
can load, and query from the c application.

Would appreciate if you guys can help.

Elizabeth



On 6/23/05, Gleb Paharenko <[EMAIL PROTECTED]> wrote:
> Hello.
> 
> 
> 
> I've compiled your code using libraries and includes from
> 
> MySQL-4.1.6 (yes, my testing environment isn'tperfect :) and
> 
> successfully connected to MySQL-4.1.10. Old passwords was off,
> 
> so I used a 4.1. authorization protocol.
> 
> 
> 
> 
> 
> Elizabeth Bonifacio <[EMAIL PROTECTED]> wrote:
> 
> > Dear All,
> 
> >
> 
> > I'm new into mysql and has been encountering huge problem in
> 
> > connecting to the database from the c application. The code execute
> 
> > with an error message :
> 
> > Failed to connect to database: Error:
> 
> > Client does not support authentication protocol requested by server;
> 
> > consider upgrading MySQL client
> 
> > Is this a bug?
> 
> >
> 
> > I'm running the MySql server version 4.1 with server and client both
> 
> > on same computer running on windows XP.
> 
> >
> 
> > I have no problem connecting to the server using root with a windfall
> 
> > password but  I cannot connect from the c application below.
> 
> >
> 
> > I have only one user in the server (root,windfall) and has been
> 
> > successful in accessing mysql from the client side except when
> 
> > connecting from a c application.
> 
> >
> 
> > here is the application which I compile using Visual C++ compiler:
> 
> >
> 
> > #include "stdio.h "
> 
> > #include "winsock.h"
> 
> > #include "iostream.h "
> 
> >
> 
> > #include "mysql.h"
> 
> >
> 
> > int main()
> 
> > {
> 
> >
> 
> > MYSQL mysql;
> 
> > MYSQL_ROW row;
> 
> > MYSQL_RES *result;
> 
> >
> 
> > unsigned int num_fields;
> 
> > unsigned int i;
> 
> > int num =3D 0;
> 
> > int iRetValue =3D 0;
> 
> >
> 
> > mysql_init(&mysql);
> 
> > //printf("%s",&mysql );
> 
> >
> 
> > if (!mysql_real_connect(&mysql,"localhost","root","windfall","mysql",3306,
> 
> > NULL,0))
> 
> > {
> 
> > fprintf(stderr, "Failed to connect to database: Error: \n%s\n",
> 
> > mysql_error(&mysql));
> 
> > }
> 
> > else
> 
> > {
> 
> > printf("SUCCESS\n");
> 
> > iRetValue =3D mysql_query(&mysql, "SELECT * FROM user");
> 
> >
> 
> > if( iRetValue !=3D 0 )
> 
> > {
> 
> > printf("Query Not Executed Properly.Please Check The Syntax.\n");
> 
> > }
> 
> > //here goes the error message :o)
> 
> > else
> 
> > {
> 
> > result =3D mysql_store_result(&mysql);
> 
> >
> 
> > num =3D mysql_field_count(&mysql);
> 
> > printf("Number Of Rows :%d\n",num );
> 
> >
> 
> > num_fields =3D mysql_num_fields( result);
> 
> > printf("Number Of Coloumns :%d\n",num_fields );
> 
> >
> 
> > while ((row =3D mysql_fetch_row(result)))
> 
> > {
> 
> > unsigned long *lengths;
> 
> > lengths =3D mysql_fetch_lengths(result);
> 
> >
> 
> > for(i =3D 0; i < num_fields; i++)
> 
> > {
> 
> > printf("[%.*s] \t", (int) lengths[i], row[i] ? row[i] : "NULL");
> 
> > }
> 
> > printf("\n");
> 
> > }
> 
> > }
> 
> > }
> 
> > }
> 
> >
> 
> > I would appreciate if you guys can help. thanks.
> 
> >
> 
> > Elizabeth
> 
> >
> 
> 
> 
> --
> For technical support contracts, goto https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.NET http://www.ensita.net/
>   __  ___ ___   __
>  /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
>  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
>   <___/   www.mysql.com
> 
> 
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 
>

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



connection error from c application

2005-06-23 Thread Elizabeth Bonifacio
Dear All,

I'm new into mysql and has been encountering huge problem in
connecting to the database from the c application. The code execute
with an error message :
Failed to connect to database: Error:
Client does not support authentication protocol requested by server;
consider upgrading MySQL client
Is this a bug?

I'm running the MySql server version 4.1 with server and client both
on same computer running on windows XP.

I have no problem connecting to the server using root with a windfall
password but  I cannot connect from the c application below.

I have only one user in the server (root,windfall) and has been
successful in accessing mysql from the client side except when
connecting from a c application.

here is the application which I compile using Visual C++ compiler:

#include "stdio.h "
#include "winsock.h"
#include "iostream.h "

#include "mysql.h"

int main()
{

MYSQL mysql;
MYSQL_ROW row;
MYSQL_RES *result;

unsigned int num_fields;
unsigned int i;
int num = 0;
int iRetValue = 0;

mysql_init(&mysql);
//printf("%s",&mysql );

if (!mysql_real_connect(&mysql,"localhost","root","windfall","mysql",3306,
NULL,0))
{
fprintf(stderr, "Failed to connect to database: Error: \n%s\n",
mysql_error(&mysql));
}
else
{
printf("SUCCESS\n");
iRetValue = mysql_query(&mysql, "SELECT * FROM user");

if( iRetValue != 0 )
{
printf("Query Not Executed Properly.Please Check The Syntax.\n");
}
//here goes the error message :o)
else
{
result = mysql_store_result(&mysql);

num = mysql_field_count(&mysql);
printf("Number Of Rows :%d\n",num );

num_fields = mysql_num_fields( result);
printf("Number Of Coloumns :%d\n",num_fields );

while ((row = mysql_fetch_row(result)))
{
unsigned long *lengths;
lengths = mysql_fetch_lengths(result);

for(i = 0; i < num_fields; i++)
{
printf("[%.*s] \t", (int) lengths[i], row[i] ? row[i] : "NULL");
}
printf("\n");
}
}
}
}

I would appreciate if you guys can help. thanks.

Elizabeth

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]