Mac OS X PowerPC 64 bit

2007-07-11 Thread Jan Pieter Kunst

Dear mysql-ers,

It seems that the Mac OS X PowerPC 64 bit version of the MySQL
Community server is no longer available.

Now I'm wondering which version I should use on a G5 PowerMac. PowerPC
32 bit or Universal?

Thanks for any insights.

Jan Pieter Kunst

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



how to stop replication at a specific position?

2007-07-11 Thread Ofer Inbar
When you start a replication slave you can tell it where in the binary
logs to start (which log file, what position) ... but can you tell it
to automatically *stop* when it reaches a certain point (also identified
by log file name and position) ?
  -- Cos

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



BUG in UNION implementation?! Confimation or Explaination please

2007-07-11 Thread list account

Hi all,
I believe to have found a bug in MySQL's union implementation. Can someone
confirm this, please or convince me that this is not a buggy behaviour of
mysql :

UNION seems to behave like DISTINCT by default:

mysql select 2 c1
   - union
   - select 1 c1
   - union
   - select 2 c1
   - union
   - select 1 c1;
++
| c1 |
++
|  2 |
|  1 |
++
2 rows in set (0.00 sec)

mysql select 2 c1,1 union select 1 c1,2 union  select 2 c1,3 union select 1
c1,4;
++---+
| c1 | 1 |
++---+
|  2 | 1 |
|  1 | 2 |
|  2 | 3 |
|  1 | 4 |
++---+
4 rows in set (0.00 sec)

mysql select 2 c1,1 union select 1 c1,2 union  select 2 c1,3 union select
1,2;
++---+
| c1 | 1 |
++---+
|  2 | 1 |
|  1 | 2 |
|  2 | 3 |
++---+
3 rows in set (0.00 sec)

mysql select avg(c1),avg(distinct c1),sum(c1),count(c1),count(distinct
c1),count(*)  from
   - (
   - select 2 c1
   - union
   - select 1 c1
   - union
   - select 1 c1
   - union
   - select 1
   - ) a
   - ;
+---++---+-+---+--+
|avg(c1)|avg(distinct c1)|sum(c1)|count(c1)|count(distinct c1) | count(*) |
+---++---+-+---+--+
|1.5000 | 1.5000 | 3 |   2 | 2 |2 |
+---++---+-+---+--+
1 row in set (0.00 sec)

but I would have expected:

+---++---+-+---+--+
|avg(c1)|avg(distinct c1)|sum(c1)|count(c1)|count(distinct c1) | count(*) |
+---++---+-+---+--+
|1.2500 | 1.5000 | 5 |   4 |  2 |4 |
+---++---+-+---+--+


TIA,

CVH


Re: BUG in UNION implementation?! Confimation or Explaination please

2007-07-11 Thread Anders Karlsson
UNION will only return distinct rows. This is according to spec and to 
the SQL Standard. To avoid this, use UNION ALL instead of UNION. Try 
that with your queries and you'll see that this will do the trick. This 
is, as I said, in accordance with the standard and the way all SQL based 
databases work.


Quoting SQL 2003 section 4.10.6.2:
MULTISET UNION is an operator that computes the union of two multisets. 
There are two variants, specified

using ALL or DISTINCT, to either retain duplicates or remove duplicates.
Where UNION DISTINCT is the default if neither DISTINCT nor ALL is 
specified then.


Cheers
/Karlsson
list account wrote:

Hi all,
I believe to have found a bug in MySQL's union implementation. Can 
someone

confirm this, please or convince me that this is not a buggy behaviour of
mysql :

UNION seems to behave like DISTINCT by default:

mysql select 2 c1
   - union
   - select 1 c1
   - union
   - select 2 c1
   - union
   - select 1 c1;
++
| c1 |
++
|  2 |
|  1 |
++
2 rows in set (0.00 sec)

mysql select 2 c1,1 union select 1 c1,2 union  select 2 c1,3 union 
select 1

c1,4;
++---+
| c1 | 1 |
++---+
|  2 | 1 |
|  1 | 2 |
|  2 | 3 |
|  1 | 4 |
++---+
4 rows in set (0.00 sec)

mysql select 2 c1,1 union select 1 c1,2 union  select 2 c1,3 union 
select

