.NET Connector Output Values

2005-12-04 Thread Colin Shreffler

I have the following code:

...
query = INSERT INTO a_test_table 
(a_test_table_id,name,last_mod_date,create_date) VALUES 
(?a_test_table_id,?name,?last_mod_date,?create_date);

...
command.Prepare();
...
command.Parameters.Add(?a_test_table_id, MySqlDbType.Int32);
command.Parameters[?a_test_table_id].Direction = 
ParameterDirection.Output;

command.Parameters.Add(?name, this._name);
command.Parameters.Add(?last_mod_date, DateTime.Now);
command.Parameters.Add(?create_date, DateTime.Now);

command.ExecuteNonQuery();

this.ID = 
System.Convert.ToInt32(command.Parameters[?a_test_table_id].Value.ToString());


When I try to retrieve the return value for ?a_test_table_id, I get an 
error saying the Value property is NULL.


The column in the database is set to auto-increment.  Shouldn't this 
parameter be populated automatically?  Any ideas why this is happening?




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



Band width consume

2005-12-04 Thread Luiz Rafael Culik Guimaraes

Dear Friends

Is their an Page with data of how much bandwidth mysql consume when using 
remote servers?


Regards
Luiz 



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



Re: /etc/init.d/mysql hangs

2005-12-04 Thread Timothy Wu
On 12/3/05, Gleb Paharenko [EMAIL PROTECTED] wrote:

 Hello.



 Check if you're able to start server manually using mysqld

 or mysqld_safe commands. Research error logs. See:

   http://dev.mysql.com/doc/refman/5.0/en/starting-server.html





Thanks. Running mysqld directly showed me the problem which is a full hard
disk partition.

Timothy


Band width consume

2005-12-04 Thread Luiz Rafael Culik Guimaraes

Dear Friends

Is their an Page with data of how much bandwidth mysql consume when using 
remote servers?


Regards
Luiz 



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



Re: Band width consume

2005-12-04 Thread Mike OK
I don't have any stats but I would assume it's as big as your select
statement plus as big as the result set. Mike


