Re: MySQL For Huge Collections

2010-06-16 Thread Vikram A
Hi All, In this case how the images of a book will be stored, a chapter may contain number of images with different size. Or It deals only text? Thanks. Vikram A From: Jerry Schwartz je...@gii.co.jp To: Andy listan...@gmail.com; mysql@lists.mysql.com Sent:

Re: [PHP] SQL Syntax

2010-06-16 Thread Nigel Wood
[ I have 2 tables. Table A containing 2 fields. A user ID and a picture ID = A(uid,pid) and another table B, containing 3 fields. The picture ID, an attribute ID and a value for that attribute = B(pid,aid,value). Table B contains several rows for a single PID with various AIDs and values.

Re: [PHP] SQL Syntax

2010-06-16 Thread Nigel Wood
On Wed, 2010-06-16 at 08:59 +0100, Nigel Wood wrote: I'd use: drop temporary table if exists AttSearchMatches; select pid as targetPid, count(*) as criteraMatched from B where userId=35 and ( (b.aid=1 and b.value 50) OR (b.aid=3 and b.value =4) ) group by pid having criteraMatched = 2; drop

Re: int(10) va int(11)

2010-06-16 Thread Lucio Chiappetti
On Mon, 14 Jun 2010, Michael Dykman wrote: 11 characters of display allow for any int of any size, signed or unsigned. When you do not specify a length attribute in a declaration, MySQL uses 11 as the default. As an astrophysicist, I've always considered a flaw the fact that mysql (or SQL

Version-differing replication trouble

2010-06-16 Thread Johan De Meersman
Hey list, Got another strange problem. I'm in the process of migrating a 4.1 server to a 5.1. Replication is not compatible between them, so I have an intermediate 5.0 server. Setup is thus: 4.1 - 5.0 - 5.1 The server-id is different on all servers. It's been soft-set, followed by a flush

Re: query help

2010-06-16 Thread Joerg Bruehe
Hi! Jay Blanchard wrote: [snip] I have a table similar to this: - |transactions | |ID |DATE |EMPLOYEE| |234 |2010-01-05| 345| |328 |2010-04-05| 344| |239 |2010-01-10| 344| Is there a way to query such a table to give the

Re: query help

2010-06-16 Thread Richard Reina
Thank you very much for all the insightful replies. I think I can get it to work with a join. Joerg Bruehe joerg.bru...@sun.com wrote: Hi! Jay Blanchard wrote: [snip] I have a table similar to this: - |transactions | |ID |DATE

RE: query help

2010-06-16 Thread Martin Gainty
i would monitor the performance on outer-join to determine if your server pegging cpu,disk i/o or memory when executing te outer-join then perhaps populating a temp table (and deleting the non-matching records..those records which will be considered in transaction) as joerg suggested i

Re: [PHP] SQL Syntax

2010-06-16 Thread Joerg Bruehe
Hi! Daniel Brown wrote: [Top-post.] You'll probably have much better luck on the MySQL General list. CC'ed on this email. On Tue, Jun 15, 2010 at 20:58, Jan Reiter the-fal...@gmx.net wrote: Hi folks! [[...]] I have 2 tables. Table A containing 2 fields. A user ID and a

RE: Strange GREATEST() result in 5.0.32

2010-06-16 Thread Steven Staples
Baron, Out of curiosity, do you (or anyone else) know what could be an issue with upgrading to even 5.0.93? or even the 5.1 branch? There are a lot of stored procedures/functions, as well as the fact that it is being replicated (the backup server is running multiple instances, and is

RE: MySQL For Huge Collections

2010-06-16 Thread Jerry Schwartz
From: Vikram A [mailto:vikkiatb...@yahoo.in] Sent: Wednesday, June 16, 2010 2:58 AM To: je...@gii.co.jp; Andy; mysql@lists.mysql.com Subject: Re: MySQL For Huge Collections Hi All, In this case how the images of a book will be stored, a chapter may contain number of images with different

Re: Strange GREATEST() result in 5.0.32

2010-06-16 Thread Baron Schwartz
Steven, On Wed, Jun 16, 2010 at 9:09 AM, Steven Staples sstap...@mnsi.net wrote: Baron, Out of curiosity, do you (or anyone else) know what could be an issue with upgrading to even 5.0.93?  or even the 5.1 branch? There are a lot of stored procedures/functions, as well as the fact that it

opening a server to generalized queries but not too far

2010-06-16 Thread Don Cohen
This seems like a topic that must have been studied, but I'm having trouble figuring out what to search for in Google, since the usual discussion of sql injection is not what I'm looking for here. If anyone knows of references that discuss the issue, I'd like to see them. I'm also interested in

Re: opening a server to generalized queries but not too far

2010-06-16 Thread Adam Alkins
Sounds like you just want to GRANT access to specific tables (and with limited commands), which is exactly what MySQL's privilege system does. Refer to http://dev.mysql.com/doc/refman/5.1/en/grant.html http://dev.mysql.com/doc/refman/5.1/en/grant.htmlFor example, you can grant only SELECT

Re: opening a server to generalized queries but not too far

2010-06-16 Thread Don Cohen
Adam Alkins writes: Sounds like you just want to GRANT access to specific tables (and with limited commands), which is exactly what MySQL's privilege system does. How about this part? Finally, suppose I want to limit access to the table to the rows where col1=value1. If I just add that

Re: list rows with no recent updates

2010-06-16 Thread Adam Alkins
One option would be to add a column to the table with a last_updated timestamp. Everytime you update the row, update the last_updated field with the current timestamp. Therefore you could just query the timestamp column to get recently updated rows (or not so recently updated) as you please. --

Re: opening a server to generalized queries but not too far

2010-06-16 Thread Adam Alkins
MySQL doesn't have row level permissions, but this is what VIEWS are for. If you only want access to specific rows, create a view with that subset of data. You can create a function (privilege bound) to create the view to make this more dynamic. If you want direct access to the database, then you

RE: opening a server to generalized queries but not too far

2010-06-16 Thread Daevid Vincent
-Original Message- From: Don Cohen [mailto:don-mysq...@isis.cs3-inc.com] The http request I have in mind will be something like https://server.foo.com?user=johnpassword=wxyz;... and the resulting query something like select ... from table where user=john and ... (I will first

RE: opening a server to generalized queries but not too far

2010-06-16 Thread Don Cohen
Daevid Vincent writes: For the love of God and all that is holy, do NOT put the user/pass on the URL like that!! What's so unholy (or even unwise) about it? Or use mod_auth_mysql to maintain your 'authorized' users to your page. Why is this so much better? In my case it's worse cause

RE: opening a server to generalized queries but not too far

2010-06-16 Thread Wm Mussatto
On Wed, June 16, 2010 14:47, Don Cohen wrote: Daevid Vincent writes: For the love of God and all that is holy, do NOT put the user/pass on the URL like that!! What's so unholy (or even unwise) about it? The username and password shows up in logs on the server and in the browser's

RE: opening a server to generalized queries but not too far

2010-06-16 Thread Daevid Vincent
-Original Message- From: Don Cohen [mailto:don-mysq...@isis.cs3-inc.com] Sent: Wednesday, June 16, 2010 2:48 PM To: Daevid Vincent Cc: mysql@lists.mysql.com Subject: RE: opening a server to generalized queries but not too far Daevid Vincent writes: For the love of God and

RE: opening a server to generalized queries but not too far

2010-06-16 Thread Don Cohen
Daevid Vincent writes: For the love of God and all that is holy, do NOT put the user/pass on the URL like that!! What's so unholy (or even unwise) about it? Oh my goodness, where to begin... Well barring the fact that it'll be in the user's cache and browser It won't because

why the sql so slowly?

2010-06-16 Thread hewei
now , I need to select a table per minute. 1. the table struture: - CREATE TABLE `table_code` ( `timestamp` timestamp NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `code` decimal(5,0) NOT NULL default '0', PRIMARY