Re: hard disk crash: how to discover the db?

2010-09-10 Thread Mike McMullin
On Fri, 2010-09-10 at 15:57 +0200, Uwe Brauer wrote: > > On Fri, 10 Sep 2010 04:43:39 -0400, Mike McMullin > > wrote: > >> On Thu, 2010-09-09 at 18:02 -0400, George Larson wrote: >>> >>> Good luck! >>> G > >> While this sounds like an idea, does anyone know if the

Re: statistics statement in general log

2010-09-10 Thread Baron Schwartz
Those are from a 'status' API call. Many ORMs use such calls to check that the database connection is alive. On Thu, Sep 9, 2010 at 2:14 AM, raid fifa wrote: > Hi guys, > anyone knows what's the meaning of "statistics" in general log ? thanks. > ... > 100908  9:40:11 21513 Statistics > 100908  9

Re: Replaying the mysqld.log file from production onto QA???

2010-09-10 Thread Baron Schwartz
The mysqld.log isn't in an executable format, but mk-query-digest can understand it and convert it into a "slow query log" format. Then you can use mk-upgrade to validate that your queries produce the same result. Good for you for thinking to do this -- most people just upgrade and then panic whe

Re: Replaying the mysqld.log file from production onto QA???

2010-09-10 Thread Johnny Withers
Would something like: http://www.maatkit.org/doc/mk-log-player.html Work? I know the timings won't be the same as how the queries actually came in, but it could be a start, JW On Fri, Sep 10, 2010 at 8:38 AM, Johan De Meersman wrote: > On Fri

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Johnny Withers
If you still have the mysqld binary and you _think_ it is version 5.3.something, you could try this: strings /usr/libexec/mysqld | grep "5.3.*" The version # should be somewhere near the top of the output. (Is on my copy anyway, of 5.0.x) -- *Johnny Withers* jwith

Re: Get max ID of each item in a list

2010-09-10 Thread Kévin Labécot
SELECT tid,max(id) FROM mytable GROUP BY tid Le 10 sept. 2010 à 19:12, Bryan Cantwell a écrit : > I have a simple table > > mytable > id int > time_stamp tiemstamp > value int > tid int > > I want to find the max id for each individual tid in my table. > > if I did it one by one it would be:

Get max ID of each item in a list

2010-09-10 Thread Bryan Cantwell
I have a simple table mytable id int time_stamp tiemstamp value int tid int I want to find the max id for each individual tid in my table. if I did it one by one it would be: select max(id) from mytable where tid = 12345; but how can I do something more like: select concat(tid,':',id) from my

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Johnny Withers
I agree with everyone else here. This NOT a backup job listed here. it is a RESTORE job that is restoring data previously backed up into a file named 'file.tar' (should probably be file.tar.gz or file.tgz anyway). This sequence of commands should never be run on a server that you are wanting to b

Re: hard disk crash: how to discover the db?

2010-09-10 Thread george larson
Shawn Green (MySQL) wrote: > On 9/10/2010 10:01 AM, george larson wrote: >> >> Uwe Brauer wrote: >> ... >> The only one I know of, for my environment, is /etc/my.cnf. I believe >> that it can be located elsewhere but you could just use 'find' to find >> it. I've broken my dev. MySQL many, many

Re: newbie question database tables

2010-09-10 Thread Patrice Olivier-Wilson
On 9/10/10 12:31 PM, Jerry Schwartz wrote: Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 E-mail: je...@gii.co.jp Web site: www.the-infoshop.com Thank you! -- Patrice Olivier-Wilson http://biz-comm.com -- My

RE: newbie question database tables

2010-09-10 Thread Jerry Schwartz
Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 E-mail: je...@gii.co.jp Web site: www.the-infoshop.com >-Original Message- >From: Patrice Olivier-Wilson [mailto:b...@biz-comm.com] >Sent: Friday, September 1

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Shawn Green (MySQL)
On 9/10/2010 10:01 AM, george larson wrote: Uwe Brauer wrote: ... The only one I know of, for my environment, is /etc/my.cnf. I believe that it can be located elsewhere but you could just use 'find' to find it. I've broken my dev. MySQL many, many times and that's the only file I know about ou

newbie question database tables

2010-09-10 Thread Patrice Olivier-Wilson
I'm working on a database that needs to do a few things and getting brain freeze on one part. Scenario: I want to compile a db of articles with these tables: Categories Topics Users Categories cat_ID | cat_name Topics top_ID | top_name | top_content | cat_ID Users user_ID | user_nam

Re: Query conditions

2010-09-10 Thread Michael Dykman
It's about syntax and clarity, both for the reader and to the query optimizer. The JOIN conditions belong in the ON sub-statement precisely because they are the predicate for the join and serve to grow the data set .. the WHERE query is supposed to specify limiting conditions on that superset. W

Re: hard disk crash: how to discover the db?

