Re: Help with query: Row number / Rank from a query...

2006-06-02 Thread Dan

Thanks Peter,

That looks pretty good to me.  I never would have figured that out on  
my own.


Dan T

On Jun 1, 2006, at 4:06 PM, Peter Brawley wrote:


Dan,

I want to get a particular users 'rank' or row number from the query.

SELECT 1+COUNT(*) AS Rank
FROM results r1
INNER JOIN results r2 ON r1.pointsr2.points
WHERE r1.user='Steve';

PB

-

Dan wrote:

I have a regular query lets say:

SELECT user, points FROM results ORDER BY points DESC

so I get:

userpoints
---
john23
steve17
bill14

From this I want to get a particular users 'rank' or row number  
from the query.  I was hoping for a single line elegant query for  
this.


I thought of this:

SET @i = O;
SELECT @i:= @i + 1 as row, SUM(IF(user = 'steve',@i,0)) as rank,  
user FROM points ORDER BY points DESC GROUP BY id;


but I get:

rankuser
---
0john
2steve
0bill

which does not really help me

Any ideas?  I tried the manual, Google and the list with no sucsess.

Thanks,

Dan T

--MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql? 
[EMAIL PROTECTED]




--No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.0/353 - Release Date:  
5/31/2006






--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.0/353 - Release Date:  
5/31/2006





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: measuring query time

2006-06-02 Thread Colin Charles

Deniz Ersoz wrote:
 
Is there a way to get the time spent in the server for each query? Write it

in a log or append it to the result ???


Will what is in the slow query log help?
--
Colin Charles, Community Engineer
MySQL AB, Melbourne, Australia, www.mysql.com
Office: [EMAIL PROTECTED] / +46 18 174 400 ext. 4528
Mobile: +614 12 593 292 / Skype: colincharles

Using MySQL for a FLOSS application?
http://dev.mysql.com/doc/refman/5.0/en/mysql-floss-license-exception.html


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



please help me.

2006-06-02 Thread yuan edit

my operating system is linux redhat 9.0.
i am installing mysql 5.0.x binary distribution.
Which edition is the most fit in the following editions?
And would you like to tell me the difference among these editions?
Thanks very much!

[image: [ ]] mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
27-May-2006 02:32   26M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5
27-May-2006 02:32   82   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz
27-May-2006 02:24   24M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5
27-May-2006 02:24   86   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz
27-May-2006 07:15   30M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.md5


can i speak chinese?

2006-06-02 Thread yuan edit

我的操作系统是redhat 9.0的。
我想装二进制版本的mysql 5.x
但是我不知道哪个版本更适合我。。
我看了一下,mysql最新的版本,有好几个?
我把它列在了下面,有哪位兄弟可以告诉我哪个版本适合我吗?
还有,他们都有什么区别吗?
谢谢大家了。。
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-glibc23.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
27-May-2006 02:32   26M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5
27-May-2006 02:32   82   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz
27-May-2006 02:24   24M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5
27-May-2006 02:24   86   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz
27-May-2006 07:15   30M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.md5
27-May-2006 07:27   74   GZIP compressed docume


Re: How to get machine independent unique id??

2006-06-02 Thread Paul B van den Berg
On 6/1/06, Neeraj [EMAIL PROTECTED] wrote:

 Is there any way to get a unique ids across all databases (by any way) ,
 because records from all the databases are finally get stored on a central
 database. And the ids of transaction (a record)  must remain unique in
 central database. 

The easiest way, without any replication setup, might be to give all your client
databases a unique database_id.
Then in your central database 
 database_id.client_transaction_id 
is guaranteed unique.

Regards, Paul

-- 
Paul B van den Berg, Manager InterAction database, http://www.iadb.nl
Dept of Social Pharmacy, Pharmacoepidemiology and Pharmacotherapeutics
Groningen University Institute for Drug Exploration, tel +31 50361
A Deusinglaan 1, 9713AV Groningen, Netherlands, fax +31 503632772

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Error message when I run mysqld command to start the server

2006-06-02 Thread Swaroop.S
Hello,

I have a problem in strating the server.

I get these errors, please help me in this regard

error
C:\Program Files\EasyPHP1-7\mysql\binmysqld
Can't start server: Bind on TCP/IP port: No error
060602 15:46:50  Do you already have another mysqld server running on
port: 3306
 ?
060602 15:46:50  Aborting

060602 15:46:50  C:\PROGRA~1\EASYPH~1\MYSQL\BIN\MYSQLD.EXE: Got signal 11.
Abort
ing!

060602 15:46:50  Aborting
-


Waiting for the reply at the earilest..


-- 
Regards
Swaroop.S
e-Library
SDM-IMD
swaroops1.googlepages.com


-- 

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

