Re: 回复: mysql transaction log

2010-05-04 Thread Claudio Nanni

MySQL does not have a thing such the Oracle transaction log.
But it has the Binary  Log used by replication,
for this reason the binary log is server level and it is "decoupled" 
from the storage engine concept.
Basically (if we consider the old good "statement" format) it is just a 
file with commands that were executed on the master,

and then they are passed to the slaves, if any.
If you have the "binlog" option enabled on your server (this is the only 
requirement for a server to work as a 'master')
you will have a set of log files (in binary format for compression 
basically) that will contain all statement executed on the server

that changed data, this means no "select" statements.
It is quite easy to imagine that if you have this logging enabled from 
the birth of the server keeping all binary logs will allow you to

'replay' logs on another server and rebuild the same situation.
To read the content of the binary logs MySQL provides the utility 
[mysqlbinlog].


Just a splash on binary logging!

Read also on MySQL manual, it is a good exercise.

Cheers,

Claudio

On 5/4/2010 8:58 AM, Timo wrote:

InnoDB support transaction. MyISAM does not support trantsaction.

http://www.databasejournal.com/features/mysql/article.php/3382171/Transactions-in-MySQL.htm

2010-05-04



Best regards
Timo Seven
blog: http://zauc.wordpress.com
#请翻墙浏览,或者指定hosts到74.200.243.252###
twitter: https://twitter.com/zauc
##也请翻墙浏览
UNIX System Admin&  MySQL DBA



发件人: Angelina Paul
发送时间: 2010-05-04 06:20
主 题: mysql transaction log
收件人: mysql@lists.mysql.com



Please help me to understand more about the mysql transaction log (
mysqlbinlog) file and its contents. Will it support only the innodb or all
the storage engine types like MyISAM, InnoDB?

Thanks,

Arsh Paul





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Best Bin log - type in MYSQL

2010-05-04 Thread Vikram A
Sir,

I am Sorry,

My request is related to "binlog_format" variable.


Thank you



From: ewen fortune 
To: Vikram A 
Cc: MY SQL Mailing list 
Sent: Tue, 4 May, 2010 3:31:44 PM
Subject: Re: Best Bin log - type in MYSQL

Vikram,

> I am using win-server and xp for my master, slave setup. when i do the 
> beginTrans with bin-log = STATEMENT it is causing error. If i defined this 
> with any one of the following, its working quite fine. MIXED, ROW.
>
> Which is the best one in the above two? Or how it differs?
> Can I have your explanations?

I think you are mixing up your log-bin and binlog_format variables.
The first of which turns on binary logging and optionally takes a
filename as an argument, the second controls the binary log format
which can be STATEMENT, ROW or MIXED.

http://dev.mysql.com/doc/refman/5.1/en/replication-options-binary-log.html#option_mysqld_log-bin

http://dev.mysql.com/doc/refman/5.1/en/binary-log-formats.html


Ewen

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=vikkiatb...@yahoo.in



Re: remote mysqldump to csv (--tab)

2010-05-04 Thread walter harms

you can circumvent the problem by using stdout.
just drop the "INTO OUTFILE '/tmp/result.txt'".
the result should look something like that:

mysql -BAN  -e "select ..." >filename

you can also pipe truh gzip to compress the file and save
a lot of space.
re,
 wh


note: i found ";" is not a good separator since people
may use ; in comments, i prefer "|" for that reason.

Marijn Vandevoorde schrieb:
> Thank you for replying Carlos, but I'm under the impression that this
> will also put the file on the server. Acutally, mysqldump --tab uses
> INTO OUTFILE to generate the dump if i'm not mistaken
> 
> Carlos Eduardo Caldi wrote:
>> Hi
>>
>> You can use on shell, connect at the client mysq -h (host or IP)
>> -p(password)
>>
>> and run the query:
>>
>> SELECT a, b, c INTO OUTFILE '/tmp/result.txt'
>>   FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"'
>>   LINES TERMINATED BY '\n'
>>   FROM test_table
>>
>> more info see the link
>> http://dev.mysql.com/doc/refman/5.0/en/select-into-statement.html
>>
>>  
>> Carlos Caldi
>>
>>
>>
>> > Date: Wed, 28 Apr 2010 14:11:14 +0200
>> > From: ma...@psb.vib-ugent.be
>> > To: mysql@lists.mysql.com
>> > Subject: remote mysqldump to csv (--tab)
>> >
>> > Hi all,
>> >
>> > posted this in the backup list, but that one seems to be pretty
>> dead, so i'll try my luck again here:
>> >
>> >
>> > We're currently looking for a way to backup a pretty big mysql table to
>> > a csv file. However, we don't want to allow the user ssh or file access
>> > to the server, so it'd have to happen remotely. the --tab/-T option
>> > allows exporting to csv, but not remotely.
>> > So we're looking for a way to have mysqldump store these files
>> remotely,
>> > on the client where mysqldump is executed.
>> > I've been looking up and down, only to find bad news, so I'm pretty
>> sure
>> > it's just not possible. I know there are ways to do this (little script
>> > to convert the sql to csv, or pipe it all through sed), but we were
>> just
>> > wondering if we're really not overlooking a nifty option in
>> mysqldump :-)
>> >
>> > Thanks in advance
>> >
>> > mavoo
>> >
>> >
>> > --
>> > MySQL General Mailing List
>> > For list archives: http://lists.mysql.com/mysql
>> > To unsubscribe: http://lists.mysql.com/mysql?unsub=ce_ca...@hotmail.com
>> >
>>
>> 
>> Cansado de entrar em todas as suas diferentes contas de email? Veja
>> como juntar todas
>> 
>>
> 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: Best Bin log - type in MYSQL