1,2;
++---+
| c1 | 1 |
++---+
|  2 | 1 |
|  1 | 2 |
|  2 | 3 |
++---+
3 rows in set (0.00 sec)

mysql select avg(c1),avg(distinct c1),sum(c1),count(c1),count(distinct
c1),count(*)  from
   - (
   - select 2 c1
   - union
   - select 1 c1
   - union
   - select 1 c1
   - union
   - select 1
   - ) a
   - ;
+---++---+-+---+--+ 

|avg(c1)|avg(distinct c1)|sum(c1)|count(c1)|count(distinct c1) | 
count(*) |
+---++---+-+---+--+ 

|1.5000 | 1.5000 | 3 |   2 | 2 
|2 |
+---++---+-+---+--+ 


1 row in set (0.00 sec)

but I would have expected:

+---++---+-+---+--+ 

|avg(c1)|avg(distinct c1)|sum(c1)|count(c1)|count(distinct c1) | 
count(*) |
+---++---+-+---+--+ 


|1.2500 | 1.5000 | 5 |   4 |  2 |4 |
+---++---+-+---+--+ 




TIA,

CVH




--
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /  Anders Karlsson ([EMAIL PROTECTED])
 / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Sales Engineer
/_/  /_/\_, /___/\___\_\___/ Stockholm
   ___/   www.mysql.com Cellphone: +46 708 608121
  Skype: drdatabase



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



RE: BUG in UNION implementation?! Confimation or Explaination please

2007-07-11 Thread Rhys Campbell
UNION is mean to removed duplicate rows. Use UNION ALL if you don't want
this to happen.

http://dev.mysql.com/doc/refman/5.0/en/union.html

