Copying DB to new structure

2006-12-13 Thread Russell Horn
We have a moderately sized database, more than 5GB in size, several million rows and 70 tables. We're running MySQL 5.22 and the database uses innodb throughout with multiple foreign keys in use. During development the structure of several tables has been changed many times, such that we now

**** Probably Spam (6.1) **** Slow performance - any suggestions?

2006-08-28 Thread Russell Horn
Spam detection software, running on the system "marmalade.snp.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see [EMAIL PROTECTED] for details

Innodb import tuning on Sun T2000

2006-07-07 Thread Russell Horn
Folks, I'm trying to import a sql dump of a database which is taking an age. I've disabled foreign key constraints, unique checks and set autocommit to 0 but this is still slow. My data file has a number of tables, one of which has circa 3.5 million tuples taking up about 500MB of data with 900MB

Looking for advice on how to store and query some data

2006-04-10 Thread Russell Horn
Hi, I'm storing data against a bunch of people and want to track how it changes. So, I have a person table where everyone has a person ID and a results table a bit like this: | personID | classification | date | | 1| 0 | 2005-11-10 | | 2| 3 | 2005-1

Table comments truncated at 80 characters

2006-02-09 Thread Russell Horn
Since upgrading from 4.x to 5.x we've found table comments to be truncated at 80 characters. Is this a configurable option somewhere and I just can't find it in the manual? Thanks, Russell. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http:/

Re: Select records added in last hour

2006-01-19 Thread Russell Horn
On Thu, 2006-01-19 at 11:49 -0800, Devananda wrote: > > Rather than the CURDATE() function, just use NOW(). This is perfect. Thanks. Russell -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Select records added in last hour

2006-01-19 Thread Russell Horn
I have a table containing a timestamp field, `insert_time` The manual is clear when it comes to selecting records from the past week or month, I can use: SELECT COUNT(*) FROM statistics WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= `insert_time`; What I am less sure about is how I would sele

Matching phone numbers to addresses

2005-12-21 Thread Russell Horn
I have a couple of tables like so: FName FInitial SName SName Address1Address1 Address2Address2 Address3Address3 Zip Zip Phone I need to match the phone numbers to the a

Re: Query Combining tables

2005-08-05 Thread Russell Horn
Thanks for the two incredibly fast responses, they were perfect - problem solved. Russell. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Query Combining tables

2005-08-05 Thread Russell Horn
I'm having difficulty writing a query as follows. I'm unsure if I need a subquery, a union or if this isn't actually possible without using temporary tables. I have two tables for members. Table 1 (members) Table 2 (payments) +--++ +-+--+ | memno

Joining tables - restricting selected records

2005-06-28 Thread Russell Horn
This must have come up before, but I've not found it using a google search. I have two tables customer and purchases customer: customerID customerName purchases: purchaseID customerID purchaseDate purchaseValue Is it possible in MySQL to join the tables so I only get the value of t

Cumulative Totals

2005-05-25 Thread Russell Horn
I have a pretty simple table with a list of payments, not much more than: paymentID | amount | paymentDate 1 | 123| 2005-01-10 2 | 77 | 2005-01-13 3 | 45 | 2005-02-16 4 | 13 | 2005-02-17 I can get totals per month using a query like: SELECT SUM(am

RE: turning off binary logging

2004-04-13 Thread Russell Horn
> I just found that mysql 4.0.18 is doing binary logging. How can I > turn this off? > I do not see a nead for this, plus I fear that > it might fill up the file system, plus I think it is reducing performance. > The binary log is primarily there to let you restore data. Say you backup every nigh

RE: Set Password [SOLVED]

2004-04-12 Thread Russell Horn
> The man page says > > /usr/bin/mysqladmin -u user -p somepassword > Not here it doesn't. My man page says: mysqladmin [-#|--debug= logfile] [-f|--force] [-?|--help] [--character-sets-dir=directory] [-C|--compress] [-h|--host=[#]] [-p[pwd]] [--password=[pwd]]

Select inside a subquery

2004-04-09 Thread Russell Horn
I ahve a problem with updating a row using a field from another row in the same table. The mySQL manual says: Error 1093 (ER_UPDATE_TABLE_USED) SQLSTATE = HY000 Message = "You can't specify target table 'x' for update in FROM clause" This error will occur in cases like this:

Update using fields from another table

2004-03-18 Thread Russell Horn
I haev three tables: Table 1 id_2 | date Table 2 id_1 | id_2 Table 3 id_1 I want to set the table1.date = '2004-03-18' for each record in table3. Any ideas? Thanks, Russell. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lis

RE: Bash script to MySql

2004-02-04 Thread Russell Horn
Why not use another language that has mysql hooks built in? For example, from version 4.3.0 PHP comes with SAPI to allow scripting from the command line, ideal for cron style tasks and it's mysql support is very mature. -- Russell. -- MySQL General Mailing List For list archives: http://lists

RE: SQL question: Finding duplicates

2004-02-03 Thread Russell Horn
> > row | foo > 1 | a > 2 | c > 3 | b > 4 | c > 5 | a > 6 | d > > the statement would return me rows 1, 2, 4, and 5. > CREATE TEMPORARY TABLE temptable SELECT * FROM test GROUP BY foo HAVING COUNT( * ) >1 ORDER BY foo ASC ; SELECT * FROM test, temptable WHERE test.foo = temptable.f

RE: Advise on High Availability configuration

2004-02-02 Thread Russell Horn
Andrew Braithwaite wrote: > Each slave keeps a heartbeat to the master and in the event of a failure, > changes it's master to master2. So how does this bit work? If one master falls over and slaves move to master two, how do you rebuild master one without downtime? Don't the slaves try and use M

RE: Can't connect from localhost using 4.1.1 alpha

2004-01-28 Thread Russell Horn
> Also, if I (mysql -u root -p root) from localhost, then it prompts me > for a password. I enter password 'root' and then I get this error: That's what's supposed to happen: You use ~> mysql -u username -p database_name Then you are prompted for the password for root and it will start in data