# CAUTION - Disclaimer #
The information contained in this email and any attachments thereto are 
intended for the exclusive use of the addressee(s), and may contain 
proprietary, confidential or privileged information, belonging to SDM-IMD 
and/or its associate institutions and/or its principals (SDME Trust/Society).  
If you are not the intended recipient, please: delete the message as well as 
the attachments immediately; do not disseminate, distribute, copy or use the 
contents for any purpose; and notify the sender immediately.

The recipient acknowledges that no guarantee or any warranty is given as to 
completeness and accuracy of the content of the email. The recipient further 
acknowledges that the views contained in the email are those of the sender and 
may not necessarily reflect those of SDM-IMD or its principals.  SDM-IMD 
reserves the right to monitor the content of all messages sent to or from this 
email address. Messages sent to or from this email address may be stored on the 
SDM-IMD email system. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. SDM-IMD 
accepts no liability for any damage caused by any virus transmitted by this 
email.

#  End of Disclaimer # 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: Error message when I run mysqld command to start the server

2006-06-02 Thread Neeraj
You might have another mysql server running 
Stop you running server. 
Change the port and then try..


-Original Message-
From: Swaroop.S [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 02, 2006 3:38 PM
To: mysql@lists.mysql.com
Subject: Error message when I run mysqld command to start the server

Hello,

I have a problem in strating the server.

I get these errors, please help me in this regard

error
C:\Program Files\EasyPHP1-7\mysql\binmysqld
Can't start server: Bind on TCP/IP port: No error
060602 15:46:50  Do you already have another mysqld server running on
port: 3306
 ?
060602 15:46:50  Aborting

060602 15:46:50  C:\PROGRA~1\EASYPH~1\MYSQL\BIN\MYSQLD.EXE: Got signal 11.
Abort
ing!

060602 15:46:50  Aborting
-


Waiting for the reply at the earilest..


-- 
Regards
Swaroop.S
e-Library
SDM-IMD
swaroops1.googlepages.com


-- 

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

# CAUTION - Disclaimer #
The information contained in this email and any attachments thereto are
intended for the exclusive use of the addressee(s), and may contain
proprietary, confidential or privileged information, belonging to SDM-IMD
and/or its associate institutions and/or its principals (SDME
Trust/Society).  If you are not the intended recipient, please: delete the
message as well as the attachments immediately; do not disseminate,
distribute, copy or use the contents for any purpose; and notify the sender
immediately.

The recipient acknowledges that no guarantee or any warranty is given as to
completeness and accuracy of the content of the email. The recipient further
acknowledges that the views contained in the email are those of the sender
and may not necessarily reflect those of SDM-IMD or its principals.  SDM-IMD
reserves the right to monitor the content of all messages sent to or from
this email address. Messages sent to or from this email address may be
stored on the SDM-IMD email system. 

WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. SDM-IMD
accepts no liability for any damage caused by any virus transmitted by this
email.

#  End of Disclaimer # 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How to get machine independent unique id??

2006-06-02 Thread Neeraj
Many thanks 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 01, 2006 8:00 PM
To: mysql@lists.mysql.com
Subject: Re: How to get machine independent unique id??

Isn't UUID() unique for each system it runs on?? 

--
Chris

Quoting Dan Buettner [EMAIL PROTECTED]:

 Neeraj -
 
 One idea might be to use both a client ID field and a record ID field to 
 uniquely identify records.  This approach has benefits (easy to add 
 clients, doesn't require as much client setup or planning) and a 
 potentially big drawback (no one unique record identifier).
 
 Another would be to borrow a technique used in multi-master replication, 
 even if you're not using replication, to have your client databases 
 assign unique IDs.  Benefit is unique identifier, drawback is you need 
 to plan ahead a bit more and do some setup on each client.  See the 
 article at:

http://dev.mysql.com/tech-resources/articles/advanced-mysql-replication.html
 and pay particular attention to the use of auto_increment_increment and 
 auto_increment_offset variables.
 
 Hope this helps,
 Dan
 
 
 
 
 Neeraj wrote:
  Hi all..
  
   
  
   
  
   
  
  I have a scenario of many client databases and one central database..
  
   
  
   
  
   
  
  Is there any way to get a unique ids across all databases (by any way) ,
  because records from all the databases are finally get stored on a
central
  database. And the ids of transaction (a record)  must remain unique in
  central database. 
  
   
  
   
  
   
  
  These transaction ids are getting generated on client database..
  
   
  
   
  
   
  
  Thanks in advance..
  
   
  
   
  
   
  
  Cheers.:-)
  
   
  
   
  
   
  
  Neeraj Black Bits 
  
   
  
  
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
 
 




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Automatically add +1 every 30mins

2006-06-02 Thread Alex Major
Hi there. 
I've posted this up on both this list, and the php list as I'm not sure
whether this is something that I'd need to do with the php or mysql.

Basically, I am making an add-on to my small website which is a mini online
game. Every user will have gold, and every 30mins I'd like their amount of
gold to go up by 1 (or say a variable say $goldupdateamount).

I'd like to know which would be the best way of doing this, and if there is
a command in mysql which would achieve this.

Regards, 
Alex.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysql edition problem

2006-06-02 Thread yuan edit

my operating system is linux redhat 9.0.
i am installing mysql 5.0.x binary distribution.
Which edition is the most fit in the following editions?
And would you like to tell me the difference among these editions?
Thanks very much!

[image: [ ]] mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
27-May-2006 02:32   26M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5
27-May-2006 02:32   82   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz
27-May-2006 02:24   24M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5
27-May-2006 02:24   86   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz
27-May-2006 07:15   30M  GZIP compressed docume
[image: [TXT]] 
mysql-standard-5.0.22-linux-i686.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.asc
27-May-2006 08:52  189   GZIP compressed docume
[image: [ ]] 
mysql-standard-5.0.22-linux-i686.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.md5


Re: Automatically add +1 every 30mins

2006-06-02 Thread Miles Thompson

At 07:58 AM 6/2/2006, Alex Major wrote:


Hi there.
I've posted this up on both this list, and the php list as I'm not sure
whether this is something that I'd need to do with the php or mysql.

Basically, I am making an add-on to my small website which is a mini online
game. Every user will have gold, and every 30mins I'd like their amount of
gold to go up by 1 (or say a variable say $goldupdateamount).

I'd like to know which would be the best way of doing this, and if there is
a command in mysql which would achieve this.

Regards,
Alex.


I don't know about MySQL, but for PHP you would have to run it as a cron 
(or similar OS service) to trigger a script to do the update.
If you have access to the server, this could be any language which can work 
with MySQL: Perl, Java, VB, C  ? Or run JavaScript on the player's page?


 As for MySQL, I do not believe it has a built-in timer, except for 
synchronization or replication.


Miles Thompson 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.8.1/354 - Release Date: 6/1/2006



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



dbExpress: Application crashs after ApplyUpdates

2006-06-02 Thread Jeferson Oliveira
I'm trying to connect a Delphi application into a MySQL Server using 
dbExpress, but I'm having some problems.
I can insert and delete records without any problems, but when I try to 
update a record the following happens:

 - ClientDataSet.ApplyUpdates: the application crashs and the updates are 
not commited in the database;
- SQLQuery.Execute the changes are commited, but the application crashs 
anyway

The environment settings:
Delphi7
MySQL 4.1.12

Conection settings (SQLConnection):
DriverName = dbxmysql
LibraryName = dbxopenmysql50.dll
GetDriverFunc = getSQLDriverMYSQL50
VendorLib = libmysql.dll


Thanks in advance for any suggestion in this subject.
Jeferson Oliveira 




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: mysql edition problem

2006-06-02 Thread Keith Roberts
My first choice for easy installation:

Linux x86 generic RPM (statically linked against glibc 
2.2.5) downloads
Server  5.0.22-013.9M   Download | Pick a 
mirror
MD5: a61b9aec938ec729652872bc123b7508
Max 5.0.22-02.9MDownload | Pick a 
mirror
MD5: b67f9f948a9500cfdad5beb51c657cc9
Benchmark/test suites   5.0.22-06.0M
Download | Pick a mirror
MD5: 449d9bc4da4b345e0f346cd2edfd0dcf
Client programs 5.0.22-06.9MDownload | 
Pick a mirror
MD5: 611d2598227d230d21c710d6785c74e5
Libraries and header files  5.0.22-03.9M
Download | Pick a mirror
MD5: 56d6e0baee187efd0f8e4abc8ccb4a0e
Shared client libraries 5.0.22-02.1M
Download | Pick a mirror
MD5: 28e78f984fa32644dd174712efa3b829
Shared compatibility libraries
(3.23, 4.x, 5.x libs in same package)   5.0.22-0
3.4MDownload | Pick a mirror
MD5: cc5d382c61b704454d0762611a15c076

Second choice for more flexibility:

Linux (non RPM package) downloads (platform notes)
Linux (x86, glibc-2.2, standard is static, gcc)   
Standard5.0.22  30.2M   Download | Pick a mirror
MD5: 0eaa7a8ec18699ce550db1713a27cda3 | Signature

HTH

Keith Roberts

In theory, theory and practice are the same;
in practice they are not.


On Fri, 2 Jun 2006, yuan edit wrote:

 To: mysql@lists.mysql.com
 From: yuan edit [EMAIL PROTECTED]
 Subject: mysql edition problem
 
 my operating system is linux redhat 9.0.
 i am installing mysql 5.0.x binary distribution.
 Which edition is the most fit in the following editions?
 And would you like to tell me the difference among these editions?
 Thanks very much!
 
 [image: [ ]] mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
 http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
 27-May-2006 02:32   26M  GZIP compressed docume
 [image: [TXT]]
 mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.asc
 27-May-2006 08:52  189   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5
 27-May-2006 02:32   82   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz
 27-May-2006 02:24   24M  GZIP compressed docume
 [image: [TXT]]
 mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.asc
 27-May-2006 08:52  189   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5
 27-May-2006 02:24   86   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz
 27-May-2006 07:15   30M  GZIP compressed docume
 [image: [TXT]]
 mysql-standard-5.0.22-linux-i686.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.asc
 27-May-2006 08:52  189   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.md5
 
 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: can i speak chinese?

2006-06-02 Thread Peter M. Groen
I dunno, Can you? :)
-- 
Peter M. Groen
Open Systems Development
Klipperwerf 12
2317 DZ  Leiden
T  : +31-(0)71-5216317
M  : +31-(0)6-29563390
E  : [EMAIL PROTECTED]
Skype : peter_m_groen

