RE: Triggers For Radius DB

2009-07-08 Thread Marcel Grandemange
NEW.AcctOutputOctets=(0 - NEW.AcctOutputOctets): END IF; -- Dan Nelson dnel...@allantgroup.com Thank you so much, this worked 100%! __ Information from ESET NOD32 Antivirus, version of virus signature database 4223 (20090708) __ The message was checked by ESET

Re: What OS is the best platform for MySQL ?

2009-07-08 Thread Ken Menzel
Dan Nelson wrote: In the last episode (Jul 06), Blog Tieng Viet said: I have been using MySQL on FreeBSD for 3 years and encounterd a lot of problems related to thread management. And 1 year ago, I found that my FreeBSD box does not go well with any MySQL revision after 5.1.17-beta, because

Re: What OS is the best platform for MySQL ?

2009-07-08 Thread John Meyer
Ken Menzel wrote: Dan Nelson wrote: In the last episode (Jul 06), Blog Tieng Viet said: I have been using MySQL on FreeBSD for 3 years and encounterd a lot of problems related to thread management. And 1 year ago, I found that my FreeBSD box does not go well with any MySQL revision after

Re: What OS is the best platform for MySQL ?

2009-07-08 Thread bmurphy
There are merits to most of the common operating systems. In some ways each of them perform better at various functions. The question becomes which are you most comfortable and familiar with? That way you can work most effectively with the operating system to fulfill the potential of your

Client deleted database, semi high priority master slave question

2009-07-08 Thread Scott Haneda
A client deleted their database and did not have a slave in place for backup. No scheduled dumps either. However, I have set up a slave to the master for one table. These tables hold DNS data for database driven DNS server features. The master table is empty, the slave rightly saw the

Re: Client deleted database, semi high priority master slave question

2009-07-08 Thread bmurphy
Hope the client learned the lesson about backups. it's a hard one to learn sometimes. If the binary logs on the slave were enabled when the table was populated it should be possible to restore the table from the binary logs. If not, and logging was turned on after the table was populated than you

Re: What OS is the best platform for MySQL ?

2009-07-08 Thread John Meyer
Carlos Williams wrote: On Wed, Jul 8, 2009 at 12:21 PM, John Meyerjohn.l.me...@gmail.com wrote: Do we really need to bash OS's for MySQL. Rather than questioning what OS is best for MySQL we should ask how we can optimize MySQL for each OS. Did I mis-read an email or can someone please

COUNT from 2 tables

2009-07-08 Thread b
I'm trying to get a count for columns in 2 tables at once. I have sessions and downloads tables and would like to get some basic stats. mysql describe sessions; +-+--+--+-+-++ | Field | Type | Null | Key | Default | Extra

RE: COUNT from 2 tables

2009-07-08 Thread Gary Smith
Off the top of my head, try this. SELECT MONTHNAME(s.created) AS month, sum(if(ifnull(s.id,0) 0, 1, 0)) AS num_logins, sim(if(ifnull(d.id, 0) 0, 1, 0)) AS num_downloads FROM sessions AS s LEFT JOIN downloads AS d ON d.session_id = s.id GROUP BY month

RE: Client deleted database, semi high priority master slave question

2009-07-08 Thread Daevid Vincent
-Original Message- From: Scott Haneda [mailto:talkli...@newgeo.com] Sent: Wednesday, July 08, 2009 9:50 AM To: mysql@lists.mysql.com Subject: Client deleted database, semi high priority master slave question A client deleted their database and did not have a slave in place

Re: COUNT from 2 tables

2009-07-08 Thread b
On 07/08/2009 03:33 PM, Gary Smith wrote: Off the top of my head, try this. SELECT MONTHNAME(s.created) AS month, sum(if(ifnull(s.id,0) 0, 1, 0)) AS num_logins, sim(if(ifnull(d.id, 0) 0, 1, 0)) AS num_downloads FROM sessions AS s LEFT JOIN downloads AS d ON d.session_id = s.id GROUP BY month

Replication switch Master to slave and back

