Re: mysql repair question

2008-03-12 Thread Krishna Chandra Prajapati
Try using myisamchk -r option for repairing the table. On Wed, Mar 12, 2008 at 2:53 PM, pengyao <[EMAIL PROTECTED]> wrote: > hi,i have a question,such as: > > mysql> select * from test; > ERROR 1194 (HY000): Table 'test' is marked as crashed and should be > repaired . > > i think the "test" tab

cursors

2008-03-12 Thread smriti Sebastian
Hi all, I tried to implement a cursor using the following statement: create procedure curdemo() begin declare cursor1 cursor for select SID from customer; I have a customer table with a field SID. BUt I am getting an error ERROR 1064 (42000): You have an error in your SQL syntax; check the manual

Re: write lock and sql_cache

2008-03-12 Thread Werner Puschitz
MAS! wrote: > does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works even > for a cached result? > > this is my scenario, (I'm using MyIsam tables) > > thread 1: > LOCK TABLE foo WRITE; > > thread 2: > SELECT * FROM foo ; > (locked) > > thread 1: > UNLOCK TABLES; > > thread 2: > res

Re: write lock and sql_cache

2008-03-12 Thread Baron Schwartz
On Wed, Mar 12, 2008 at 3:22 PM, Daniel Brown <[EMAIL PROTECTED]> wrote: > On Wed, Mar 12, 2008 at 3:15 PM, MAS! <[EMAIL PROTECTED]> wrote: > > does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works > > even for a cached result? > > Hold your horses, dude. That's the third time y

ERROR 1062 (23000): Duplicate entry '1' for key 1 during SELECT

2008-03-12 Thread mike
>Description: When running the statements below, MySQL errors out with: ERROR 1062 (23000) at line 5: Duplicate entry '1' for key 1 during SELECT >How-To-Repeat: drop table if exists t; create table t (f int not null); insert into t values (1),(1); select 1 from t straight_join t as t2

Re: log changes

2008-03-12 Thread Michael Dykman
On Wed, Mar 12, 2008 at 12:48 PM, Hiep Nguyen <[EMAIL PROTECTED]> wrote: > hi all, > > i have a table (not my design) with a lot of fields and users have access > to insert/update/delete record from this table. is there a way that mysql > can log all transactions who change what on this table??

Re: Migrate HUGE Database

2008-03-12 Thread Daniel Brown
On Wed, Mar 12, 2008 at 3:26 PM, Tim McDaniel <[EMAIL PROTECTED]> wrote: > On Wed, 12 Mar 2008, Michael Dykman <[EMAIL PROTECTED]> wrote: > > > It's quite simple; -p, --password takes an optional argument which > > it will only look for if > >a) the short form is immediately followed by a no

Re: Migrate HUGE Database

2008-03-12 Thread Tim McDaniel
On Wed, 12 Mar 2008, Michael Dykman <[EMAIL PROTECTED]> wrote: You misunderstand. I realize that putting the password on the command line is insecure in the presence of "ps auxwww" and Process Explorer and such. I'm kvetching about how mysql and mysqldump parse their arguments, that *

Re: write lock and sql_cache

2008-03-12 Thread Daniel Brown
On Wed, Mar 12, 2008 at 3:15 PM, MAS! <[EMAIL PROTECTED]> wrote: > does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works > even for a cached result? Hold your horses, dude. That's the third time you sent that email. Someone will give you an answer if you're patient. If you

write lock and sql_cache

2008-03-12 Thread MAS!
does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works even for a cached result? this is my scenario, (I'm using MyIsam tables) thread 1: LOCK TABLE foo WRITE; thread 2: SELECT * FROM foo ; (locked) thread 1: UNLOCK TABLES; thread 2: result of SELECT * .. and that's is, IMHO, co

Re: Migrate HUGE Database

2008-03-12 Thread Michael Dykman
> You misunderstand. I realize that putting the password on the command > line is insecure in the presence of "ps auxwww" and Process Explorer > and such. I'm kvetching about how mysql and mysqldump parse their > arguments, that > * -uUSERNAME and -pPASSWORD are parsed similarly > * -

Re: Auto Fill blank Rows

2008-03-12 Thread Bill Newton
To get a blank line instead of NULL you could simply wrap the reference in an IFNULL function: select dummy.row_id,IFNULL(real.reference,'') as Reference from dummy left join real on real.row_id=dummy.row_id; Phil wrote: you could do something like select dummy.row_id,real.reference from

RE: Auto Fill blank Rows

2008-03-12 Thread roger.maynard
Yup! That's the kind of thing I was looking for - I just had a complete blank moment Thanks!!! From: Phil [mailto:[EMAIL PROTECTED] Sent: 12 March 2008 17:05 To: roger.maynard Cc: mysql@lists.mysql.com Subject: Re: Auto Fill blank Rows you could do something

Re: Auto Fill blank Rows

2008-03-12 Thread Phil
you could do something like select dummy.row_id,real.reference from dummy left join real on real.row_id=dummy.row_id; would give NULL on the 'missing' rows, On Wed, Mar 12, 2008 at 12:50 PM, roger.maynard < [EMAIL PROTECTED]> wrote: > Anyone got any bright ideas of how to solve this one? > > I

Auto Fill blank Rows

2008-03-12 Thread roger.maynard
Anyone got any bright ideas of how to solve this one? I have documents which can contain up to 15 rows of information. Each row as it is added to the document reference can have any ROW_ID from 1 to 15 when it is added. I want to be able to "Auto Fill" the blank rows on a SELECT. eg data in

log changes

2008-03-12 Thread Hiep Nguyen
hi all, i have a table (not my design) with a lot of fields and users have access to insert/update/delete record from this table. is there a way that mysql can log all transactions who change what on this table??? or do i have to create a seperate table to keep track the changes? for exampl

write lock and sql_cache

2008-03-12 Thread MAS!
does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works even for a cached result? this is my scenario, (I'm using MyIsam tables) thread 1: LOCK TABLE foo WRITE; thread 2: SELECT * FROM foo ; (locked) thread 1: UNLOCK TABLES; thread 2: result of SELECT * .. and that's is, IMHO, co

write lock and sql_cache

2008-03-12 Thread Marco Stagno
does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works even for a cached result? this is my scenario, (I'm using MyIsam tables) thread 1: LOCK TABLE foo WRITE; thread 2: SELECT * FROM foo ; (locked) thread 1: UNLOCK TABLES; thread 2: result of SELECT * .. and that's is, IMHO, co

slow-query log analysis

2008-03-12 Thread Soenke Ruempler - NorthClick
hi, I've just ran into some problems analyzing the slow-query-log. 1. I have many entries like: # Time: 080312 13:07:33 # [EMAIL PROTECTED]: cms[cms] @ localhost [] # Query_time: 17 Lock_time: 0 Rows_sent: 0 Rows_examined: 0 COMMIT; # [EMAIL PROTECTED]: cms[cms] @ localhost [] # Query_

Re: Store MySQL data files and log files (log bin) separated!!!

2008-03-12 Thread Raj Shekhar
Marcos Vinícius Vieira dos Santos wrote: > I used --localstatedir in ./configure but both data files and log files > was stored together. In your my.cnf file, put the lines (in [mysqld] section datadir = /sgdb/data log-bin = /var/log/mysql -- raj shekhar facts: http://rajshekhar.net | op

Re: mysql repair question

2008-03-12 Thread Raj Shekhar
pengyao wrote: > mysql>check table test; > check | error| Table upgrade required. Please do "REPAIR TABLE `test`" > to fix it! mysql>repair table test; > | test | repair | Warning | Incorrect string value: > | '\xBB\xA8\xBC\xE4\xC1\xBD...' for column 'test' at row 13 | > mysql>check table te

mysql repair question

2008-03-12 Thread pengyao
hi,i have a question,such as: mysql> select * from test; ERROR 1194 (HY000): Table 'test' is marked as crashed and should be repaired . i think the "test" table was breakdown, so mysql>check table test; check | error| Table upgrade required. Please do "REPAIR TABLE `test`" to fix it! mysq

Re: Select Statement

2008-03-12 Thread Sebastian Mendel
Velen schrieb: Hi, I need to write up a select statement something like: Select a.supcode,a.code,b.desc,sum(c.qty),c.dept where a.supcode=b.supcode and a.code=c.code and a.code=b.code and c.dept between $tring1 and $tring2. group by supcode This is fine but the problem is that there is dup