quote who=yuan edit
 ÎҵIJÙ×÷ϵͳÊÇredhat 9.0µÄ¡£
 ÎÒÏë×°¶þ½øÖÆ°æ±¾µÄmysql 5.x
 µ«ÊÇÎÒ²»ÖªµÀÄĸö°æ±¾¸üÊʺÏÎÒ¡£¡£
 ÎÒ¿´ÁËһϣ¬mysql×îеİ汾£¬Óкü¸¸ö£¿
 ÎÒ°ÑËüÁÐÔÚÁËÏÂÃ棬ÓÐÄÄλÐֵܿÉÒÔ¸æËßÎÒÄĸö°æ±¾ÊʺÏÎÒÂð£¿
 »¹ÓУ¬ËûÃǶ¼ÓÐʲôÇø±ðÂð£¿
 лл´ó¼ÒÁË¡£¡£
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686-glibc23.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
 27-May-2006 02:32   26M  GZIP compressed docume
 [image: [TXT]]
 mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.asc
 27-May-2006 08:52  189   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-glibc23.tar.gz.md5
 27-May-2006 02:32   82   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz
 27-May-2006 02:24   24M  GZIP compressed docume
 [image: [TXT]]
 mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.asc
 27-May-2006 08:52  189   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz.md5
 27-May-2006 02:24   86   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686.tar.gzhttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz
 27-May-2006 07:15   30M  GZIP compressed docume
 [image: [TXT]]
 mysql-standard-5.0.22-linux-i686.tar.gz.aschttp://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.asc
 27-May-2006 08:52  189   GZIP compressed docume
 [image: [ ]]
 mysql-standard-5.0.22-linux-i686.tar.gz.md5http://mysql.oss.eznetsols.org/Downloads/MySQL-5.0/mysql-standard-5.0.22-linux-i686.tar.gz.md5
 27-May-2006 07:27   74   GZIP compressed docume