2010-09-10 Thread george larson
Hi Steve. Steve Staples wrote: > did I miss the joke here? Why does this backup script look SO wrong, > and very malicious? > > service mysql stop -- stopping mysql... that's fine. > cd /var/lib/mysql -- changing directories to the /var/lib/mysql, ok... > fine > rm -rf * -- WHAT? WHY ARE YOU RE

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Uwe Brauer
> On Fri, 10 Sep 2010 10:01:30 -0400, george larson > wrote: > The only one I know of, for my environment, is > /etc/my.cnf. I believe that it can be located > elsewhere but you could just use 'find' to find it. > I've broken my dev. MySQL many, many times and that's > t

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Steve Staples
did I miss the joke here? Why does this backup script look SO wrong, and very malicious? service mysql stop -- stopping mysql... that's fine. cd /var/lib/mysql -- changing directories to the /var/lib/mysql, ok... fine rm -rf * -- WHAT? WHY ARE YOU REMOVING RECUSIVLY and FORCING DELETES on all t

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Uwe Brauer
> On Thu, 09 Sep 2010 18:02:09 -0400, George Larson > wrote: > We do nightly backups at work just by taring the mysql directory. In > my environment, that is /var/lib/mysql. > Like this: > service mysql stop > cd /var/lib/mysql > rm -rf * > tar zxvf file.tar >

Re: hard disk crash: how to discover the db?

2010-09-10 Thread george larson
Uwe Brauer wrote: >> On Thu, 09 Sep 2010 18:02:09 -0400, George Larson >> wrote: > >> We do nightly backups at work just by taring the mysql directory. In >> my environment, that is /var/lib/mysql. > >> Like this: > >> service mysql stop >> cd /var/lib/mysql >>

RE: Replaying the mysqld.log file from production onto QA???

2010-09-10 Thread Jerry Schwartz
If possible, use web server logging to get the timings. As I explained in my previous essay, this is not at all simple or easy. If you run a benchmark more than once, be sure to reboot the system between runs. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmingt

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Uwe Brauer
> On Fri, 10 Sep 2010 04:43:39 -0400, Mike McMullin > wrote: > On Thu, 2010-09-09 at 18:02 -0400, George Larson wrote: >> >> Good luck! >> G > While this sounds like an idea, does anyone know if there are actual > version idiosyncrasies that need to be looked at fir

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Uwe Brauer
> On Fri, 10 Sep 2010 10:57:54 +0200, Joerg Bruehe > wrote: > Hi George, everybody! > George Larson wrote: >> We do nightly backups at work just by taring the mysql directory. In >> my environment, that is /var/lib/mysql. >> >> Like this: >> >> service mysql st

Re: Replaying the mysqld.log file from production onto QA???

2010-09-10 Thread Johan De Meersman
On Fri, Sep 10, 2010 at 1:56 PM, Shawn Green (MySQL) < shawn.l.gr...@oracle.com> wrote: > He already did! Those are the logs he needs to replay. He has the logs > already but needs tools to extract the commands and repeat them as a load > test. > > Do you have any techniques you can share? > Alas

Query conditions

2010-09-10 Thread george larson
Hi all. I've got a greenhorn question but I didn't find the right keywords to get Google to answer it for me. Is it more efficient to put conditions in a JOIN instead of sticking them all at the end in the WHERE clause, or is that just a matter of preference? Putting conditions in the JOIN It se

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Johan De Meersman
And still, nobody answered the man's actual question: can a Linux mysqld read mac datafiles ? I'd say "make a copy and try it". As long as you always keep a copy of the original files, you're not risking anything. You might run into things varying from incompatible MySQL versions to different endi

Re: Replaying the mysqld.log file from production onto QA???

2010-09-10 Thread Shawn Green (MySQL)
Hello Johan, On 9/10/2010 7:47 AM, Johan De Meersman wrote: On Thu, Sep 9, 2010 at 4:12 PM, Nunzio Daveri wrote: So.. I am trying to mimic replaying production like queries so joins, temp tables etc... are stuff I am trying to test as well. Just doing a dump and import is no more than export

Re: Replaying the mysqld.log file from production onto QA???

2010-09-10 Thread Johan De Meersman
On Thu, Sep 9, 2010 at 4:12 PM, Nunzio Daveri wrote: > So.. I am trying to mimic replaying production like queries so joins, temp > tables etc... are stuff I am trying to test as well. Just doing a dump and > import is no more than export and importing, I also want to test selects, > updates :-)

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Joerg Bruehe
Hi George, everybody! George Larson wrote: > We do nightly backups at work just by taring the mysql directory. In > my environment, that is /var/lib/mysql. > > Like this: > > service mysql stop > cd /var/lib/mysql > rm -rf * For your own benefit, I hope you don't do that on the mach

Re: hard disk crash: how to discover the db?

2010-09-10 Thread Mike McMullin
On Thu, 2010-09-09 at 18:02 -0400, George Larson wrote: > We do nightly backups at work just by taring the mysql directory. In > my environment, that is /var/lib/mysql. > > Like this: > > service mysql stop > cd /var/lib/mysql > rm -rf * > tar zxvf file.tar > rm -rf ib_logfile* > chown -R mysql.