Re: South American timber products.

2006-09-14 Thread Renato Golin

Martijn Tonies wrote:
This sounds great. Could you please post some of your timber products  
here to the list? Many of us are really looking for a break from this  
boring MySQL stuff. Thanks, and our kind regards to you too.


Unless they offer a new table-type that allows us to store real timber,
I don't think this is MySQL related :-)


Well, he's offering something to *build* tables, that's why he came to 
MySQL list in the first place...


--renato

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



Re: South American timber products.

2006-09-14 Thread Renato Golin

Paul McCullagh wrote:

?!:( A license to SPAM:

On Sep 12, 2006, at 4:57 AM, Agrapin S.A. - Timber Industry and Trading 
wrote:


This message is in full compliance with U.S. Federal requirements for 
commercial email under bill S.1618 Title lll, Section 301, Paragraph 
(a)(2)(C) passed by the 105th U.S. Congress and cannot be considered 
SPAM since it includes a remove mechanism.  If you are not interested 
in receiving our e-mails then please reply with a remove  in the 
subject line.


Yes, this is the first rule on a Spam filter, incinerate all message 
that contains texts like that. ;)


--renato

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



Re: Decimal versus Float Point Type

2006-09-08 Thread Renato Golin

Jerry Schwartz wrote:

An employee of a financial institution realized a similar vulnerability in
their systems. It was common to calculate batch totals, which were cross
checked to make sure that no transactions went astray, but he realized that
so long as the batch totals came out right you could move money from one
transaction to another. He programmed in a fraction-shaving scheme like the
one above, only he shifted the missing fraction of a cent into his own
account.


This is famous. I was never sure if this was a very good hoax or a true 
story but indeed it was quite possible sometime ago. I have a great one 
that has nothing to do with rounding numbers but is equally good:


Long before computers were used all over the globe one guy figured out 
that the transaction list was shared between two branches via one person 
taking the list in a paper. The guy then made a load of $1mi, deposited 
in his account, waited a few days and went to the first branch to 
withdraw the money, he got his balance and there was $1mi on his 
account. After he get his money (cash) he run to the second branch 
before the paper guy and got another balance, which was still showing 
the $1mi.


The bank was never able to prove him guilty of taking $2mi from his 
account while he had only $1mi.




Holding currency amounts in double- or extended-precision floating point
values avoids the overflow problem for any reasonable amount, but now you're
back to the rounding issue caused by the fact that .01 is not exactly
representable as a binary fraction.


I had problems with super-mega-huge-double precision fields and money 
manipulation. I always use integers for money no matter what the vendor 
say to me about they're precision. And I always use at least three 
decimal places and round them at the end because integers truncate 
instead of round.


If I'd need to convert currencies I would go for 4 or more decimal 
places, depending on which currencies I needed.



cheers,
--renato

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



Re: Decimal versus Float Point Type

2006-09-07 Thread Renato Golin

Bruno Rodrigues Silva wrote:

Dear all.

The MySQL Manual inform that Decimal Data Type is used
for represent exact-number, but like Float Point Data
Type, Decimal use rounding case the fractional part is
not sufficient. Therefore, what the difference? 


Hi Bruno,

FLOAT rounds as floating point and DECIMAL rounds as you would expect it 
to. Floating point arithmetic is not exact and that's why they've called 
DECIMAL an exact packed decimal number because apparently you can rely 
on it's roundings.


The primary use for DECIMAL is money, where floating point would fail 
miserably and produce lots of errors (money leak) at the end of the month.


As floating point arithmetic has it's own separated section on your 
processor (unless you have a 386 or older computer) it would be *much* 
faster than DECIMAL, so use it only if you are absolutely sure you need it.


cheers,
--renato

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



Re: Decimal versus Float Point Type

2006-09-07 Thread Renato Golin

Jerry Schwartz wrote:

The difference is that, for example, .01 can be represented exactly
in decimal; but float types are binary, so .01 cannot be represented
exactly. This can lead to all kinds of trouble when doing arithmetic,
the errors accumulate.



Yes! but that can also lead to some other problems... ;) Check this example:

myslq create table numbers (a decimal(10,2), b float);
myslq insert into numbers values (100, 100);
mysql select @a := (a/3), @b := (b/3), @a * 3, @b * 3 from numbers \G
*** 1. row ***
 @a := (a/3): 33.3
 @b := (b/3): 33.
@a + @a + @a: 99.90
@b + @b + @b: 100

The decimal did exactly what's supposed to do on this cases, it
truncated the rest, thus loosing the 1/3 part.

So for sums the decimal is better, but for divisions the float is
better, up to some point, of course. I mean, using DECIMAL will not give
you a fail proof arithmetic in any means.


It's one reason why most people write their loops with  x + 1 
rather than = x. That gets past the problem, but if you are adding 
together many values the final answer may be wrong.


I'd rather use a better algorithm instead of a work around in those 
cases... ;)



cheers,
--renato

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



Re: Decimal versus Float Point Type

2006-09-07 Thread Renato Golin

 How do you expect to split a dollar 3 ways?

Sorry, I should have added more smiles, it was supposed to be a joke about
the dollars... ;)

But still, I could win a lot of money by distributing people's money to
their three kids and getting 1 cent out of every operation. :D


 It is not the math you do that determins whether you use float or
 decimal, it is what you are modeling that is important.
 Dollars are decimal, and dollar calculations must be rounded to the
 nearest cent, or mill.

What I tried to say (and probably failed miserably) was something close to
what you said about what is your model but giving a pratical way of
finding out if the data type will fit your model or not.

In number theory, a set of operations is what define the model of a number
sequence, so at the end, we said exactly the same thing, but in a
different way.

Glad you completed my observation! ;)

cheers,
--renato



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



Re: How to find the top most member in a hierarchy of subcategories

2006-09-04 Thread Renato Golin

Peter Lauri wrote:

Yes, and this shows that you can not do it will MySQL purely :) But a
scripting language like php can do it for you with a recursive function as
the best option.


IMHO, the best option would do it with a procedure as you don't get out 
of the database and don't have any overhead from outside.


--renato

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



Re: Weird SELECT bug in 5.0.21

2006-08-31 Thread Renato Golin

Renald Buter wrote:

Odd, eh? But what's worse, the JOIN between this column and other
columns *also* uses this truncated values and the result is bogus.


I wouldn't say odd, as you didn't specified any order I wouldn't rely on 
the order of the output. Try ordering things for what you want and 
you'll probably get the correct results.


I'm also not sure that ANSI SQL specifies any order in particular when 
no order is passed on the query...


--renato

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



Re: MySQL NOW() function producing 0000-00-00 00:00:00

2006-08-25 Thread Renato Golin

Jeremiah Foster wrote:

Hello all,

We are using an NOW() function in our database and occasionally it
produces odd results. There are entries where it states: -00-00
00:00:00 instead of the current time. Is this a bug, or are we using the
function incorrectly?

MySQL version info:
mysql  Ver 12.22 Distrib 4.0.26, for portbld-freebsd4.11 (i386)


Hum, the little devil is playing you tricks, uh ?

It's easier that NOW() didn't run at all instead of producing Jesus' 
dates. Try a dummy insert on a dummy table just putting now() on a 
column and see if any of them gets out zero. If some does, it's a bug on 
MySQL, otherwise can be a problem while you're assembling your query.


mysql use test; create table foo (a datetime);

bash$ for ((i=1000; i; i--)); do echo insert into foo values 
(now()) | mysql test; done


myslq use test; select * from dates where a = -00-00 00:00:00;


Should return no results.

cheers,
--renato

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



Re: MySQL NOW() function producing 0000-00-00 00:00:00

2006-08-25 Thread Renato Golin

Chris Knipe wrote:
After patiently injecting at about 400 queries per seconds, a couple of 
hours later, I had about 5 million records in a table.  Not a single one 
of them experienced the above


It's one every 5 million and 1 entries... try again ;)

Also, maybe (very improbable) it can be the way you are using NOW() 
within the query. Can you show us the query ?


cheers,
--renato

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



Re: Testing Email

2006-08-25 Thread Renato Golin

Nicholas Vettese wrote:

I have been having problems with my email, and I wanted to test to this
list.


Will let you know when I receive it...

--renato

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



Re: MySQL NOW() function producing 0000-00-00 00:00:00