--
This message was scanned with clamAV version 0.88, clamav-milter version 0.87.
and is guaranteed free of viruses.

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Automatically add +1 every 30mins

2006-06-02 Thread Dan Buettner
Alex, as Miles noted, this could easily be accomplished with an external 
cron event.  Doesn't have to be written in an external language like PHP 
or perl, even - could be a self-contained crontab entry a la:


0,30 * * * * /path/to/mysql -u user -psecret database_name -e update 
table_name set gold = gold + 1  /dev/null



To accomplish this within MySQL, one option might be 5.1's events:

http://dev.mysql.com/doc/refman/5.1/en/events.html
http://dev.mysql.com/doc/refman/5.1/en/create-event.html


Hope this helps,
Dan



Alex Major wrote:
Hi there. 
I've posted this up on both this list, and the php list as I'm not sure

whether this is something that I'd need to do with the php or mysql.

Basically, I am making an add-on to my small website which is a mini online
game. Every user will have gold, and every 30mins I'd like their amount of
gold to go up by 1 (or say a variable say $goldupdateamount).

I'd like to know which would be the best way of doing this, and if there is
a command in mysql which would achieve this.

Regards, 
Alex.






--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Automatically add +1 every 30mins

2006-06-02 Thread Miles Thompson


Dan,

Did not know about events in MySQL. That's a terrific feature.

Miles

At 09:44 AM 6/2/2006, Dan Buettner wrote:

Alex, as Miles noted, this could easily be accomplished with an external 
cron event.  Doesn't have to be written in an external language like PHP 
or perl, even - could be a self-contained crontab entry a la:


0,30 * * * * /path/to/mysql -u user -psecret database_name -e update 
table_name set gold = gold + 1  /dev/null



To accomplish this within MySQL, one option might be 5.1's events:

http://dev.mysql.com/doc/refman/5.1/en/events.html
http://dev.mysql.com/doc/refman/5.1/en/create-event.html


Hope this helps,
Dan



Alex Major wrote:
Hi there. I've posted this up on both this list, and the php list as I'm 
not sure

