Query Question

2007-04-16 Thread Aaron Clausen

I have a couple of very simple tables to handle a client signin site:

The client table has the following fields:
 client_id int(11) primary key auto_increment
 first_name char(90)
 last_name char(90)

The signin table has the following fields
 record_id int primary key auto_increment
 client_id int
 date datetime

Essentially, the client enters his id and it creates a record in the
signin table.

I need a query that can identify all the clients who signed in for the
first time during a specific month.  I have fought this one for a
couple of days now and just can't seem to get it.

--
Aaron Clausen   [EMAIL PROTECTED]

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



Tough Query Problem

2004-06-16 Thread Aaron Clausen
I am trying to write a script that can take logs from our mail server, boil down the 
rejections to determine the sources of distributed SMTP dictionary attacks against our 
mail server.

Basically I have a table send_failures like this that gets fed with the raw data from 
the logs:

host_ip date
---
111.111.111.110 2004-06-03 13:42:22
34.23.28.1  2004-06-03 13:42:25
65.2.88.25  2004-06-03 13:42:25
111.111.111.110 2004-06-03 13:42:27
65.2.88.25  2004-06-03 13:42:29
64.251.68.722004-06-03 13:42:30

And so on and so forth.

Now it's trivial to write a query to find the pure counting of the attacks:

SELECT host_ip, COUNT(host_ip) AS attempts FROM send_failures GROUP BY host_ip;

However, I also want to have latest date of the attack included as well, so that the 
above exampe would boil down to a query with results like this (I'm running MySQL 
3.23.58):

host_ip attemptslast_attempt_date
---
111.111.111.110 2   2004-06-03 13:42:27
65.2.88.25  2   2004-06-03 13:42:29
64.251.68.721   2004-06-03 13:42:30
65.2.88.25  1   2004-06-03 13:42:25
34.23.28.1  1   2004-06-03 13:42:25

Obviously the actual table is going to have hundreds of thousands of entries (the log 
file for a couple of days ago had 1.2 million rejections).

-- 
A. Clausen
[EMAIL PROTECTED]

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



IP Address Operations in MySQL

2003-09-23 Thread Aaron Clausen
I'm running 3.23.49 on a Win2k machine and wonder if anybody has some advice on how to 
write queries dealing with IP addresses.  Specifically, I have a table with an ip 
address field.  I want to be able to do queries based on subnet.  Has anybody got 
anyting like this?

--
Aaron Clausen

[EMAIL PROTECTED] or [EMAIL PROTECTED]

--

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



Re: Backups mechanism

2003-01-08 Thread Aaron Clausen
On Tue, 7 Jan 2003 [EMAIL PROTECTED] wrote:


  I use mysqldump to do a total backup of my database.  This is done once a
  day just after midnight.  The file is then taken up by our tape backup
  software.  I do hourly backups of our more important databases, also using
  mysqlbackup.  Works fine and I have used it for restorals on a number of
  occasions.  Even better, mysqlbackup generates SQL files, which, with a
  little manipulation, can be imported into other database systems.

  Doesn't mysqldump also create sql files or at least create the commands
 to rebuild what it is dumping?

Using default options, it creates a SQL script that will create the table
structures and reload the data.  You can use the mysql command to
repopulate the database.  I'm in constant development of an in-house
accounting system, and to test out bug fixes, new features, etc., I'll just
dump the running database and pipe it into a test database.  I found
mysqldump to have a bit of a learning curve, but I could not survive without
it now.

-- 
Aaron Clausen


-
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




Re: Backups mechanism

2003-01-07 Thread Aaron Clausen
On Tue, 7 Jan 2003, Jonas Widarsson wrote:

   Hello world!
 Every attempt I have made to find a decent way of backing up a database
 ends up with tons of reading to show hundreds of ways to do database
 backups.

 I want to know which way to do complete backups is most commonly used by
 professional users. (Windows and Linux)

 I have pleasant experience from Microsoft SQL Server 2000 where backung
 up is very confident, easy to understand and just a matter of a mouse click.

 Is there any similarily convenient way to do this with mysql, for example:
 * a shell script (windows / Linux) that works as expected without days
 of configuration?
 * scheduled backups, complete or differential?
 * GUI-solution ??? (mysql control center does not even mention the word
 backup)

 Backup is such an important issue. Why does it seem like it is something
 that the developers don't care about?

I use mysqldump to do a total backup of my database.  This is done once a
day just after midnight.  The file is then taken up by our tape backup
software.  I do hourly backups of our more important databases, also using
mysqlbackup.  Works fine and I have used it for restorals on a number of
occasions.  Even better, mysqlbackup generates SQL files, which, with a
little manipulation, can be imported into other database systems.

-- 
Aaron Clausen


-
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




Re: Can MySQL handle 120 million records?

2002-12-18 Thread Aaron Clausen
On Wed, 18 Dec 2002, Gerald Jensen wrote:

 Joe is right ... we switched from another SQL server to MySQL in 1999, and
 have never looked back.

 MySQL has been rock solid for our applications, the MySQL development team
 is great to work with, and our customers like it.


That's been my experience as well.  We have an in-house billing system which
I originally wrote to work with MS-Access.  I converted the whole thing over
to MySQL via ODBC in June 2000, and it has worked flawlessly ever since.  We
run it under Win2k, though I'm seriously thinking of moving the database
server over to Linux in the next six months.  But MySQL has been rock solid.
I have lost no data, save through my own stupidity, at any point.  I would
recommend it without reservations.

-- 
Aaron Clausen


-
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




RE: Offer to Help MySQL Win32 Port -- Passing Command Parameters

2002-11-15 Thread Aaron Clausen
On Fri, 15 Nov 2002, Joseph D. Wagner wrote:

 OK OK! You've proved me wrong IN THIS PARTICULAR EXAMPLE.  The fact
 remains that plenty other examples exist where MySQL could benefit from
 the .NET Framework.

 WILL MYSQL BE USING THE MICROSOFT .NET FRAMEWORK IN FUTURE DEVELOPMENT
 OF THE WIN32 PORT?

I think that anyone developing portable software should stay as far away
from Microsoft-specific tools as possible.  I see no reason to further cloud
a difficulty area by popping in the latest MS fad, which, no doubt, in four
to five years, will be replaced by some other marketing-driven fad.

In other words, the rule of thumb should be Keep it simple, stupid.

-- 
Aaron Clausen


-
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




Best Column Type for Currency Calculations

2001-06-05 Thread Aaron Clausen

I've been having some problems with currency calculations in SQL queries.
I've been using Double, but often get some very small rounding errors.  What
is the recommended column type for currency in MySQL?

Aaron



-
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




Replication Slave to Master

2001-04-18 Thread Aaron Clausen

How much difficulty is there in turning a MySQL replication server into a master?