UPDATE/lock problems?

2006-04-03 Thread Chris Kantarjiev
I'm seeing some very odd locking behaviour on 4.1.13: mysql> show full processlist; ++--++--+-+--++---

Need for distinct sum

2006-04-03 Thread Yasir Assam
Hello, I need to be able to sum over distinct values but I can't seem to do it unless I use sub-selects (which I want to avoid doing). To see what I mean, I've constructed a toy DB: DROP TABLE IF EXISTS spell; CREATE TABLE spell ( id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, power F

better way of doing 1800 sequential updates?

2006-04-03 Thread Ariel Sánchez Mora
This table holds latest data from an app: mysql> select * from ultimas_respuestas_snmp limit 10; +++---+-+---++--+ | id | info_oficina | columna_donde_guardar | info_interfaz | valorSNMP | nom

// confusing syntax error when importing //

2006-04-03 Thread julian oliver
--apologies if you receive this email from another account-- hi, i exported a *.sql using phpMyAdmin on a system running: mysql Ver 14.12 Distrib 5.0.19, for pc-linux-gnu (i486) using readline 5.1 i'm trying to import it from this localhost to a remote host running:

Re: Undelete rows with .MYD-File?

2006-04-03 Thread mysql
Thankyou for your reply Dilipkumar. Much appreciated. Regards Keith On Tue, 4 Apr 2006, Dilipkumar wrote: > To: [EMAIL PROTECTED] > From: Dilipkumar <[EMAIL PROTECTED]> > Subject: Re: Undelete rows with .MYD-File? > > Hi, > > If it is a busry server you cannot copy MYD & FRM file * MYI files

Re: differences between varchar and text fields

2006-04-03 Thread Adam i Agnieszka Gąsiorowski FNORD
On 2006-01-20, at 01:13, Tucker Cunningham wrote: So, my question is: what are the pros and cons of using varchar vs. text/longtext? Right now, longtext seems to be the best option (it provides most flexibility in data that can be stored, at only a 2-byte-per-row storage premium) There

Re: Undelete rows with .MYD-File?

2006-04-03 Thread mysql
As my server does not get alot of traffic I tend to shutdown mysql, and do an OS copy of the complete /var/lib/mysql directory to another partition on another drive. Then restart mysql again. This may not be a feasable option on a busy server. Obviously each person has their way of doing back

Re: restoring database previous mysql version

2006-04-03 Thread Kishore Jalleda
if I have to put in one line, then just taka a copy (zip, gzip, tar or whatever) of your old mysql data directory, like /usr/local/mysql/data, and then restore it into your new data directory under 4.1.x, and this should be fine assuming you have taken care of other things, also please refer to the

restoring database previous mysql version

2006-04-03 Thread murat .
Dear Sir, I have 8 mb total SQL database, i'm currently using mysql version: 4.1.11-debian. Our database uses latin5 character set and collate: latin5_turkish_ci And now... how can i restore this database without problem; previous mysql version? previous mysql version is: 4.0.25-standart

Re: Index and multiple fields

2006-04-03 Thread Jon Drukman
Markus Fischer wrote: Basically, this means if I've a table like this id1 id2 id3 id4 id5 and I've two different select statements: select * from ... where id1 = .. and id2 = .. and the other being select * from ... where id3 = .. and id4 = .. I would create two indexes, one for id1/id2 and

Re: Select Sum with union, tricky question perhaps not for you

2006-04-03 Thread H L
The solution is to redesign your tables. You need to split into separate columns the values you want to maintain. You do not want to keep the "flat file" design you are currently trying to use. CREATE TABLE calendar ( objectid, year, dayofyear, ... other fields... ) CREATE TABLE price

Re: Undelete rows with .MYD-File?

2006-04-03 Thread mysql
karsites:/var/swissmade # ./myisamchk -dvv shop_item.MYI MyISAM file: shop_item.MYI Record format: Packed Character set: latin1_swedish_ci (8) File-version:1 Creation time: 2006-03-31 13:59:48 Status: open,changed Auto increment key: 1 Last value: 67

Re: Limited trafic in 5.0?

2006-04-03 Thread sheeri kritzer
You might want to change those. I'm guessing your wait_timeout is set to the default of a day. Is the application letting go of connections? If you do a SHOW PROCESSLIST on the server, is there really only one connection, or are there many? -Sheeri On 4/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTE

Re: on select statements

2006-04-03 Thread sheeri kritzer
There is no logical difference. There's a tiny bit of overhead in preparing and executing the statements, but if you have a query where the limit is variable, a prepared statement might be better than coding within an application, because then when ANY user or application connects it can use that

Re: Is port forwarded connection taken as local?

2006-04-03 Thread Kishore Jalleda
in port forwarding , all you are saying is !!ok, if server1 gets any connection on port 3307 then forward that connection to port 3306 on server2, so essentially the connection on server2 for Mysql is coming from the client on server1 , so the user you are using to connect to server2 from server1

Re: Strange thing

2006-04-03 Thread Kishore Jalleda
So what you are doing here is sending some sql statements from the dump to mysql CLI, so all that in going into the pipe is just plain text output from the dump, it does pass in any auth parameters, so for your script to run just add the required user, pwd etc as arguments to the mysql cli utility,

Re: how to quit a (CLI) script ?

2006-04-03 Thread Kishore Jalleda
I am not sure if you can do this from the Mysql CLI, but a better way of doing this would be to use an external script like PHP, PERL, BASH, etc as they have a better way of error checking againest Mysql. Kishore Jalleda http://kjalleda.googlepages.com/projects On 4/3/06, C.R.Vegelin <[EMAIL PROT

Re: Undelete rows with .MYD-File?

2006-04-03 Thread mysql
IIRC there may be a hidden field in each table row that mysql uses to mark that row as deleted. I'm not sure if you can use some mysql utility program such as myisamchk to undelete the rows. This may be possible. Regards Keith In theory, theory and practice are the same; in practice they ar

Re: Undelete rows with .MYD-File?

2006-04-03 Thread mysql
I have downloaded the table files and this is what I get: mysql> use swissmade; Database changed mysql> show tables; +-+ | Tables_in_swissmade | +-+ | shop_item | +-+ 1 row in set (0.00 sec) mysql> select * from shop_item \G E

how to quit a (CLI) script ?

2006-04-03 Thread C.R.Vegelin
Hi everyone, I use many scripts that are started from the CLI (MySQL 5.0.15). And if errors occur, I want to quit a script. I looked at: http://dev.mysql.com/doc/refman/5.0/en/show-errors.html and found Show Count(*) Errors; and for Select @@error_count; But how to quit a CLI script, if @@error_co

Re: Undelete rows with .MYD-File?

2006-04-03 Thread mysql
If those three files were backed up some where before you dropped the table all you need to do is to copy them back into the data dir, and things should be ok again. Keith In theory, theory and practice are the same; in practice they are not. On Mon, 3 Apr 2006, Nico Schefer wrote: > To: mysq

Undelete rows with .MYD-File?

2006-04-03 Thread Nico Schefer
Hi! Today i've dropped a MySQL-table and realized seconds later that i've dropped the wrong one.. I've saved the .MYD-File and tried to recover it with a tool (MySQLRecovery 1.5), but it just recovered the structure and not the data (about 620 rows). I've searched now all the day and not found

Re: Syntax Question Constraint, Index

2006-04-03 Thread Martijn Tonies
>Create table events ( >uid BIGINT NOT NULL AUTO_INCREMENT, >name VARCHAR(255), >start_date DATE, >duration INTEGER, >location_id BIGINT, >primary key (uid) >); > >Create table locations ( >uid BIGINT NOT NULL AUTO_INCREMENT, >name VARCHAR(255), >address VARCHAR(255), >primary key (uid) >) > >Alter

Re: Is port forwarded connection taken as local?

2006-04-03 Thread Bing Du
> Bing Du wrote: > >>Hello everyone, >> >>What I'm after is trying to figure out a way to centrally and remotely >>managing (e.g. on server1) our MySQL servers (server2 is an example) on >>different machines. Right now, these MySQL servers are all set up to >> only >>accept logons from localhost.

Syntax Question Constraint, Index

2006-04-03 Thread Scott Purcell
I ran into some syntax over the weekend, that I am trying to make sense of. Here is the create table statements. Drop table if exists events Drop table if exists locations Create table events ( uid BIGINT NOT NULL AUTO_INCREMENT, name VARCHAR(255), start_date DATE, duration INTEGER,

on select statements

2006-04-03 Thread Yemi Obembe
what is the difference between this: SET @a=1; PREPARE STMT FROM 'SELECT * FROM tbl LIMIT ?';EXECUTE STMT USING @a; and this: 'SELECT * FROM tbl LIMIT 1 And then this: SET @skip=1; SET @numrows=5; PREPARE STMT FROM 'SELECT * FROM tbl LIMIT ?, ?'; EXECUTE STMT USING @skip, @numrows; and this: '

Re: Way of declaring variables?

2006-04-03 Thread Gabriel PREDA
First of all... yes... in MySQL variables are declared and used with @ Now for the ":" ... there is no particular role... they're there because otherwise the SQL parser will be confused... *SELECT column1, @neededValue=column2 FROM table_name LIMIT 1* *SELECT column1, @neededValue:=column2 FROM t

Re: Unsigned

2006-04-03 Thread Jos Elkink
Hi Yemi, It means the variable contains only positive values - otherwise one bit would be used to denote whether it's positive or negative. From the documentation: SMALLINT[(M)] [UNSIGNED] [ZEROFILL] A small integer. The signed range is -32768 to 32767. The unsigned range is 0 to 65535. Jos On

Unsigned

2006-04-03 Thread Yemi Obembe
What does it mean declaring a table unsigned? An example is a s below: id smallint unsigned not null auto_increment

Way of declaring variables?

2006-04-03 Thread Yemi Obembe
Got the snippet from the mysql website: select @last := last_insert_id() i av the hunch that is to assign the variable 'last' to the last_insert_id(). Im i right? is placing @ before a word mysql's way of declaring variables? what's the work of the colon preceeding the equal sign? -- http://ngB

Re: Random 'select permission denied' since upgrade to 5.0.18

2006-04-03 Thread Mark Leith
Jorrit Kronjee wrote: On 3/29/2006 2:10 PM, Jorrit Kronjee wrote Mark, Apparently so, thanks for the hint! We'll try to upgrade as soon as possible. I'll supply the mailing list with the results of the upgrade. Mark, We've been testing it over the weekend and it seems that the bugs

Re: error 28 from table handler

2006-04-03 Thread Jacques Brignon
Thanks, Table corruption is exactly what I fear as a result of this problem. As long as things semm to work again now after the hister cleaned some temp files, how do I check my db for possible table corruptions? Selon prathima rao <[EMAIL PROTECTED]>: > if u have shut down the system then the

Trans.: Re: error 28 from table handler

2006-04-03 Thread Jacques Brignon
Oops forgot to include the list - Message transféré de Jacques Brignon <[EMAIL PROTECTED]> - Date : Mon, 03 Apr 2006 10:07:58 +0200 De : Jacques Brignon <[EMAIL PROTECTED]> Adresse de retour :Jacques Brignon <[EMAIL PROTECTED]> Sujet : Re: error 28 from table handler À :

Re: Random 'select permission denied' since upgrade to 5.0.18

2006-04-03 Thread Jorrit Kronjee
On 3/29/2006 2:10 PM, Jorrit Kronjee wrote: >> It seems you are running in to Bug #7209: >> >> http://bugs.mysql.com/bug.php?id=7209 >> >> This is fixed in 5.0.19 now. >> >> Best regards >> >> Mark >> > > Mark, > > Apparently so, thanks for the hint! We'll try to upgrade as soon as > possible. >

Re: error 28 from table handler

2006-04-03 Thread Sander Smeenk
Quoting Jacques Brignon ([EMAIL PROTECTED]): > "1030 : Got error 28 from table handler" % perror 28 OS error code 28: No space left on device > Any idea of what might cause that, and what should be done to correct > this situation? Aparently the disk that stores your MySQL datadirectory is fu

Re: stunningly slow query

2006-04-03 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes: >> Keith, >> Your method won't guarantee that there are no rows where the combination >> of the values in those four columns fails to repeat in any other row. To >> do that would require an EXTRA four-column unique index of type UNIQUE.

Re: stunningly slow query

2006-04-03 Thread mysql
On Mon, 3 Apr 2006 [EMAIL PROTECTED] wrote: > To: [EMAIL PROTECTED] > From: [EMAIL PROTECTED] > Subject: Re: stunningly slow query > > [EMAIL PROTECTED] wrote on 04/02/2006 05:35:59 PM: > > > > > > Can you post your show create table tbl_name statement for > > > > these tables that involve sl