whether this is something that I'd need to do with the php or mysql.
Basically, I am making an add-on to my small website which is a mini online
game. Every user will have gold, and every 30mins I'd like their amount of
gold to go up by 1 (or say a variable say $goldupdateamount).
I'd like to know which would be the best way of doing this, and if there is
a command in mysql which would achieve this.
Regards, Alex.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]





--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.8.1/354 - Release Date: 6/1/2006



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Help With Insert Statements

2006-06-02 Thread Scott Purcell
Hello,

 

I am working through ProSpring book, in which they are using Postgres. I
need to convert the following inserts into Mysql 5. The table 'Test' ,
'Customer' work fine, but 'CustomerAddresses' blows up on the delete
cascade portion.

 

As I was trying to figure out the error, another question was posed. The
'Constraint'. Doesn't that just tell the column that the values within
the table must be unique? Or does it create an index? I have always been
confused on that.

 

Thanks,

Scott

 

 

 

drop table Test;

drop table CustomerPermissions;

drop table CustomerAddresses;

drop table Permissions;

drop table Customers;

 

create table Test (

TestId serial not null,

Name varchar(50) not null, 

RunDate timestamp not null,

 

constraint PK_TestId primary key (TestId)

);

 

 

create table Customers (

CustomerId serial not null,

FirstName varchar(50) not null,

LastName varchar(50) not null,



constraint PK_CustomerId primary key (CustomerId)

);

 

 

create table CustomerAddresses (

CustomerAddressId serial not null,

Customer int not null,

Line1 varchar(50) not null,

Line2 varchar(50) not null,

City varchar(50) not null,

PostCode varchar(50) not null,



constraint PK_CustomerAddressId primary key
(CustomerAddressId),

constraint FK_Customer foreign key (Customer) references
Customers (CustomerId) on delete cascade on update cascade

);



help on SQL JOIN

2006-06-02 Thread Nhadie
Hi All,

I have this test table

+--+--+--+--++--+
| username | key1 | key2 | key3 | method | timer|
+--+--+--+--++--+
| nhadie   | aaa  | bbb  | ccc  | INVITE | 00:00:10 |
| nhadie   | aaa  | bbb  | ccc  | ACK| 00:00:14 |
| nhadie   | aaa  | bbb  | ccc  | INVITE | 00:00:16 |
| nhadie   | aaa  | bbb  | ccc  | ACK| 00:00:20 |
| nhadie   | aaa  | bbb  | ccc  | INVITE | 00:00:22 |
| nhadie   | aaa  | bbb  | ccc  | ACK| 00:00:26 |
| nhadie   | aaa  | bbb  | ccc  | BYE| 00:00:42 |
| nhadie   | ddd  | fff  | eee  | INVITE | 00:00:20 |
| nhadie   | ddd  | fff  | eee  | ACK| 00:00:24 |
| nhadie   | ddd  | fff  | eee  | INVITE | 00:00:26 |
| nhadie   | ddd  | fff  | eee  | ACK| 00:00:30 |
| nhadie   | ddd  | fff  | eee  | INVITE | 00:00:32 |
| nhadie   | ddd  | fff  | eee  | ACK| 00:00:36 |
| nhadie   | ddd  | fff  | eee  | BYE| 00:00:52 |
+--+--+--+--++--+

I tried this query:

select t1.username as username, t1.method as t1method, t2.method as
t2method, t1.timer as start,
t2.timer as stop, unix_timestamp(t2.timer)-unix_timestamp(t1.timer) as
timediff
from test t1,test t2 where (t1.method = 'INVITE' and t2.method = 'BYE') and
((t1.key1 = t2.key1)
and (t1.key2 = t2.key2) and (t1.key3 = t2.key3));

and this is the result:

+--+--+--+--+--+--+
| username | t1method | t2method | start| stop | timediff |
+--+--+--+--+--+--+
| nhadie   | INVITE   | BYE  | 00:00:10 | 00:00:42 | 00:00:32 |
| nhadie   | INVITE   | BYE  | 00:00:16 | 00:00:42 | 00:00:26 |
| nhadie   | INVITE   | BYE  | 00:00:22 | 00:00:42 | 00:00:20 |
| nhadie   | INVITE   | BYE  | 00:00:20 | 00:00:52 | 00:00:32 |
| nhadie   | INVITE   | BYE  | 00:00:26 | 00:00:52 | 00:00:26 |
| nhadie   | INVITE   | BYE  | 00:00:32 | 00:00:52 | 00:00:20 |
+--+--+--+--+--+--+

but what i want to actually achieve is to get only the time of the first
INVITE and then it's corresponding BYE
so it should look like this

+--+--+--+--+--+--+
| username | t1method | t2method | start| stop | timediff |
+--+--+--+--+--+--+
| nhadie   | INVITE   | BYE  | 00:00:10 | 00:00:42 | 00:00:32 |
| nhadie   | INVITE   | BYE  | 00:00:20 | 00:00:52 | 00:00:32 |
---

Is that possible? What else can I do to have this output?
Thank You in Advanced.