2010-05-04 Thread ewen fortune
Vikram,

> I am using win-server and xp for my master, slave setup. when i do the 
> beginTrans with bin-log = STATEMENT it is causing error. If i defined this 
> with any one of the following, its working quite fine. MIXED, ROW.
>
> Which is the best one in the above two? Or how it differs?
> Can I have your explanations?

I think you are mixing up your log-bin and binlog_format variables.
The first of which turns on binary logging and optionally takes a
filename as an argument, the second controls the binary log format
which can be STATEMENT, ROW or MIXED.

http://dev.mysql.com/doc/refman/5.1/en/replication-options-binary-log.html#option_mysqld_log-bin

http://dev.mysql.com/doc/refman/5.1/en/binary-log-formats.html


Ewen

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: remote mysqldump to csv (--tab)

2010-05-04 Thread Marijn Vandevoorde
Thank you for replying Carlos, but I'm under the impression that this 
will also put the file on the server. Acutally, mysqldump --tab uses 
INTO OUTFILE to generate the dump if i'm not mistaken


Carlos Eduardo Caldi wrote:

Hi

You can use on shell, connect at the client mysq -h (host or IP) 
-p(password)


and run the query:

SELECT a, b, c INTO OUTFILE '/tmp/result.txt'
  FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\n'
  FROM test_table

more info see the link
http://dev.mysql.com/doc/refman/5.0/en/select-into-statement.html

  


Carlos Caldi



> Date: Wed, 28 Apr 2010 14:11:14 +0200
> From: ma...@psb.vib-ugent.be
> To: mysql@lists.mysql.com
> Subject: remote mysqldump to csv (--tab)
>
> Hi all,
>
> posted this in the backup list, but that one seems to be pretty 
dead, so i'll try my luck again here:

>
>
> We're currently looking for a way to backup a pretty big mysql table to
> a csv file. However, we don't want to allow the user ssh or file access
> to the server, so it'd have to happen remotely. the --tab/-T option
> allows exporting to csv, but not remotely.
> So we're looking for a way to have mysqldump store these files 
remotely,

> on the client where mysqldump is executed.
> I've been looking up and down, only to find bad news, so I'm pretty 
sure

> it's just not possible. I know there are ways to do this (little script
> to convert the sql to csv, or pipe it all through sed), but we were 
just
> wondering if we're really not overlooking a nifty option in 
mysqldump :-)

>
> Thanks in advance
>
> mavoo
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=ce_ca...@hotmail.com
>


Cansado de entrar em todas as suas diferentes contas de email? Veja 
como juntar todas 



--
Marijn Vandevoorde

Tel:+32 (0)9 331 36 95fax:+32 (0)9 3313809
VIB Department of Plant Systems Biology,  Ghent University
Technologiepark 927, 9052 Gent, BELGIUM
marijn.vandevoo...@psb.vib-ugent.behttp://www.psb.vib-ugent.be
==
"You're so beautiful.You could be a part time model.
But you'd probably still have to keep your normal job"
 --J. Clement


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Best Bin log - type in MYSQL

2010-05-04 Thread Vikram A
Hi, 

I am using win-server and xp for my master, slave setup. when i do the 
beginTrans with bin-log = STATEMENT it is causing error. If i defined this with 
any one of the following, its working quite fine. MIXED, ROW.

Which is the best one in the above two? Or how it differs?
Can I have your explanations?

Thank you

VIKRAM