2006-08-25 Thread Renato Golin

Chris Knipe wrote:

Doh.. Wrong email ;)

INSERT INTO a VALUES (NOW()) ?


Sorry, it was not for you, I wanted Jeremiah's query... replied the 
wrong mail... my fault! ;)


--renato

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



Re: Search Engine type search

2006-08-24 Thread Renato Golin

Chris wrote:

The most common next search becomes the did you mean.


Yes, that might work well, but I wouldn't use it out of the box. I would 
send a report to a human first to use that information instead of doing 
it automatically.


Imagine someone searching for cous (instead of cows) and than, 
search for sex. As sex is by far the most searched it's probable 
that it becomes the next search (specially after dubious words such as cow).


Now imagine your son searching for cows for his school homework...

:)

cheers,
--renato

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



Re: Chemistry search

2006-08-24 Thread Renato Golin

Rhino wrote:

What do you mean by mols - molar weights?


yup... i mean, probably... ;)


And why would anyone search for anything to do with chemicals based on 
smilies? How would :-) or symbols like that help? Or is this some 
other sense of the word smilies than the customary Internet one?


mili is a miligram or mililitre. smili is a secular milli(gram/litre). 
It's a very old but still fashion way of counting one thousandth of 
something.


Some scientist of the new millennium have been using the current 
milli(gram/litre) in favor of the old (secular) one because it's yellow 
and have the words Don't Panic on it's cover but the secular one is 
more accurate and slightly lighter.


cheers,
--renato

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



RE: Search Engine type search

2006-08-23 Thread Renato Golin

 OK, I appear to be getting somewhere with the FULL TEXT search.  Does
 anyone have any good resources about producing search engine type results
 ? for example if some enters a search phrase like   londn  how would I
 suggest the word london ?

Hi Neil,

That's a completely different thing, but very common to see both together.

I'd say a good way of doing this is to have a from/to table and when the
user search for from and to have more results (replace and search to
check) you show him a did you mean box with the new word in bold.

It's really hard to extract that information from searches anyway so the
best you can do, as far as I know, is to monitor the common mistakes by
looking into logs and adding terms to that table manually.

cheers,
--renato


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



Re: Search Engine type search

2006-08-22 Thread Renato Golin

Neil Tompkins wrote:
I have a number of different database fields.  

 Does anyone have any recommendations about how I can
 perform a search engine type search including the text fields.

Full-Text Search:

http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html

cheers,
--renato

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



Re: returning username/pass from 2 tables

2006-08-15 Thread Renato Golin

[EMAIL PROTECTED] wrote:

How do I check two tables is it? Username and userpass are submitted through a 
from and are unique

$sql = SELECT username, userpass FROM mytable, mytable2 WHERE username = '$username' AND 
userpass = '$userpass';


This way you'll have an ambiguous error as username and userpass belongs 
to both table (as far as I could understand). You can do both selects or 
do something like this:


select a.user, a.pass, b.user, b.pass
from table1 a, table2 b
where (...)

Or create a MERGE storage engine if both your tables are identical:

http://dev.mysql.com/doc/refman/5.0/en/merge-storage-engine.html

cheers,
--renato

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



Re: comunication between Oracle and MYSQL

2006-08-14 Thread Renato Golin

balaraju mandala wrote:
In my application there is a situation is arising, where i need to take 
some

data to MySql from a table which is in Oracle database (i am planning to
maintain that data in MySQL also). And from MySQL my application will use
it. This whole thing should be happen online.That is once some new data was
inserted to Oracle table, that should update in MySQL table also.


Can't you just make your app connect directly to Oracle ? You'll drawn 
in lots of sync issues if you don't, specially if your app updates the 
database with data provided from Oracle.


Take this example: the user updates something, it goes to Oracle, than 
MySQL. Your system update lots of things out of it. Than, the user 
realizes he's wrong and update again the record, and some of your 
updates might not work, other things were deleted that shouldn't 
according to your business model.


I'm not saying you will have this problem, I'm just saying you might 
consider it before doing the Oracle-MySQL connector. Btw, I don't know 
any connector, and don't think a trigger on Oracle will work either. 
You'll probably have to live with a daemon replicating every 10 seconds 
or so.