Regards,
Nhadie


Message sent using UebiMiau 2.7


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: please help me.

2006-06-02 Thread Daniel da Veiga

On 6/2/06, yuan edit [EMAIL PROTECTED] wrote:

 my operating system is linux redhat 9.0.
i am installing mysql 5.0.x binary distribution.
Which edition is the most fit in the following editions?


You notices most of those files are .asc and .md5 used to verify the
integrity of the archive after you download it, right? So, reduced to
3 versions to choose.


And would you like to tell me the difference among these editions?


You can search the MySQL site, and I would advice you to download it
from the site, not from this mirror that I never heard of. If you were
at the site, there are docs explaining the difference between each
version.

mysql-standard-5.0.22-linux-i686-glibc23.tar.gz
Compiled against glibc-2.3

mysql-standard-5.0.22-linux-i686-icc-glibc23.tar.gz
Compiled with ICC?! Dunno, never heard of it and its not at the
official MySQL site.

mysql-standard-5.0.22-linux-i686.tar.gz
Static linked, as far as I know.

I strongly advice you to:

1) Never copy and paste a whole web page in a mail.
2) Strip down what is unrelevant of text
3) Clean html tags
4) Learn about md5 and asc.
5) Be thankful that someone read all this blob and answered
6) Download MySQL from www.mysql.com

--
Daniel da Veiga
Computer Operator - RS - Brazil
-BEGIN GEEK CODE BLOCK-
Version: 3.1
GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V-
PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++
--END GEEK CODE BLOCK--

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: help on SQL JOIN

2006-06-02 Thread Peter Brawley

Nhadie,


...what i want to actually achieve is to get only the time of the first
INVITE and then it's corresponding BYE
so it should look like this



+--+--+--+--+--+--+
| username | t1method | t2method | start| stop | timediff |
+--+--+--+--+--+--+
| nhadie   | INVITE   | BYE  | 00:00:10 | 00:00:42 | 00:00:32 |
| nhadie   | INVITE   | BYE  | 00:00:20 | 00:00:52 | 00:00:32 |
---


It can be done with subqueries, or with a left join on a timer 
comparison, which will likely be quicker:


SELECT
 t1.username as username,
 t1.method as t1meth, t2.method as t2meth, t3.method as t3meth,
 t1.timer as start, t2.timer as stop,
 TIMEDIFF(t2.timer,t1.timer) as timediff
FROM test AS t1
INNER JOIN test AS t2
 ON t1.key1 = t2.key1 AND t1.key2 = t2.key2 AND t1.key3 = t2.key3
LEFT JOIN test AS t3
 ON t1.key1 = t3.key1 AND t1.key2 = t3.key2 AND t1.key3 = t3.key3 AND 
t3.method='INVITE'

 AND t1.timer  t3.timer
WHERE t1.method='INVITE'
 AND t2.method='BYE'
 AND t3.key1 IS NULL;
+--++++--+--+--+
| username | t1meth | t2meth | t3meth | start| stop | timediff |
+--++++--+--+--+
| nhadie   | INVITE | BYE| NULL   | 00:00:10 | 00:00:42 | 00:00:32 |
| nhadie   | INVITE | BYE| NULL   | 00:00:20 | 00:00:52 | 00:00:32 |
+--++++--+--+--+

There's a brief discussion of this query pattern at 
http://www.artfulsoftware.com/queries.php#5.


PB

-

Nhadie wrote:

Hi All,

I have this test table

+--+--+--+--++--+
| username | key1 | key2 | key3 | method | timer|
+--+--+--+--++--+
| nhadie   | aaa  | bbb  | ccc  | INVITE | 00:00:10 |
| nhadie   | aaa  | bbb  | ccc  | ACK| 00:00:14 |
| nhadie   | aaa  | bbb  | ccc  | INVITE | 00:00:16 |
| nhadie   | aaa  | bbb  | ccc  | ACK| 00:00:20 |
| nhadie   | aaa  | bbb  | ccc  | INVITE | 00:00:22 |
| nhadie   | aaa  | bbb  | ccc  | ACK| 00:00:26 |
| nhadie   | aaa  | bbb  | ccc  | BYE| 00:00:42 |
| nhadie   | ddd  | fff  | eee  | INVITE | 00:00:20 |
| nhadie   | ddd  | fff  | eee  | ACK| 00:00:24 |
| nhadie   | ddd  | fff  | eee  | INVITE | 00:00:26 |
| nhadie   | ddd  | fff  | eee  | ACK| 00:00:30 |
| nhadie   | ddd  | fff  | eee  | INVITE | 00:00:32 |
| nhadie   | ddd  | fff  | eee  | ACK| 00:00:36 |
| nhadie   | ddd  | fff  | eee  | BYE| 00:00:52 |
+--+--+--+--++--+

I tried this query:

select t1.username as username, t1.method as t1method, t2.method as
t2method, t1.timer as start,
t2.timer as stop, unix_timestamp(t2.timer)-unix_timestamp(t1.timer) as
timediff
from test t1,test t2 where (t1.method = 'INVITE' and t2.method = 'BYE') and
((t1.key1 = t2.key1)
and (t1.key2 = t2.key2) and (t1.key3 = t2.key3));

and this is the result:

+--+--+--+--+--+--+
| username | t1method | t2method | start| stop | timediff |
+--+--+--+--+--+--+
| nhadie   | INVITE   | BYE  | 00:00:10 | 00:00:42 | 00:00:32 |
| nhadie   | INVITE   | BYE  | 00:00:16 | 00:00:42 | 00:00:26 |
| nhadie   | INVITE   | BYE  | 00:00:22 | 00:00:42 | 00:00:20 |
| nhadie   | INVITE   | BYE  | 00:00:20 | 00:00:52 | 00:00:32 |
| nhadie   | INVITE   | BYE  | 00:00:26 | 00:00:52 | 00:00:26 |
| nhadie   | INVITE   | BYE  | 00:00:32 | 00:00:52 | 00:00:20 |
+--+--+--+--+--+--+

but what i want to actually achieve is to get only the time of the first
INVITE and then it's corresponding BYE
so it should look like this

+--+--+--+--+--+--+
| username | t1method | t2method | start| stop | timediff |
+--+--+--+--+--+--+
| nhadie   | INVITE   | BYE  | 00:00:10 | 00:00:42 | 00:00:32 |
| nhadie   | INVITE   | BYE  | 00:00:20 | 00:00:52 | 00:00:32 |
---

Is that possible? What else can I do to have this output?
Thank You in Advanced.

Regards,
Nhadie


Message sent using UebiMiau 2.7


  



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.0/353 - Release Date: 5/31/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Automatically add +1 every 30mins

2006-06-02 Thread Douglas Sims


You probably don't want to do it with events or as a cron job.   As  
it sounds from your description the amount of gold is a function of  
time, perhaps time since they started playing or joined the game.  
Thus, instead of updating every 30 minutes, when you are selecting  
the current amount of gold, just select it as a function of the time  
since they were online or signed up for the game.


You can use a time difference function, either TIMEDIFF or subtract  
the UNIX_TIMESTAMP value of the start date/time from the  
UNIX_TIMESTAMP() function of the curent date/time, and then just  
divide appropriately.


More info about MySQL date/time functions: http://dev.mysql.com/doc/ 
refman/5.0/en/date-and-time-functions.html


Example: To get the number of 30-minute increments since some date,