2009-07-08 Thread Cantwell, Bryan
I have successfully set up a replication master/slave scenario with my MySQL 5.0.51a Now in the event of a fail over to the slave (an identical appliance), I want the old master to become the slave for an eventual switch back the other way. Would it really take the same process to keep the old

Re: Client deleted database, semi high priority master slave question

2009-07-08 Thread Scott Haneda
On Jul 8, 2009, at 12:49 PM, Daevid Vincent wrote: Ouch. I know it comes a little too late, but as a preventive measure going forward, I offer up my daily crontab backup script: http://www.daevid.com/content/examples/daily_backup.php They move a lot of data, so scheduled dumps were not

Re: Client deleted database, semi high priority master slave question

2009-07-08 Thread Scott Haneda
On Jul 8, 2009, at 12:49 PM, Daevid Vincent wrote: I know it comes a little too late, but as a preventive measure going forward, I offer up my daily crontab backup script: http://www.daevid.com/content/examples/daily_backup.php FYI, this link does not work in Safari. -- Scott * If you

Re: Replication switch Master to slave and back

2009-07-08 Thread Aaron Blew
The simplest method may be to set them up in a multi-master configuration, similar to what's documented here: http://www.onlamp.com/pub/a/onlamp/2006/04/20/advanced-mysql-replication.html This way you won't have to worry about switching between two masters in a failover scenario since they're

Re: Replication switch Master to slave and back

2009-07-08 Thread Marcus Bointon
On 8 Jul 2009, at 22:26, Aaron Blew wrote: The simplest method may be to set them up in a multi-master configuration, similar to what's documented here: http://www.onlamp.com/pub/a/onlamp/2006/04/20/advanced-mysql-replication.html This way you won't have to worry about switching between two

CONCAT with IF?

2009-07-08 Thread Matt Neimeyer
I want to store the product version that an article applies to and a comparison operator in my news system. But I can't wrap my head around the where clause... Here's what I've tried... CREATE TABLE test (version char(10), direction char(2)); select concat(6.0,direction,version) as operation

RE: COUNT from 2 tables

2009-07-08 Thread Gary Smith
Create a view or sub select, denormalizing the data and then group it. select month, sum(login) as num_logins, sum(download) as num_downloads from ( select monthname(s.created) as month_name , if(ifnull(s.id, 0) 0, 1, 0) as login , if(ifnull(d.id, 0) 0, 1, 0) as download from sessions s left

RE: CONCAT with IF?

2009-07-08 Thread Gavin Towey
Something like: SET @version = 6.0; SELECT CASE direction WHEN '' THEN IF( @version version, 'Y', 'N') WHEN '' THEN IF (@version version, 'Y','N) ... END AS operation FROM test; -Original Message- From: Matt Neimeyer [mailto:m...@neimeyer.org] Sent: Wednesday, July 08, 2009 2:45 PM

Another Trigger Question!

2009-07-08 Thread Marcel Grandemange
Good Day once again. Im needing assistance again with triggers! Create Trigger hostchange BEFORE UPDATE ON host FOR EACH ROW BEGIN IF NEW.status != OLD.status THEN use smsgw; insert into outbox (number, insertdate, text, phone, dreport) VALUES ('0836075144', '', 'HostDown', '1',

Re: COUNT from 2 tables

2009-07-08 Thread b
On 07/08/2009 06:11 PM, Gary Smith wrote: Create a view or sub select, denormalizing the data and then group it. select month, sum(login) as num_logins, sum(download) as num_downloads from ( select monthname(s.created) as month_name , if(ifnull(s.id, 0) 0, 1, 0) as login , if(ifnull(d.id, 0)

Re: Another Trigger Question!

2009-07-08 Thread Dan Nelson
In the last episode (Jul 09), Marcel Grandemange said: Create Trigger hostchange BEFORE UPDATE ON host FOR EACH ROW BEGIN IF NEW.status != OLD.status THEN use smsgw; insert into outbox (number, insertdate, text, phone, dreport) VALUES ('0836075144', '', 'HostDown', '1', '1')); END IF;