cheers,
--renato

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



Re: how to store quotes in mysql?

2006-08-10 Thread Renato Golin

 thanks for your response.

 I'm already working on the php part but just wondered how bad is to
 have backslash in front of quotes.

It's bad in the sense that you will have to predict every single event
(character) from the input and act accordingly. The API writers had
predicted them all and fixed bugs on it and you'd have to go through the
same work, which is not good. (reinventing the wheel).

always look for a stable library before doing it yourself ;)

--renato


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



Re: MySQL 5.0.24 hard time with VB 3.5.4 and 3.6

2006-08-09 Thread Renato Golin

Abdullah Ibn Hamad Al-Marri wrote:

Invalid SQL:

INSERT IGNORE INTO session
(sessionhash, userid, host, idhash, lastactivity, location, 
styleid, languageid, loggedin, inforum, inthread, incalendar, badlocation, 
useragent, bypass, profileupdate)
VALUES
('49778b903012cc3dba1481897dcb5749', 0, '62.68.61.2', 
'ab1219e33a7fca1808ca880a806b6383', 1155125518, 
'/showthread.php?t=5311amp;page=4', 0, 0, 0, 21, 5311, 0, 0, 'Mozilla/4.0 
(compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)', 0, 0);

MySQL Error  : MySQL server has gone away
Error Number : 2006
Date : Wednesday, August 9th 2006 @ 12:13:16 PM
Script   : http://bb.wearab.net/showthread.php?t=5311page=4


There's nothing wrong with this query as far as I can see (maybe 
misaligned quotes, didn't check), but I don't think that's the problem.


Check:
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html

It's probably timeout from the server and it usually comes out of TCP 
timeout (the admin should take care of it) or executing queries with 
closed db handles in your code (you should care for it).


If you're sure it's not your fault, (and you do have privileges) send 
that page to the admin and ask him for a better network! ;)


cheers,
--renato

PS: This error message is subject to forums like this quite often, if 
you had googled for the error message you'd check that the page I'm 
referring to is the first match.


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



Re: how to store quotes in mysql?

2006-08-09 Thread Renato Golin

[EMAIL PROTECTED] wrote:

hi to all.

battling this problem on several forums and mailing lists, I got confused:
when store string that contains quotations (ie afan's php shop) in mysql
does it have to be stored with backslashes (afan\'s \php\ shop) or just
the way it is? my login's telling me the way it is. am I wrong?


most programming languages have specific functions to scape properly all 
strings and also most of them to protect you from SQL injection (PHP is 
one example).


You should search your language's documentation on how to prepare your 
queries passing arguments instead of concatenating it your self on the 
query and how to quote properly the strings so you can stop worrying 
about it once and for all... ;)


cheers,
--renato

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



Re: MySQL Load Balancing

2006-08-08 Thread Renato Golin

Ed Pauley II wrote:
Continuent's m/cluster will not work for me as it does not allow 
replication across a WAN.


Yeah, known problem...

We have an offsite backup that needs to be in 
the replication (2-way to make switching back and forth easy) chain. 


Why do you need a backup site to write things to your master ? Or did I 
got wrong ?



I 
am thinking of a master, slave setup at each location where the masters 
continue to replicate both ways and then each replicates to it's own 
slaves. I would like to load balance these slaves on each end. 



Let me see if I got it right: you have two sites, one master on each, 
one slave on each., and you want both master to replicate to the other 
and both slaves to receive data from them as well. Right ?


If so, MySQL does not support multi-master setup.

As far as I've heard there is no direct move into that direction from 
MySQL developers, although a voting system for a new master among one of 
the slaves can happen in the near future.


What may work is to have only one master on one of your sites and both 
sites update the same master (reducing speed for the slave site) and in 
the case of failure you switch them (manually or with some tool).


hope that helps,
--renato

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



Re: MySQL Load Balancing

2006-08-08 Thread Renato Golin

Ed Pauley II wrote:
This is another geographical location with automatic failover if there 
is a problem, network, hardware etc. with the primary location. When the 
problem is corrected, or corrects itself the traffic is automatically 
sent back to the primary location. Without 2-way replication data would 
be lost. We have been doing this for since MySQL 4.0 was released.


Ok, If that's your problem, they might have something to you in the near 
future with the new master election. It'll probably work on a 2-way 
replication when the old master is restored.


While this is not out yet, what you might do is what I did back with 
3.23 which is: bring old restored master up as slave, wait for all 
changes replicate, shutdown temp master, set it as slave, bring old 
master as master and bring temp master as slave, restoring production 
scheme.



It is not a multi-master setup. The master at each location is both 
master and slave to each other. The slaves are only slaves to the master 
in their respective locations. My problem is really with how to load 
balance the slaves at each location.


Load balance them using the local master or using both slaves as a load 
balance ?


I'd rather go for the first one because the second one will raise more 
problems than solve, specially related to network delays.


If, in the first case, one master fails you can issue a change master 
to the other master and it'll keep running. As you'll only have the 
slave there will be no load balancing on that site.


--renato

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



Re: Help with Duplicate Key (32-bit Solaris MySQL 4.1)

2005-04-11 Thread Renato Golin
On Monday 11 April 2005 16:00, mysql helppp wrote:
 Error - Duplicate key '444642', -1
 (The syntax of the error message is not exact)

probably index error, run myisamchk on the table, or repair table inside 
MySQL command line. Should fix without loose any data.

--rengolin


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



Re: CSV-to-SQL?

2005-04-08 Thread Renato Golin
On Friday 08 April 2005 06:14, Richard Miller wrote:
 I didn't know the CSV table-type existed -- sounds really cool!

 As I understand it, it will save table data in a flat CSV file, but if
 I already have a CSV file, can I trick MySQL into thinking it's a
 table?  That wasn't clear from the documentation.

Hi Richard,

never tryied but if you have a good CSV file and create the table manually, 
stop the server, copy your CSV to the one mysql created and start the server 
back, it should work fine...

worth a shot! ;)

