Re: timestamp

2005-12-18 Thread Richard AB

Hello.

   Have you checked if the timestamp column is set with CURRENT_TIMESTAMP as 
the default value?
   If it doesnt, you can try this:

   ALTER TABLE tbl MODIFY column TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP;

   And mysql will fill the column with current timestamp when a new row is 
appended or when a old
one is updated.

   It seems that MySQL timestamp have changed a lot in 4.1 version.

Good luck!


Richard AB


- Original Message - 
From: [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Sunday, December 18, 2005 5:03 PM
Subject: timestamp



hi!
I'm using mysql 4.1 and I have a problem with a TIMESTAMP column (with all of 
them actually). I've
used them before in mysql 3.x and they worked just fine. And at first I thought 
'they changed
something', but in the mysql 4.1 manual it still says

A TIMESTAMP column is useful for recording the date and time of an INSERT or 
UPDATE operation.
The first TIMESTAMP column in a table is automatically set to the date and time 
of the most recent
operation if you do not assign it a value yourself. You can also set any 
TIMESTAMP column to the
current date and time by assigning it a NULL value.

But when I try to insert a row into a simple table like this insert into test 
set
txt='something', the field data, which is of type TIMESTAMP, doesn't 
initiate with the current
date, but turns out to be '-00-00 00:00:00'. I've also tried with update, 
and with other
tables too. The same thing.

Could anyone please help?
Thanks.


--
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.371 / Virus Database: 267.14.1/204 - Release Date: 15/12/2005






--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/204 - Release Date: 15/12/2005


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



Re: mysqldump: getting it to dump INSERT IGNORE

2005-12-11 Thread Richard AB

Hi.

   Use the --insert-ignore option of mysqldump.

   You can type 'mysqldump --help' on command line to see all options available.



Richard AB.


- Original Message - 
From: Michael Williams [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Sunday, December 11, 2005 6:19 PM
Subject: mysqldump: getting it to dump INSERT IGNORE



Hi All,

I have read thehttp://dev.mysql.com/doc/refman/5.0/en/ 
mysqldump.html and can find nothing regarding getting dump to  
INSERT IGNORE instead of simply INSERT INTO.  Is there any way to get  
INSERT IGNORE to be dumped?  Otherwise, I fear I may be forced to  
parse the dump file and do a few replacements.


Regards,
Michael

--
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.371 / Virus Database: 267.13.13/197 - Release Date: 09/12/2005





--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.13/197 - Release Date: 09/12/2005


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



Re: mysqldump: INSERTS for each individual record.

2005-12-10 Thread Richard AB
hello there..

mysqldump has a option called --opt that dump your data in that way. 
This is the default option for
new versions of mysqldump.
--opt is the equivalent of  typing --add-drop-table, 
add-locks, --create-options, --quick,
--extended-insert, --lock-tables, --set-charset and --disable-keys.

The --extended-insert option is responsible for the behavior you´re 
getting in inserts statement.

To avoid the --opt option use --skip-opt option and inform other options 
separately...

good luck!!!


Richard AB.


- Original Message - 
From: Michael Williams [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Saturday, December 10, 2005 9:50 PM
Subject: mysqldump: INSERTS for each individual record.


When performing  mysqldump  is there any way to ensure that each
record gets an INSERT of it's own?  I keep getting the following:

INSERT INTO  'mytable' (1,'test item'), (2,'test item'), (3,'test
item'), (4,'test item'), (5,'test item');

but I'd rather have

INSERT INTO  'mytable' (1,'test item');
INSERT INTO  'mytable' (2,'test item');
INSERT INTO  'mytable' (3,'test item');
INSERT INTO  'mytable' (4,'test item');
INSERT INTO  'mytable' (5,'test item');

because I'm doing my own line diff between files and it's much easier
for me to have the items on individual lines.  Any assistance would
be appreciated.

Regards,
Michael

-- 
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.371 / Virus Database: 267.13.12/194 - Release Date: 07/12/2005




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.13.12/194 - Release Date: 07/12/2005


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