-Original Message-
From: list account [mailto:[EMAIL PROTECTED]
Sent: 11 July 2007 09:19
To: mysql@lists.mysql.com
Subject: BUG in UNION implementation?! Confimation or Explaination
please


Hi all,
I believe to have found a bug in MySQL's union implementation. Can someone
confirm this, please or convince me that this is not a buggy behaviour of
mysql :

UNION seems to behave like DISTINCT by default:

mysql select 2 c1
- union
- select 1 c1
- union
- select 2 c1
- union
- select 1 c1;
++
| c1 |
++
|  2 |
|  1 |
++
2 rows in set (0.00 sec)

mysql select 2 c1,1 union select 1 c1,2 union  select 2 c1,3 union select 1
c1,4;
++---+
| c1 | 1 |
++---+
|  2 | 1 |
|  1 | 2 |
|  2 | 3 |
|  1 | 4 |
++---+
4 rows in set (0.00 sec)

mysql select 2 c1,1 union select 1 c1,2 union  select 2 c1,3 union select
1,2;
++---+
| c1 | 1 |
++---+
|  2 | 1 |
|  1 | 2 |
|  2 | 3 |
++---+
3 rows in set (0.00 sec)

mysql select avg(c1),avg(distinct c1),sum(c1),count(c1),count(distinct
c1),count(*)  from
- (
- select 2 c1
- union
- select 1 c1
- union
- select 1 c1
- union
- select 1
- ) a
- ;
+---++---+-+---+--+
|avg(c1)|avg(distinct c1)|sum(c1)|count(c1)|count(distinct c1) | count(*) |
+---++---+-+---+--+
|1.5000 | 1.5000 | 3 |   2 | 2 |2 |
+---++---+-+---+--+
1 row in set (0.00 sec)

but I would have expected:

+---++---+-+---+--+
|avg(c1)|avg(distinct c1)|sum(c1)|count(c1)|count(distinct c1) | count(*) |
+---++---+-+---+--+
|1.2500 | 1.5000 | 5 |   4 |  2 |4 |
+---++---+-+---+--+


TIA,

CVH

This email is confidential and may also be privileged. If you are not the 
intended recipient please notify us immediately by telephoning +44 (0)20 7452 
5300 or email [EMAIL PROTECTED] You should not copy it or use it for any 
purpose nor disclose its contents to any other person. Touch Local cannot 
accept liability for statements made which are clearly the sender's own and are 
not made on behalf of the firm.

Touch Local Limited
Registered Number: 2885607
VAT Number: GB896112114
Cardinal Tower, 12 Farringdon Road, London EC1M 3NN
+44 (0)20 7452 5300


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



RE: load data

2007-07-11 Thread Rhys Campbell
Can you not change your proceedure and format your dates first using
DAT_FORMAT()?
http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function
_date-format

You could put a trigger on the table that would format the dates before
insert (although I'd go for the above)

-Original Message-
From: Ananda Kumar [mailto:[EMAIL PROTECTED]
Sent: 11 July 2007 06:30
To: MySQL General
Subject: Fwd: load data


 Hi All,
We have an application where we load data on a daily basis and then do some
analysis and the move this data into different tables.

Data is comming in  files. The date format in the file  is dd-mon-
hh24:mi:ss', but as you all know, in mysql , the default date format is
-mm-dd hh24:mi:ss. How can i specifiy this format in the load data
infile script.

I tried this

 LOAD DATA LOCAL INFILE 'abc.txt' INTO TABLE abc FIELDS TERMINATED BY ','
LINES TERMINATED BY '^V\n' (doj timestamp dd-mon- hh24:mi:ss);

but data is not getting inserted.

Please help me.

regards
anandkl

This email is confidential and may also be privileged. If you are not the 
intended recipient please notify us immediately by telephoning +44 (0)20 7452 
5300 or email [EMAIL PROTECTED] You should not copy it or use it for any 
purpose nor disclose its contents to any other person. Touch Local cannot 
accept liability for statements made which are clearly the sender's own and are 
not made on behalf of the firm.

Touch Local Limited
Registered Number: 2885607
VAT Number: GB896112114
Cardinal Tower, 12 Farringdon Road, London EC1M 3NN
+44 (0)20 7452 5300


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



Re: load data

2007-07-11 Thread Ananda Kumar

Hi Campbell,
I tried this

LOAD DATA LOCAL INFILE 'abc.txt' INTO TABLE abc FIELDS TERMINATED BY ','
LINES TERMINATED BY '^V\n' (date_format(doj,'%d-%M-%Y %H:%i:%S');

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 'date_format(doj,'%d-%M-%Y %H:%i:%S')' at line 1

and also

LOAD DATA LOCAL INFILE 'abc.txt' INTO TABLE abc FIELDS TERMINATED BY ','
LINES TERMINATED BY '^V\n' (str_to_date(doj,'%d-%b-%Y %H:%i:%S');
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 'str_to_date(doj,'%d-%b-%Y %H:%i:%S')' at line 1

Can u please tell me where i going wrong.

regards
anandkl


On 7/11/07, Rhys Campbell [EMAIL PROTECTED] wrote:


Can you not change your proceedure and format your dates first using
DAT_FORMAT()?

http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function
_date-format

You could put a trigger on the table that would format the dates before
insert (although I'd go for the above)

-Original Message-
From: Ananda Kumar [mailto:[EMAIL PROTECTED]
Sent: 11 July 2007 06:30
To: MySQL General
Subject: Fwd: load data


Hi All,
We have an application where we load data on a daily basis and then do
some
analysis and the move this data into different tables.

Data is comming in  files. The date format in the file  is dd-mon-
hh24:mi:ss', but as you all know, in mysql , the default date format is
-mm-dd hh24:mi:ss. How can i specifiy this format in the load data
infile script.

I tried this

LOAD DATA LOCAL INFILE 'abc.txt' INTO TABLE abc FIELDS TERMINATED BY ','
LINES TERMINATED BY '^V\n' (doj timestamp dd-mon- hh24:mi:ss);

but data is not getting inserted.

Please help me.

regards
anandkl

This email is confidential and may also be privileged. If you are not the
intended recipient please notify us immediately by telephoning +44 (0)20
7452 5300 or email [EMAIL PROTECTED] You should not copy it or
use it for any purpose nor disclose its contents to any other person. Touch
Local cannot accept liability for statements made which are clearly the
sender's own and are not made on behalf of the firm.

Touch Local Limited
Registered Number: 2885607
VAT Number: GB896112114
Cardinal Tower, 12 Farringdon Road, London EC1M 3NN
+44 (0)20 7452 5300




Re: how to stop replication at a specific position?

2007-07-11 Thread Baron Schwartz

Use START SLAVE UNTIL.  There are two syntaxes -- check the manual.

Ofer Inbar wrote:

When you start a replication slave you can tell it where in the binary
logs to start (which log file, what position) ... but can you tell it
to automatically *stop* when it reaches a certain point (also identified
by log file name and position) ?
  -- Cos



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



giving a row the new highest id

2007-07-11 Thread Olav Mørkrid

using one single sql statement, how do i update the auto_increment id
column of a row to have the new highest id in the table?

in other words: how do i make a row seem like it was just inserted?

i know how to do it with two statements, but i want to do it with one
to ensure nothing goes wrong:

$newid = get_value(select max(id) from user) + 1;
run_query(update table mytable set id = '$newid' where id = '$oldid' );

hope someone can help. thanks!

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



Re: giving a row the new highest id

2007-07-11 Thread Olexandr Melnyk

update table mytable set id =last_insert_id() + 1 where id = $oldid

2007/7/11, Olav Mørkrid [EMAIL PROTECTED]:


using one single sql statement, how do i update the auto_increment id
column of a row to have the new highest id in the table?

in other words: how do i make a row seem like it was just inserted?

i know how to do it with two statements, but i want to do it with one
to ensure nothing goes wrong:

$newid = get_value(select max(id) from user) + 1;
run_query(update table mytable set id = '$newid' where id = '$oldid' );

hope someone can help. thanks!

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





--
Sincerely yours,
Olexandr Melnyk
http://omelnyk.net/


Re: giving a row the new highest id

2007-07-11 Thread Olexandr Melnyk

Err..

you can do this:

update table mytable set id = (select max(id) + 1 from user) where id =
$oldid

but I would recommend to use a transaction

2007/7/11, Olexandr Melnyk [EMAIL PROTECTED]:


update table mytable set id =last_insert_id() + 1 where id = $oldid

2007/7/11, Olav Mørkrid [EMAIL PROTECTED]:

 using one single sql statement, how do i update the auto_increment id
 column of a row to have the new highest id in the table?

 in other words: how do i make a row seem like it was just inserted?

 i know how to do it with two statements, but i want to do it with one
 to ensure nothing goes wrong:

 $newid = get_value(select max(id) from user) + 1;
 run_query(update table mytable set id = '$newid' where id = '$oldid'
 );

 hope someone can help. thanks!

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




--
Sincerely yours,
Olexandr Melnyk
http://omelnyk.net/





--
Sincerely yours,
Olexandr Melnyk
http://omelnyk.net/


Re: How to restore 1 database from mysqldump of all databases

2007-07-11 Thread waldo_tumanut
Thanks to all who have replied.  Since this thread has evolved into
discussing the dump, I would like to ask the group what are their practices
for backup and recovery on Windows platform.

Waldo Tumanut
Database Analyst



   
Mogens
Melander  
[EMAIL PROTECTED] To 
oft.dk  Rolando Edwards 
 [EMAIL PROTECTED]   
07/10/2007  cc 
06:25 PM waldo tumanut   
 [EMAIL PROTECTED] 
 m, mysql@lists.mysql.com 
   Subject 
 Re: How to restore 1 database 
 from mysqldump of all databases   
   
   
   
   
   
   




A quick script solution:

create a dump pr. table in db.

#!/bin/bash

for tbl in `echo use db;show tables;|mysql -s -u user -ppassword`
do
  mysqldump -u user ppassword db $tbl  $tbl.sql
done

and the other way:

cat tbl.sql| mysql -u user -ppassword db






CONFIDENTIALITY NOTICE: This electronic mail transmission (including any 
accompanying attachments) is intended solely for its authorized recipient(s), 
and may contain confidential and/or legally privileged information. If you are 
not an intended recipient, or responsible for delivering some or all of this 
transmission to an intended recipient, be aware that any review, copying, 
printing, distribution, use or disclosure of the contents of this message is 
strictly prohibited. If you have received this electronic mail message in 
error, please contact us immediately by electronic mail at [EMAIL PROTECTED] 
and destroy the original and all copies of this transmission (including any 
attachments).

Thank you.


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



Re: giving a row the new highest id

2007-07-11 Thread Olav Mørkrid

thanks olexandr

my posting had a misprint. the select should be on mytable not
user, so when i use your suggestion, i get an error:

mysql update test set id = (select max(id) + 1 from test) where id = '$myid';
ERROR 1093 (HY000): You can't specify target table 'test' for update
in FROM clause

so how does one make a row id to appear as a newly inserted row,
without doing multiple queries?

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



Re: giving a row the new highest id

2007-07-11 Thread Olexandr Melnyk

2007/7/11, Olav Mørkrid [EMAIL PROTECTED]:


thanks olexandr

my posting had a misprint. the select should be on mytable not
user, so when i use your suggestion, i get an error:

mysql update test set id = (select max(id) + 1 from test) where id =
'$myid';
ERROR 1093 (HY000): You can't specify target table 'test' for update
in FROM clause

so how does one make a row id to appear as a newly inserted row,
without doing multiple queries?



why do you need this?

you can do insert and use last_ionsert_id() within a transaction (in case
storage engine you're using supports it)

--

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





--
Sincerely yours,
Olexandr Melnyk
http://omelnyk.net/


Re: giving a row the new highest id

2007-07-11 Thread Olav Mørkrid

what i want to do is to take an old row from maybe three weeks ago,
and make its id appear as if it was the newest inserted row in the
table. therefore last_insert_id() cannot be used.

i could introduce a timestamp column to achieve my goals, but for
certain reasons i would like to update the id if possible by
acceptable means.

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



Re: giving a row the new highest id

2007-07-11 Thread Baron Schwartz

Hi,

Olav Mørkrid wrote:
mysql update test set id = (select max(id) + 1 from test) where id = 
'$myid';

ERROR 1093 (HY000): You can't specify target table 'test' for update
in FROM clause


You will need to place the subquery in another subquery in the FROM clause so it is 
materialized to a temorary table:


update test set id = (
  select id + 1 from ( select max(id) as id from test ) as x
   )
where id = $myid;

If you need to do this kind of query on insert, there are other things to think about 
too.  See http://www.xaprb.com/blog/2006/04/20/sequences-and-surrogate-keys-in-generic-sql/


Baron

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



Re: giving a row the new highest id

2007-07-11 Thread Olav Mørkrid

baron

your suggestion does the trick indeed. i take a deep bow!

thanks also for mentioning the related issues.

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



Re: giving a row the new highest id

2007-07-11 Thread Olav Mørkrid

wait, let's make it even more interesting :)

what if you want to update more than one row, and each row should have
a successive new id. is that possible in one statement?

i tried just removing the where statement in barons suggestion, which
fails as i guess the select is computed only once prior to being used
in the update/set.

mysql update test set id = (select id + 1 from ( select max(id) as id
from test ) as x);
ERROR 1062 (23000): Duplicate entry '424' for key 1

is it possible, or do i have to do the rows one by one?

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



Re: BUG in UNION implementation?! Confimation or Explaination please

2007-07-11 Thread Joshua J. Kugler
On Wednesday 11 July 2007 00:34, Anders Karlsson wrote:
 UNION will only return distinct rows. This is according to spec and to
 the SQL Standard.

And of course, to no one's surprise, this also matches the mathematical 
definition of union: 

j

-- 
Joshua Kugler   
Lead System Admin -- Senior Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0xDB26D7CE
PO Box 80086 -- Fairbanks, AK 99708 -- Ph: 907-456-5581 Fax: 907-456-3111

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



Re: giving a row the new highest id

2007-07-11 Thread Baron Schwartz

Olav Mørkrid wrote:

wait, let's make it even more interesting :)

what if you want to update more than one row, and each row should have
a successive new id. is that possible in one statement?

i tried just removing the where statement in barons suggestion, which
fails as i guess the select is computed only once prior to being used
in the update/set.

mysql update test set id = (select id + 1 from ( select max(id) as id
from test ) as x);
ERROR 1062 (23000): Duplicate entry '424' for key 1

is it possible, or do i have to do the rows one by one?



I lack imagination right now, but I can't think of a scenario where this would work. 
You are updating many rows with a single value (there is only one max(id) in the table, 
after all).  Remember SQL is supposed to treat things as sets, not work iteratively.


But you could write a stored procedure to iteratively do what you seek.

There are some other scenarios where I can imagine selecting a set of groupwise maximum 
values, joining those to a set of current values, and updating the current values from 
the groupwise max.  But this is different: it matches a set of max-values to a set of rows.


Baron

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



starting a second slave from a first slave's dump

2007-07-11 Thread Ofer Inbar
Scenario:
  host a is the master
  host b is a replication slave
  host c is to become a second replication slave
  there's no full dump from host a

Normally, to start a new slave, I'd restore a dump from host a, and
start slaving using the master data in that dump.  In this situation,
however, running a full mysqldump on a would cause it to be unresponsive
for a while, and the app is depending on it (mostly MyISAM so can't run
the dump as a transaction).

I can temporarily make the front-end application not read from host b,
and while host b is not in use, run a full mysqldump there of the same
db, and restore that dump onto host c.

... but how do I find the master data to start host c slaving with?

The dump file will have master data referring to host b's binlogs,
which are mostly empty because it's a replication slave.  I need to 
know what position in host a's binlogs to start host c slaving from.

One possibility I can think of:
 - stop slave on host b
 - run the dump on host b
 - note its position in host a's binlogs using show slave status
 - restore the dump on host c
 - start c slaving using the binlog name and position from show slave status

Will that work?

Is there a way to do this *without* stopping replication on host b?
  -- Cos

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



Re: starting a second slave from a first slave's dump

2007-07-11 Thread Baron Schwartz

Hi

Ofer Inbar wrote:

Scenario:
  host a is the master
  host b is a replication slave
  host c is to become a second replication slave
  there's no full dump from host a

[snip]

One possibility I can think of:
 - stop slave on host b
 - run the dump on host b
 - note its position in host a's binlogs using show slave status
 - restore the dump on host c
 - start c slaving using the binlog name and position from show slave status

Will that work?


Yes.


Is there a way to do this *without* stopping replication on host b?


No, unless you have a snapshot-capable file system like LVM, and even then there 
are caveats.  Just be aware of which columns of SHOW SLAVE STATUS mean what -- 
there are three sets of binlog coordinates in that output.  (There's a note on 
the online manual that should make it clear).


Baron

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



Re: starting a second slave from a first slave's dump

2007-07-11 Thread Ofer Inbar
Baron Schwartz [EMAIL PROTECTED] wrote:
 Ofer Inbar wrote:
   host a is the master
   host b is a replication slave
   host c is to become a second replication slave
   there's no full dump from host a

 One possibility I can think of:
  - stop slave on host b
  - run the dump on host b
  - note its position in host a's binlogs using show slave status
  - restore the dump on host c
  - start c slaving using the binlog name and position from show slave 
  status
 
 Will that work?
 
 Yes.

For the benefit of future readers of the archive: yes, it worked easily.

 Just be aware of which columns of SHOW SLAVE STATUS 
 mean what -- there are three sets of binlog coordinates in that output.  
 (There's a note on the online manual that should make it clear).

The columns I used were:

Master_Log_File: binlog.08
Read_Master_Log_Pos: 150484312

  -- Cos

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



Next MySQL Magazine --call for articles

2007-07-11 Thread B. Keith Murphy
Hey everyone, 

I am starting to prepare for the second issue of MySQL Magazine. I am planning 
on putting it out on September 1. Thanks for the fabulous response to the first 
issue!! There was over a 1,000 downloads of the magazine. That is just 
fabulous!!! Special thanks to those who contributed (in no particular order): 
Peter Brawley, Dan Buettner and Baron Schwartz. 

It looks like there is going to be some publicity on a couple of podcasts over 
the next fews so there will probably be a decent upswing in subscribers. 

I am not going to concentrate on any particular theme this time. If you want to 
send me some ideas for articles you can either reply to this email address or 
bmurphy at paragon-cs.com. 

Thanks again, 

Keith 
-- 
B. Keith Murphy 
Database Administrator 
iContact 
2635 Meridian Parkway, 2nd Floor 
Durham, North Carolina 27713 
(o) 919-433-0786 
(c) 850-637-3877