--rengolin


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



Re: recovery of a very large table?

2005-04-06 Thread Renato Golin
On Wednesday 06 April 2005 20:05, jon wrote:
 Normal recovery seems to grab 490 rows... but, originally there were
 some 22 million rows in there.

Seems your data file was corruped too not only the indexes. and probably broke 
when updating the 491st registry... try use myisamchk -e

  -e, --extend-check  Try to recover every possible row from the data file
  Normally this will also find a lot of garbage rows;
  Don't use this option if you are not totally desperate.

it could take a very long time to run also... be warned! ;)

--rengolin


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



Re: CSV-to-SQL?

2005-04-05 Thread Renato Golin

You could use the CSV table type:
http://dev.mysql.com/doc/mysql/en/csv-storage-engine.html

Or use the LOAD DATA INFILE to import all data:
http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html

--rengolin

--- Richard Miller [EMAIL PROTECTED] wrote:
 I have a dozen, very large CSV files that I would
 like to put into a 
 MySQL database, with 1 table per file.  Does anyone
 know of a PHP (or 
 other) script that can read the first few lines of a
 CSV file and 
 create an appropriate CREATE TABLE statement based
 on the data it 
 finds?  (Even better, it could import the file
 afterwards!)  I'm not 
 picky about data types here; I'd simply like to get
 this data into 
 tables so I can work with it more easily.
 
 Thanks,
 Richard Miller
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 
 





Yahoo! Acesso Grátis - Internet rápida e grátis. 
Instale o discador agora! http://br.acesso.yahoo.com/

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



Re: Making Slave a Master

2005-03-31 Thread Renato Golin
Hi Jalil,

I had the same problem more than once. I solved it
with a (not-so) simple perl script but the idea is
very simple: swap the machines!

 scenario #1: master and slave running
  - master is used for writes, slave for reads,
replication goes well. you have a DNS entry for
MASTERDB.domain and SLAVEDB.domain.

 scenario #2: master fail, slave stop receiving data
  - now, you should have something to warn you the
master went down, otherwise you could spend much time
until find out by yourself.
  - since the time you know, the idea is to change
MASTERDB.domain pointing to the same as SLAVEDB.domain
so both reading and writing is happening on the slave
server.
  - at this time you broke the chain between what had
on master and slave, so replication will not happen
again automatically.
  - now you can fix your master.
  - change the master config to stop doing log-bin and