mysql SELECT ROUND((UNIX_TIMESTAMP()-UNIX_TIMESTAMP('2006-05-30  
3:45'))/(60*30));

+-+
| ROUND((UNIX_TIMESTAMP()-UNIX_TIMESTAMP('2006-05-30 3:45'))/(60*30)) |
+-+
| 162 |
+-+
1 row in set (0.00 sec)

Here is a reference to the MySQL documentation on date and time  
functions, which is really good: http://dev.mysql.com/doc/refman/5.0/ 
en/date-and-time-functions.html


Good luck!


Douglas Sims
[EMAIL PROTECTED]



On Jun 2, 2006, at 7:56 AM, Miles Thompson wrote:



Dan,

Did not know about events in MySQL. That's a terrific feature.

Miles

At 09:44 AM 6/2/2006, Dan Buettner wrote:

Alex, as Miles noted, this could easily be accomplished with an  
external cron event.  Doesn't have to be written in an external  
language like PHP or perl, even - could be a self-contained  
crontab entry a la:


0,30 * * * * /path/to/mysql -u user -psecret database_name -e  
update table_name set gold = gold + 1  /dev/null



To accomplish this within MySQL, one option might be 5.1's events:

http://dev.mysql.com/doc/refman/5.1/en/events.html
http://dev.mysql.com/doc/refman/5.1/en/create-event.html


Hope this helps,
Dan



Alex Major wrote:
Hi there. I've posted this up on both this list, and the php list  
as I'm not sure

whether this is something that I'd need to do with the php or mysql.
Basically, I am making an add-on to my small website which is a  
mini online
game. Every user will have gold, and every 30mins I'd like their  
amount of

gold to go up by 1 (or say a variable say $goldupdateamount).
I'd like to know which would be the best way of doing this, and  
if there is

a command in mysql which would achieve this.
Regards, Alex.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql? 
[EMAIL PROTECTED]






--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.8.1/354 - Release Date:  
6/1/2006




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



increasing the search speed

2006-06-02 Thread Octavian Rasnita
Hi,

I have the following table:

CREATE TABLE `z` (
  `hash` varchar(16) NOT NULL default '',
  `title` varchar(255) NOT NULL default '',
  `body` text NOT NULL,
  FULLTEXT KEY `title` (`title`,`body`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1

I have tried the following query:

select sql_calc_found_rows hash, title, substr(body, 1, 250) as preview,
match(title, body) against('deputat') as rank from z where match(title,
body) against('deputat' in boolean mode) order by rank desc limit 0,20;

The table is made just for testing, with as few fields as possible (only 3).

The table has almost 200.000 records.

I am using MySQL 5.0.16-standard.

I want to search the records that contain a certain word (or more
complicated expressions), so I need using a boolean mode search.

However, I want to return only the first 20 records ordered by rank, so I
also need to use a common search (not in boolean mode) for getting that
rank.

I have set MySQL to also index the 3 chars words, and not only the words
with 4 or more chars because I need to be able to search for those words.

The problem is that this query takes more than 12 seconds, and this is very
much for a table with only less than 200.000 records.

Can I do something to increase the search speed?

I think that maybe if I will change some MySQL settings, the search might
work faster.
I also have a list with stop words and the program I use doesn't search for
those words anyway. Can I tell MySQL to not index the words from that list,
and if yes, please tell me how. I have read some things in the docs and I
have tried them under Windows, but without any effect.
Can I configure MySQL to use that list of stop words without re-compiling
it?

I would also like to define some chars as word-chars, for example:
ăâşţî-ĂÂŞŢÎ
Can this be done without re-compiling MySQL? (But this is not so important.
The most important is the search speed increase.)

Thank you very much.

Teddy


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Uninstall old version

2006-06-02 Thread nngau
 
I was able to install the mysql 5.0 on my machine. But it
Looks like there is a older version of mysql that was installed.

When I run this command:

mysql --version
mysql  Ver 14.7 Distrib 4.1.13a, for apple-darwin8.0

Now I need to remove this version because when I 
Type the command mysql to run, I get the following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/mysql/mysql.sock' (2)

So now I type this command:
/usr/local/mysql/bin/mysql

And I'm able to connect to version 5.0.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5 to server version:
5.0.22-max

Now I would like to remove this older version. Does anyone know how to do
that
Without affecting verion 5.0? I am on a Mac OS 10.4.5 PowerPC.


Thanks,

Ngim


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Uninstall old version

2006-06-02 Thread Dan Buettner

Hello -

Yes, looks you've got two versions installed.  One is in your PATH 
(where UNIX looks for items by default), and one is not.


To remove your old version, execute 'whereis mysql' from your command 
prompt and you will get the full path to the mysql version it knows 
about and is running when you invoke 'mysql'.


Assuming you've got everything out of there you need, remove the 
directory path you got from above. ** THIS WILL MAKE IT ALL GO AWAY; 
TAKE CARE.  NOTE YOUR DATABASES MIGHT STILL BE IN THERE!



Then, you can add the latest version of mysql to your PATH so you don't 
have to type the full path every time.  If you're using the bash shell 
(default in 10.4), edit a file called .profile (no quotes) in your 
home directory.  Create it if it does not exist.  Put this line in it:

export PATH=${PATH}:/usr/local/mysql/bin
then open a new Terminal window and mysql should run OK.

Hope this helps.

Dan



nngau wrote:
 
I was able to install the mysql 5.0 on my machine. But it

Looks like there is a older version of mysql that was installed.

When I run this command:

mysql --version
mysql  Ver 14.7 Distrib 4.1.13a, for apple-darwin8.0

Now I need to remove this version because when I 
Type the command mysql to run, I get the following error:


ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/mysql/mysql.sock' (2)

So now I type this command:
/usr/local/mysql/bin/mysql

And I'm able to connect to version 5.0.

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5 to server version:
5.0.22-max

Now I would like to remove this older version. Does anyone know how to do
that
Without affecting verion 5.0? I am on a Mac OS 10.4.5 PowerPC.


Thanks,

Ngim




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: help with storing a large binary number as bigint

2006-06-02 Thread Jeremy Cole

Hi Byron,


 This should be a relatively simple question but after looking through
the manual for a while I didn't see how to do it. I am working in php
and need to store a large binary number in the database. When I try and
convert it to a int in php its too big so it converts it to a float and
I loose all all precision witch makes it worthless to me. Is there a way
to let mysql do the conversion since the number I am working with is
48bits and bigint can store 63bits??? I would need to be able to insert
and select it as a binary string?


Yes, you can do this.  Probably the best way to do this is to insert it 
as a hexadecimal number.


Is the binary string in big or little endian form?

If it's big endian, you can convert it directly to hex with bin2hex(), 
prefix it with 0x, and insert it as:


INSERT INTO mytable (x, y, ...) VALUES (0x123456, 0x654321);

If it's in little-endian format, you will need to do the byte-swapping 
before/after the bin2hex.  (In pure PHP, it might be easier after.)


Regards,

Jeremy

--
Jeremy Cole
MySQL Geek, Yahoo! Inc.
Desk: 408 349 5104

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]