- Original Message -
From: Luiz Rafael Culik Guimaraes [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: December 4, 2005 7:02 AM
Subject: Band width consume


 Dear Friends

 Is their an Page with data of how much bandwidth mysql consume when using
 remote servers?

 Regards
 Luiz


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



 --
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date:
2005-12-02




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



Re: Band width consume

2005-12-04 Thread Cal Evans
The bandwidth that mysql itself consumes is negligible. If you are 
connecting to a server across the net the majority of your bandwidth 
consumed is your result sets coming back.


If you are talking about a single database then figure out what your 
average result set is and multiply that times the number of times you 
make that call in a given time period.  You'll be real close.  The only 
other bandwidth consumed is your setup. If you are using SSL then it's a 
little more but not much. There are the bytes it takes to transmit your 
user name and password and the bytes it takes for the server to respond 
positively. But all of these pale in comparison to most recordsets.


=C=
|
| Cal Evans
| http://www.calevans.com
|

Luiz Rafael Culik Guimaraes wrote:

Dear Friends

Is their an Page with data of how much bandwidth mysql consume when 
using remote servers?


Regards
Luiz



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



parse error creating table

2005-12-04 Thread Ferindo Middleton Jr
I have been trying to create a table but mysql 5.0.15-nt-max is having a 
problem parsing the statement. Anyone know what the problem is in the 
syntax of the following table creation statement:


CREATE TABLE registration_and_attendance (
idSERIAL NOT NULL UNIQUE,
firstnameVARCHAR(256) NOT NULL,
middlenameTEXT,
lastnameVARCHAR(256),
suffix  TEXT,
sf182_receivedBOOLEAN NOT NULL DEFAULT TRUE,
registrant_email_address   TEXT,
cc_email_list   TEXT,
bureau_id  INTEGER REFERENCES bureaus(id),
office  TEXT,
class_id  INTEGER NOT NULL REFERENCES 
classes(id),

schedule_id  INTEGER REFERENCES schedules(id),
start_date  DATE,
end_date   DATE,
enrolled  BOOLEAN,
attendedBOOLEAN,
completed  BOOLEAN,
cancelledBOOLEAN DEFAULT FALSE,
cancelled_commentsTEXT,
comments   TEXT,
email_confirmation_sent  BOOLEAN NOT NULL,  
 employment_status_id  INTEGER REFERENCES employment_statuses(id) NOT NULL,

last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
last_user_updated   TEXT,
waitlisted BOOLEAN DEFAULT FALSE,
overflow_registrantBOOLEAN DEFAULT FALSE,
attach_hotel_listing_directions BOOLEAN,
instructor_legacy TEXT,
time_legacy TIME WITHOUT TIME ZONE,
ssn_legacy   TEXT,
position_grade_title TEXT,
office_phone_legacy  TEXT,
contractor_legacy   BOOLEAN,
no_show_legacy BOOLEAN,
status_legacy TEXT,
   funding_id  INTEGER REFERENCES funding_types(id),
 PRIMARY KEY (firstname, lastname, class_id, start_date, end_date)
);

I get the following error message with the above statement but I can't 
figure out what the problem is:


ERROR 1064 (42000): You have an error in your SQL syntax; check the 
manual that
corresponds to your MySQL server version for the right syntax to use 
near 'NOT N

ULL,
last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
l' at line 23


Thanks, Ferindo

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



INSERTS slower after upgrade from 4.0 to 5.0?

2005-12-04 Thread PgmHelmi

Hello!

I wanted to upgrade from 4.0.16 to 5.0.16, but already notized a slow 
performance on restoring data with INSERTS.


When dumping a table with mysqldump (4.0.16) and then restoring it with 
mysql , which consists only of

INSERTS, the duration increases.
For test reasons I have tried it with 2 tables and different mysql 
versions:


test_01
=

CREATE TABLE test_01 (
 ID int(6) unsigned NOT NULL auto_increment,
 Name varchar(60) NOT NULL default '',
 PRIMARY KEY  (ID)
) TYPE=MyISAM;

1.284.256 rows, dump file size 69 MB

test_02
=

CREATE TABLE test_02 (
 ID int(6) unsigned NOT NULL auto_increment,
 Freq int(5) unsigned NOT NULL default '0',
 UK0 tinyint(2) NOT NULL default '0',
 UK1 tinyint(2) NOT NULL default '0',
 UK2 tinyint(2) NOT NULL default '0',
 UK3 tinyint(2) NOT NULL default '0',
 UK4 tinyint(2) NOT NULL default '0',
 UK5 tinyint(2) NOT NULL default '0',
 UG1 tinyint(2) NOT NULL default '0',
 UG2 tinyint(2) NOT NULL default '0',
 UG3 tinyint(2) NOT NULL default '0',
 UG4 tinyint(2) NOT NULL default '0',
 UG5 tinyint(2) NOT NULL default '0',
 UG6 tinyint(2) NOT NULL default '0',
 HK0 tinyint(2) NOT NULL default '0',
 HK1 tinyint(2) NOT NULL default '0',
 HK2 tinyint(2) NOT NULL default '0',
 HK3 tinyint(2) NOT NULL default '0',
 HK4 tinyint(2) NOT NULL default '0',
 HK5 tinyint(2) NOT NULL default '0',
 HG1 tinyint(2) NOT NULL default '0',
 HG2 tinyint(2) NOT NULL default '0',
 HG3 tinyint(2) NOT NULL default '0',
 HG4 tinyint(2) NOT NULL default '0',
 HG5 tinyint(2) NOT NULL default '0',
 HG6 tinyint(2) NOT NULL default '0',
 WK0 tinyint(2) NOT NULL default '0',
 WK1 tinyint(2) NOT NULL default '0',
 WK2 tinyint(2) NOT NULL default '0',
 WK3 tinyint(2) NOT NULL default '0',
 WK4 tinyint(2) NOT NULL default '0',
 WK5 tinyint(2) NOT NULL default '0',
 WG1 tinyint(2) NOT NULL default '0',
 WG2 tinyint(2) NOT NULL default '0',
 WG3 tinyint(2) NOT NULL default '0',
 WG4 tinyint(2) NOT NULL default '0',
 WG5 tinyint(2) NOT NULL default '0',
 WG6 tinyint(2) NOT NULL default '0',
 PRIMARY KEY  (ID)
) TYPE=MyISAM;

1.284.256 rows, dump file size 127 MB


As you can see no other indexes than PRIMARY KEY are used.

My configuration:
AMD-1200
768 MB RAM
Windows 2000
Connection via named pipe
table type MyISAM
used server is mysqld-nt from no-install zip version
Start server with: mysqld-nt --standalone

Important options from my.ini for 4.0 and 4.1 which I used:
---

[mysqld]
enable-named-pipe
skip-locking
default-character-set=latin1
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=128K
set-variable = flush_time=1800


Important options from my.ini for 5.0 which I used:
---

I took my-large.ini as base.

enable-named-pipe
skip-locking
skip-safemalloc
skip-networking
skip-external-locking
skip-innodb

I switched off all logs.

Comparing:


Version - test_01 - test_02

4.0.16 - 24 sec - 1:55 min
4.0.25 - 25 sec - 1:53 min

4.1.03b - 34 sec - 2:19 min
4.1.15 - 31 sec - 2:14 min

5.0.03b - 34 sec - 3:28 min
5.0.15 - 37 sec - 3:26 min
5.0.16 - 38 sec - 3:28 min

I tried out some other adviced performance tunings, but got no improvement.
I have noticed that it is not a matter of index, but a matter of data 
volume which is restored.


So my questions are why became INSERTS slower and is there some option 
to make them faster in 5.0 as they were in 4.0?


Thank you for your answer in advance!

Helmuth


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



triggers? when they execute and locking

2005-12-04 Thread Ben De Luca
Im am trying to implement a task running system with mysql and Im  
coming across a few problems with what I am trying to do.



Simply I am trying to insert a list of tasks into the DB for various  
computers to run, I want to track when they ran and where they ran. I  
also have to limit some of the types of tasks that can run, so no  
more than 5 of TYPEA can run concurrently.



What i have is a table called tasks

TID (int)
status enum(waiting, completed, failed)
ResourceID  (int)
task descriptor  varchar (so I know what to run)

I also have a table
Resource
ResourceID   (int)
total   (int)
used(int)


So I do a select
select * from tasks left join resource on  
tasks.resourceID=Resource.Resource.id

where status='waiting'
   and ((resource.used=Resource.total +1)  or 
resource.id in null)
  limit 1 for update;

Next my code runs an update
update tasks set status='waiting' where TID=value from above;

NOTE: that I have to use Resource.used=Resource.total +1 because  
Resource.usedResource.total does not seem to be equivilent



Though I still need to update the Resource counter.

So I have a trigger on BEFORE UPDATE tasks; That calls a Stored  
procedure. that  increments the Resource.used


The Way I understand it the order for operations is

Select
Triggered from Update
Stored Procedure (called from the trigger)
Update

And rows used in the Select should be locked until after the update.  
This all happens very fast but when I have around 10 threads all  
connected to the DB running tasks, I tend to find that the locking  
does not work. The Trigger that exists before UPDATE actualy happens  
after.



Is this a bug or is it meant to be like this?

bd




















Re: parse error creating table

2005-12-04 Thread Peter Brawley

Ferindo

One problem is:
  employment_status_id  INTEGER REFERENCES employment_statuses(id) NOT 
NULL,

NOT NULL should be before REFERENCES.

Also, in:
  last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
 (i) NOT NULL is superfluous since the default is given by 
CURRENT_TIMESTAMP.
 (ii) specifying DEFAULT CURRENT_TIMESTAMP defeats auto-resetting of 
the timestamp on updates. Is

that what you want? To get auto-setting on INSERTs and UPDATEs, just write
 last_updated TIMESTAMP,
Also the manual doesn't mention TIME WITHOUT TIME ZONE. Are you thinking 
of PostgreSQL?


PB

-

Ferindo Middleton Jr wrote:

I have been trying to create a table but mysql 5.0.15-nt-max is having 
a problem parsing the statement. Anyone know what the problem is in 
the syntax of the following table creation statement:


CREATE TABLE registration_and_attendance (
idSERIAL NOT NULL UNIQUE,
firstnameVARCHAR(256) NOT NULL,
middlenameTEXT,
lastnameVARCHAR(256),
suffix  TEXT,
sf182_receivedBOOLEAN NOT NULL DEFAULT TRUE,
registrant_email_address   TEXT,
cc_email_list   TEXT,
bureau_id  INTEGER REFERENCES 
bureaus(id),

office  TEXT,
class_id  INTEGER NOT NULL REFERENCES 
classes(id),
schedule_id  INTEGER REFERENCES 
schedules(id),

start_date  DATE,
end_date   DATE,
enrolled  BOOLEAN,
attendedBOOLEAN,
completed  BOOLEAN,
cancelledBOOLEAN DEFAULT FALSE,
cancelled_commentsTEXT,
comments   TEXT,
email_confirmation_sent  BOOLEAN NOT 
NULL,   employment_status_id  INTEGER REFERENCES 
employment_statuses(id) NOT NULL,

last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
last_user_updated   TEXT,
waitlisted BOOLEAN DEFAULT FALSE,
overflow_registrantBOOLEAN DEFAULT FALSE,
attach_hotel_listing_directions BOOLEAN,
instructor_legacy TEXT,
time_legacy TIME WITHOUT TIME ZONE,
ssn_legacy   TEXT,
position_grade_title TEXT,
office_phone_legacy  TEXT,
contractor_legacy   BOOLEAN,
no_show_legacy BOOLEAN,
status_legacy TEXT,
   funding_id  INTEGER REFERENCES funding_types(id),
 PRIMARY KEY (firstname, lastname, class_id, start_date, 
end_date)

);

I get the following error message with the above statement but I can't 
figure out what the problem is:


ERROR 1064 (42000): You have an error in your SQL syntax; check the 
manual that
corresponds to your MySQL server version for the right syntax to use 
near 'NOT N

ULL,
last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
l' at line 23


Thanks, Ferindo




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 12/2/2005


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



ERROR 2003 (HY000): Can't connect to MySQL server on 'gandalf' (111)

2005-12-04 Thread Mike Smith
Hi,

I've been dealing with this problem for a week now
without resolution.
I'm running an application called mythtv which uses
mysql as its database.
I've installed mythtv and mysql dozens of times
without any problem.

I'd been running two Mandrake 10.1 systems for the
last nine months. One,
gandalf, was the mythtv backend server which also runs
mysql.  The other is
frodo, which runs the mythtfrontend ( client ) and
connects to the backend.
It must also connect to the mysql DB.
MySQL-4.0.20-3mdk.i586.rpm comes with
the Mandrake 10.1 distribution.  I don't know which
version of mysql that
equates to.

I first installed Mandrivia 2006 on the client system,
which comes with 
Mysql 4.1.2 ( MySQL-4.1.12-3mdk.i586.rpm ).  I did an
install, not an
upgrade.  I could still connect to gandalf with:

mysql -umythtv -pmythtv -hgandalf mythconverg

I then did a mysqldump on mythconverg and install
Mandrivia 2006 on 
server gandalf.  I restored the mythconverg;  Now,  I
get:

[EMAIL PROTECTED] mysql -u mythtv -pmythtv -h gandalf
mythconverg
ERROR 2003 (HY000): Can't connect to MySQL server on
'gandalf' (111)

I then tried granting privledges to mythconverg using
on the server
gandalf:

# mysql -u root mythconverg
mysql grant all on mythconverg.* to mythtv@%
identified by mythtv;
mysql flush privileges;

Still can't connect.

I booted off the old installation and did a mysql dump
of mysql database
and did inserts of the appropriate tables, like the
user table.  Still
can't connect.

I've droped the mythconverg database, recreated a
skeleton of it, granted
the open privledges and still can not connect to it.

Another fact:  on the server gandalf,  I can connect
to the database
as localhost, but not if I specify the host:

gandalf# mysql -u mythtv -pmythtv mythconverg 
Success!!

gandalf# mysql -u mythtv -pmythtv -h gandalf
mythconvergFailure!!

gandalf# mysql -u mythtv -pmythtv -h 10.0.1.40
mythconverg Failure!!

gandalf# mysql -u mythtv -pmythtv -h 127.0.0.1
mythconverg Success!!

gandalf# mysql -u mythtv -pmythtv -h localhost
mythconverg  Success!!

I've already check my /etc/my.cnf file for a binding
line.  Its not 
there.  I also found an item online that indicated
adding:

skip-innodb
set-variable=thread_stack=256k

to /etc/my.cnf was needed for mysql under Mandrake. 
Still no help.


Also,  I can resolve the name/ip of both hosts from
both hosts.  I
can ping each host ( by name ) both ways.  I can ssy (
by name ) between
both hosts.

Thanks,

Mike




__ 
Start your day with Yahoo! - Make it your home page! 
http://www.yahoo.com/r/hs

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



Re: parse error creating table

2005-12-04 Thread Ferindo Middleton Jr
Thanks Peter. I did originally use this table in a Postgresql db. Thanks 
for you advice. Your suggestions below allowed me to create this table 
and I learned a thing t two about proper usage of the TIMESTAMP data 
type. The intended effect is to get a timestamp field that inserts the 
current system time on inserts and continues to update the field with 
the current timestamp on updates without the application or use needing 
to specify it are you saying that the timestamp attribute alone will 
do that?


Ferindo

Peter Brawley wrote:

Ferindo

One problem is:
  employment_status_id  INTEGER REFERENCES employment_statuses(id) NOT 
NULL,

NOT NULL should be before REFERENCES.

Also, in:
  last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
 (i) NOT NULL is superfluous since the default is given by 
CURRENT_TIMESTAMP.
 (ii) specifying DEFAULT CURRENT_TIMESTAMP defeats auto-resetting of 
the timestamp on updates. Is
that what you want? To get auto-setting on INSERTs and UPDATEs, just 
write

 last_updated TIMESTAMP,
Also the manual doesn't mention TIME WITHOUT TIME ZONE. Are you 
thinking of PostgreSQL?


PB

-

Ferindo Middleton Jr wrote:

I have been trying to create a table but mysql 5.0.15-nt-max is 
having a problem parsing the statement. Anyone know what the problem 
is in the syntax of the following table creation statement:


CREATE TABLE registration_and_attendance (
idSERIAL NOT NULL UNIQUE,
firstnameVARCHAR(256) NOT NULL,
middlenameTEXT,
lastnameVARCHAR(256),
suffix  TEXT,
sf182_receivedBOOLEAN NOT NULL DEFAULT TRUE,
registrant_email_address   TEXT,
cc_email_list   TEXT,
bureau_id  INTEGER REFERENCES 
bureaus(id),

office  TEXT,
class_id  INTEGER NOT NULL REFERENCES 
classes(id),
schedule_id  INTEGER REFERENCES 
schedules(id),

start_date  DATE,
end_date   DATE,
enrolled  BOOLEAN,
attendedBOOLEAN,
completed  BOOLEAN,
cancelledBOOLEAN DEFAULT FALSE,
cancelled_commentsTEXT,
comments   TEXT,
email_confirmation_sent  BOOLEAN NOT 
NULL,   employment_status_id  INTEGER REFERENCES 
employment_statuses(id) NOT NULL,

last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
last_user_updated   TEXT,
waitlisted BOOLEAN DEFAULT FALSE,
overflow_registrantBOOLEAN DEFAULT FALSE,
attach_hotel_listing_directions BOOLEAN,
instructor_legacy TEXT,
time_legacy TIME WITHOUT TIME ZONE,
ssn_legacy   TEXT,
position_grade_title TEXT,
office_phone_legacy  TEXT,
contractor_legacy   BOOLEAN,
no_show_legacy BOOLEAN,
status_legacy TEXT,
   funding_id  INTEGER REFERENCES funding_types(id),
 PRIMARY KEY (firstname, lastname, class_id, start_date, 
end_date)

);

I get the following error message with the above statement but I 
can't figure out what the problem is:


ERROR 1064 (42000): You have an error in your SQL syntax; check the 
manual that
corresponds to your MySQL server version for the right syntax to use 
near 'NOT N

ULL,
last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
l' at line 23


Thanks, Ferindo






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



Re: parse error creating table

2005-12-04 Thread Peter Brawley

Hi Ferindo

The intended effect is to get a timestamp field that inserts the 
current system
time on inserts and continues to update the field with the current 
timestamp
on updates without the application or use needing to specify it 
are you

saying that the timestamp attribute alone will do that?

Yep. Try...

create table ts(i int,ts timestamp);
insert into ts values(1,null);
select * from ts;
+--+-+
| i| ts  |
+--+-+
|1 | 2005-12-04 17:21:01 |
+--+-+
update ts set i=2;
select * from ts;
+--+-+
| i| ts  |
+--+-+
|2 | 2005-12-04 17:21:13 |
+--+-+

PB
http://www.artfulsoftware.com

-


Ferindo Middleton Jr wrote:

Thanks Peter. I did originally use this table in a Postgresql db. 
Thanks for you advice. Your suggestions below allowed me to create 
this table and I learned a thing t two about proper usage of the 
TIMESTAMP data type. The intended effect is to get a timestamp field 
that inserts the current system time on inserts and continues to 
update the field with the current timestamp on updates without the 
application or use needing to specify it are you saying that the 
timestamp attribute alone will do that?


Ferindo

Peter Brawley wrote:


Ferindo

One problem is:
  employment_status_id  INTEGER REFERENCES employment_statuses(id) 
NOT NULL,

NOT NULL should be before REFERENCES.

Also, in:
  last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
 (i) NOT NULL is superfluous since the default is given by 
CURRENT_TIMESTAMP.
 (ii) specifying DEFAULT CURRENT_TIMESTAMP defeats auto-resetting of 
the timestamp on updates. Is
that what you want? To get auto-setting on INSERTs and UPDATEs, just 
write

 last_updated TIMESTAMP,
Also the manual doesn't mention TIME WITHOUT TIME ZONE. Are you 
thinking of PostgreSQL?


PB

-

Ferindo Middleton Jr wrote:

I have been trying to create a table but mysql 5.0.15-nt-max is 
having a problem parsing the statement. Anyone know what the problem 
is in the syntax of the following table creation statement:


CREATE TABLE registration_and_attendance (
idSERIAL NOT NULL UNIQUE,
firstnameVARCHAR(256) NOT NULL,
middlenameTEXT,
lastnameVARCHAR(256),
suffix  TEXT,
sf182_receivedBOOLEAN NOT NULL DEFAULT 
TRUE,

registrant_email_address   TEXT,
cc_email_list   TEXT,
bureau_id  INTEGER REFERENCES 
bureaus(id),

office  TEXT,
class_id  INTEGER NOT NULL 
REFERENCES classes(id),
schedule_id  INTEGER REFERENCES 
schedules(id),

start_date  DATE,
end_date   DATE,
enrolled  BOOLEAN,
attendedBOOLEAN,
completed  BOOLEAN,
cancelledBOOLEAN DEFAULT FALSE,
cancelled_commentsTEXT,
comments   TEXT,
email_confirmation_sent  BOOLEAN NOT 
NULL,   employment_status_id  INTEGER REFERENCES 
employment_statuses(id) NOT NULL,

last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
last_user_updated   TEXT,
waitlisted BOOLEAN DEFAULT FALSE,
overflow_registrantBOOLEAN DEFAULT FALSE,
attach_hotel_listing_directions BOOLEAN,
instructor_legacy TEXT,
time_legacy TIME WITHOUT TIME ZONE,
ssn_legacy   TEXT,
position_grade_title TEXT,
office_phone_legacy  TEXT,
contractor_legacy   BOOLEAN,
no_show_legacy BOOLEAN,
status_legacy TEXT,
   funding_id  INTEGER REFERENCES 
funding_types(id),
 PRIMARY KEY (firstname, lastname, class_id, start_date, 
end_date)

);

I get the following error message with the above statement but I 
can't figure out what the problem is:


ERROR 1064 (42000): You have an error in your SQL syntax; check the 
manual that
corresponds to your MySQL server version for the right syntax to use 
near 'NOT N

ULL,
last_updated TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
l' at line 23


Thanks, Ferindo









--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 12/2/2005


--
MySQL General Mailing List
For list archives: 

sporadic batch update problem

2005-12-04 Thread Jeff Drew
Sporadically, the last few entries of a batch are not written.  I'm writing
to a mysql database using JDBC.   Here's a short version of my code.  Does
anyone have suggestions on possible causes or other diagnostics?

class DatabaseWriter{

int writeCount=0;

public DatabaseWriter(){

  PreparedStatement preparedStatement = connection.prepareStatement(insert
into   msgpersecond ( time , count , sendercompid , targetcompid )
values ( ? , ? , ? , ?  ));

  connection.setAutoCommit( false ); // turn off auto-Commit
}

public void process(Object input){

  preparedStatement.setFloat( 2 , event.msgPerSecond );
  preparedStatement.addBatch( );
  writeCount++:

  if (writeCount  50) {
updateCounts = preparedStatement.executeBatch( );
connection.commit( );

preparedStatement.clearBatch( );
writeCount=0;
  }

}
}

process() gets called a lot.  The code usually works fine, but sometimes 3
to 20 or so records that definitely are added to the batch but don't get
written.

I'd greatly appreciate any suggestions.

Thanks


Re: ERROR 2003 (HY000): Can't connect to MySQL server on 'gandalf' (111)

2005-12-04 Thread Simon Garner

On 5/12/2005 11:56 a.m., Mike Smith wrote:

Hi,



Hi,


I've already check my /etc/my.cnf file for a binding
line.  Its not 
there.  I also found an item online that indicated

adding:



Look for the option skip-networking. This disables TCP/IP so the 
server only accepts local connections via the Unix socket. This sounds 
like your situation.


Note that a could not connect error means just that. If the problem 
was related to user privileges you would get an access denied error.


HTH,
-Simon

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



Re: Moving databases from backups not working . . .

2005-12-04 Thread Curious George
Thanks for the replies so far,
I still haven't got this figured out, but I left out one important
piece of information. I'm moving 3.23 databases to a 4.1 installation.
Looking at the documentation, I see instructions for upgrading from
3.23 to 4.0 and then upgrading from 4.0 to 4.1. Does that mean that I
can't just move databases from a machine that was 3.23 to a machine
that is 4.1?

I have the entire old mysql/data folder copied to the new machine (in
my user folder - not in the new mysql/data folder).

The original machine is not really working at the moment - a kernel
panic caused by I-don't-know-what. But I've replicated everything
important from it to the new machine and want to do the same with the
mysql databases, except I'm running into this how to move 3.23
databases into a 4.1 installation problem.

Any suggestions, now that I have made the problem a little clearer?

TIA

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



MySQL 5 is 25% slower then 4.1

2005-12-04 Thread Chenzhou Cui

Dear  MySQL fans,

I have a 260 GB huge file with 1045175762 rows. Two weeks ago, I wrote a 
Java program to read the huge plain text file into MySQL 4.1.12.  300 
million of rows could be loaded in one day.


Last Thursday, I updated the MySQL to 5.0.16 and then run the same 
program. Only 225 million of rows can be loaded in one day.


In additional to the version difference, the MySQL 4.1.12 was compiled 
from SRPM packages from RedHat Updates, while the MySQL 5.0.16 is 
installed directly using the MySQL binary RPM packages for Redhat AS 4.


Any information and suggestion are welcome.

Regards,
Chenzhou CUI


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