start as a slave using SLAVEDB.machine as master.
  - edit my.cfg on slave's machine to start log-bin
and stop trying to get data from master.
  - restart the slave, now as master.
  - restart the master, now as slave and issue a LOAD
DATA FROM MASTER
  - start the old master (new slave) slave status and
sync them.
  - point SLAVEDB.domain to the old master machine.

 scenario #3: machines swapped, same scenario
  - now you have exactly the same thing as before, but
your machines are swapped. You can do it as many times
as you want.
  - If the machines are the same you can keep that
scenario untill the new master breaks.
  - If the (old) master db is much better you can do
the same trick again on a low-traffic hour.

This swap may take you no more than an hour, plus the
time to fix the broken machine.

The trick with domains could also be done using IP
alias on the interface if you're connecting the
machines using IPs. I used IPs instead of names.

hope that helps,
--rengolin


--- [EMAIL PROTECTED] wrote:
 
 We have one master and one slave database and use
 the slave for reads.
 If for some reason our master goes down,
 we would like to make our slave the master and use
 it for both writes
 and reads and then switch to the original
 configuration 
 when the master is up, which includes updating the
 master copy. Limited
 downtime/locking of the second database is OK.
 
 
 Is this something that is easy to do or recommended?
 If so, what steps
 we need to go through or where can I find isome
 nformation regarding
 this? If not, what other approachs are there
 (assuming we only have two
 machines w/ above configuration).
 
 Thanks,
 
 -JF
 
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 
 





Yahoo! Acesso Grátis - Internet rápida e grátis. 
Instale o discador agora! http://br.acesso.yahoo.com/

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



Re: power loss scenario

2005-03-30 Thread Renato Golin
On Wednesday 30 March 2005 10:49, Brent Baisley wrote:
 Wow, you are asking a lot, especially since an inexpensive UPS could be
 had for less than $50. You don't need one to keep the system up for a
 long time, just long enough for writes to finish. A few minutes should
 be plenty.

Yeah, remember to put only the DB below UPS to force the logging hardware stop 
before DB.

--rengolin


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



Re: load data from master

2005-03-29 Thread Renato Golin
On Tuesday 29 March 2005 11:26, Shamim Shaik wrote:
 Can I run load data from master on myisam tables where my table size is
 approx 30G?

- stop slave
- on master do:
 - lock tables
 - tar cpf - /var/lib/mysql/tbl | ssh -C slave tar xpf - -C /var/lib/mysql/tbl
- start slave
- on master again:
 - unlock tables

It's faster, but will keep you out of order untill all data is copied.

--rengolin


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



Re: load data from master

2005-03-29 Thread Renato Golin
On Tuesday 29 March 2005 11:44, Shamim Shaik wrote:
 I cannot stop or lock tables on the master webapps write data to it
 constantly.

 I am copying over the binlogs and applying them to the slave.

 It is taking a long time so I just want to know if load data or copying
 tables over would bring replication back to where it is.

Don't know if it's faster but mysqldump works fine and you can keep serving 
the pages... regarding the time, it'd be very slow anyway since it's 30Gb of 
data... unless you have gigabit link between them it should take hours...

--rengolin


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



Re: Infinity as field value

2005-03-29 Thread Renato Golin
On Tuesday 29 March 2005 20:51, Scott Klarenbach wrote:
 Is there a way to represent infinity in mysql?

 I could make infinity default to 100,000,000 or some other number I
 know will never be reached, but it seems less elegant a solution...

probably not the best but you could have two fields:

enum value_from { inf_neg, inf_pos, number },
int from,
enum value_to { inf_neg, inf_pos, number },
int to,

And if value is number you try to evaluate it, otherwise you use the 
constants.

You could also use 2147483647 and -2147483648 as being less uglier (but still 
ugly) as MaxInt.

--rengolin


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



built in HA

2003-03-13 Thread Renato Golin

Hi,

is there any built in high availability issue on mysql today? Or even plans to 
do it?

I mean, I made my own HA perl script running on both master and slave 
replication servers to set up a HA but it could be a plugin of mysql, 
couldn't?

In fact i want to rewrite it in C or Java but i don't want to reinvent the 
wheel, does some plan on it exists already?

thanks,
Renato

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php