Re: What is the best known practice for insertion...?

2003-01-20 Thread Tonu Samuel
On Mon, 2003-01-20 at 09:15, Zysman, Roiy wrote:
 Hi All,
 I'm trying to insert multiple lines to a table with 3 col. All 3 of them
 are a part of the primary key.
 But while inserting the data , sometime occurs the situation where I
 want to insert an already exist entry with the same keys. And mysql
 barfs out that this key already exist in the table.
 The solution to it would be probably to query for each entry that I'm
 about to insert if that entry exists , but it looks like it would be an
 enormous overhead. I'm asking this question on a _performance_ context .
 What is the best way , ignore the error messages mysql barfs out or
 query each entry for existences before inserting it ?

If SQL is well optimized, then parsing of SQL commands is most time
consuming task and can't be well optimized. To avoid this you must
reduce number of SQL commands to SQL server.

This is why I suggest trying INSERT and check for result. Double queries
mean half speed. 

Another way is of course using replicated copy where to run queries and
INSERT data on master. 

  Tõnu


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Table Update Help / Problem

2003-01-20 Thread Michael Watson
This may be very simple, but the solution eludes me..

I have two tables  Products and NewProducts,  The Products table contains a
list of all the current product line and prices Products.ProdCode,
Products.Price (amongst other details not relevent here).  NewProducts
contains a list of changes to be made to the database, ie New Product lines,
changes of prices to existing lines.  (NewProducts.ProdCode,
NewProducts.Price).

How can I update existing records in Products if ProdCode are equal in both
tables, and if ProdCode exists in NewProducts but Not in Products, insert
that records?

We are using MySQL Version 3.23.54a



Thanks



Michael Watson
MBW Computing
[EMAIL PROTECTED]
Tel: 03 9782-0427 Fax: 03 9782-0657
Mob: 0425 788-185


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Substraction

2003-01-20 Thread Dobromir Velev
Hi,
I have the same problem the last week - I checked the manual and it seems
this is from the new way the unsigned columns are treated in MySQL 4.

Here is a quote from http://www.mysql.com/doc/en/Column_types.html

Warning: you should be aware that when you use subtraction between integer
values where one is of type UNSIGNED, the result will be unsigned!

A workaround for this problem which is described in the manual is either to
cast the column to a signed integer or to include a double value (0.0 or
something like this) in the operation.

Check http://www.mysql.com/doc/en/Cast_Functions.html for more information

HTH
Dobromir Velev
[EMAIL PROTECTED]


- Original Message -
From: Stefan Hinz, iConnect (Berlin) [EMAIL PROTECTED]
To: Brian Lindner [EMAIL PROTECTED]; Octavian Rasnita
[EMAIL PROTECTED]
Cc: MySQL [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 01:09
Subject: Re: Substraction


 Brian,

   create table test(id int unsigned);
   insert into test values(10);
   select 15 - id from test;
   The result is 18446744073709551611 instead of -5.

 Trying to confirm this with MySQL 4.0.7 on a Win2K box:

 mysql create table test(id int unsigned);
 Query OK, 0 rows affected (0.56 sec)

 mysql insert into test values(10);
 Query OK, 1 row affected (0.08 sec)

 mysql select 15 - id from test;
 +-+
 | 15 - id |
 +-+
 |   5 |
 +-+
 1 row in set (0.06 sec)

 Now, once again with phpMyAdmin 2.3.3pl1:

 SELECT 15 - id
 FROM test LIMIT 0, 30
 15 - id
 5

 But with the following statement (same with phpMyAdmin):

 mysql select 5 - id from test;
 +--+
 | 5 - id   |
 +--+
 | 18446744073709551611 |
 +--+
 1 row in set (0.00 sec)

 Check the 1 in your 15. Maybe there's something wrong.

 Regards,
 --
   Stefan Hinz [EMAIL PROTECTED]
   Geschäftsführer / CEO iConnect GmbH http://iConnect.de
   Heesestr. 6, 12169 Berlin (Germany)
   Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

 - Original Message -
 From: Brian Lindner [EMAIL PROTECTED]
 To: Octavian Rasnita [EMAIL PROTECTED]
 Cc: MySQL [EMAIL PROTECTED]
 Sent: Sunday, January 19, 2003 10:28 PM
 Subject: Re: Substraction


  Octavian,
 
  Sunday, January 19, 2003, 7:31:57 AM, you wrote:
   Hi all,
 
   I've tried the following query:
 
   create table test(id int unsigned);
   insert into test values(10);
   select 15 - id from test;
 
   The result is 18446744073709551611 instead of -5.
 
  I ran this.. and it worked for me
 
  MySql 4.0.7 on Linux... ran it through phpMyAdmin
 
   Am I doing something wrong?
 
   Thank you.
 
   Teddy,
   Teddy's Center: http://teddy.fcc.ro/
   Email: [EMAIL PROTECTED]
 
 
 
 
  -
   Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
 
   To request this thread, e-mail [EMAIL PROTECTED]
   To unsubscribe, e-mail
 [EMAIL PROTECTED]
   Trouble unsubscribing? Try:
 http://lists.mysql.com/php/unsubscribe.php
 
 
 
 
 
  --
   Brian
   Email: [EMAIL PROTECTED]
 
 
 
 
  -
  Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)
 
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail
 [EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Recreating indexes on large tables

2003-01-20 Thread Salvesen, Jens-Petter
Hello, everyone

I have the following situation:

After enjoying problems related to deleting a large portion of a table,
subsequent slow selects and such, I decided to do an alternate route when
removing data from a table:

The table had transactions for one year, and the table really only needs
transactions for 6 months. So, I did a mysqldump without table def that
extracted the data I really want. Then, I dumped the table, created a new
without indexes, and loaded the data. All fine. 64 so million records.
Having read a bit about mysql and used it for a few years, I understood that
first loading data, and then creating indexes is faster than vice versa. All
fine, still. Then, I started creating indexes. First, it seems that mysql
makes a complete copy of the table, and then in reindexes it, and then drops
the original table, replacing it with the newly indexed table. Is this
correct? If so - how do make sure mysql makes one copy, and then performs
all the reindexing on that table, rather than making a temp table for each
index? Obviously, 64 million rows will take days no matter, but how do I
really speed this up? My current hypothesis is that the temp table copy
operation is my bottleneck, and that I should only _need_ to perform this
operation once.

[mysqld]
port= 3306
socket  = /var/lib/mysql/mysql.sock
skip-locking
datadir = /data/mysql
set-variable= key_buffer=384M
set-variable= max_allowed_packet=1M
set-variable= table_cache=512
set-variable= sort_buffer=2M
set-variable= record_buffer=2M
set-variable= thread_cache=8
# Try number of CPU's*2 for thread_concurrency
set-variable= thread_concurrency=8
set-variable= myisam_sort_buffer_size=3000M
set-variable= myisam_max_sort_file_size=16000M
set-variable= myisam_max_extra_sort_file_size=2500M
log-bin
server-id   = 1

is the relevant portion of the my.cnf file.

The table is MyISAM, and the mysql version is 3.23.41-log from red hat 7.2
(yes, I know, 7.3 is better).

We are performing the reindexing as a series of create index calls.

Please do not hesitate if you have further comments.

Thanks in advance!

Mvh / Best Regards

Jens-Petter Salvesen
Lead Developer, Risk Management, Europay Norway

Phone : +47 2332 5119
Mobile : +47 9829 7319

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Potential Customer - Technical Questions

2003-01-20 Thread Sean Burlington
Hi,
  you might want to ask the sales people some of these questions, this 
is a users mailing list ...


Question 4:  What are the appropriate fees associated with purchasing mySQL as a programming
company who would use mySQL as its database in its applications.




Mysql is available under two licences - GPL and commercial.

there are many misunderstandings about the implications of the GPL - you 
*may* be able to use this license on a commercial product (as long as 
you are happy top hand the client your source code)


commercial licenses range from $400 - $50 depending on volume
and version.


http://www.mysql.com/products/pricing.html

--

Sean



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



RE: What is the best known practice for insertion...?

2003-01-20 Thread Zysman, Roiy
Would it (the replace command) save me performance time instead of just
using insert and ignoring the mysql error ?
It looks like that insertion flow using the replace command would cost
more..
Using insert -- insert , check for key existence  output an error
Using replace -- insert ,check for key existence, delete, insert
???
Roiy


-Original Message-
From: Daevid Vincent [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 20, 2003 9:54 AM
To: 'Zysman, Roiy'; [EMAIL PROTECTED]
Subject: RE: What is the best known practice for insertion...?


This may be useful to you: http://www.mysql.com/doc/en/REPLACE.html

 -Original Message-
 From: Zysman, Roiy [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, January 19, 2003 11:16 PM
 To: [EMAIL PROTECTED]
 Subject: What is the best known practice for insertion...?
 
 
 Hi All,
 I'm trying to insert multiple lines to a table with 3 col.
 All 3 of them
 are a part of the primary key.
 But while inserting the data , sometime occurs the situation where I
 want to insert an already exist entry with the same keys. And mysql
 barfs out that this key already exist in the table.
 The solution to it would be probably to query for each entry that I'm
 about to insert if that entry exists , but it looks like it 
 would be an
 enormous overhead. I'm asking this question on a 
 _performance_ context .
 What is the best way , ignore the error messages mysql barfs out or
 query each entry for existences before inserting it ?

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Admin login problem

2003-01-20 Thread filip . margan
When I type bin/mysqladmin -u root password mypass (or without password, 
because I didn't set it) then I get Access denied for user: 'root@localhost' 
(Using password: NO) I need help ?? 

Thank you.

---
http://www.email.si

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Urgent help needed ! --- mySQL on Mac OS X

2003-01-20 Thread Ram Kumar
greetings nug

we ar estuck in a project to connect to mySQL running on Mac OS X, through
TCP/IP, please suggest

regards, ram

--

 +--+
   Mac Solutions
   http://www.macsolutionsindia.com +91 98102 70848
ram @ macsolutionsindia.com
   MSN: [EMAIL PROTECTED]   support @ macsolutionsindia.com
 +--+
 Simplifying solutions for you...  Macintosh, Windows, Client/Server, Web



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: What is the best known practice for insertion...?

2003-01-20 Thread Sean Burlington
Daevid Vincent wrote:

This may be useful to you:
http://www.mysql.com/doc/en/REPLACE.html



replace works very nicley and is IMO a good extension to standard SQL

another way that may be suitable is to delete first and then insert 
(this may erase data if you are not inserting all columns)



-Original Message-
From: Zysman, Roiy [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, January 19, 2003 11:16 PM
To: [EMAIL PROTECTED]
Subject: What is the best known practice for insertion...?


Hi All,
I'm trying to insert multiple lines to a table with 3 col. 
All 3 of them
are a part of the primary key.
But while inserting the data , sometime occurs the situation where I
want to insert an already exist entry with the same keys. And mysql
barfs out that this key already exist in the table.
The solution to it would be probably to query for each entry that I'm
about to insert if that entry exists , but it looks like it 
would be an
enormous overhead. I'm asking this question on a 
_performance_ context .
What is the best way , ignore the error messages mysql barfs out or
query each entry for existences before inserting it ?



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php







-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




What is wrong in this time difference query?

2003-01-20 Thread Putte Koivisto
I use MYSQL TO_DAYS function to grab some statistics from database and I use
next
statement:

SELECT ID FROM database
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) =7
ORDER BY ID DESC

I have IIS server and I use Dreamweaver MX to build the statistics page,
where we use ASP. Problem is, that I get row from every month with date
difference of 7 instead of rows from last seven days. What went wrong? Do I
have to specify the date format someway to the TO_DAYS function?

Sincerely,

Putte Koivisto

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: What is the best known practice for insertion...?

2003-01-20 Thread Steve Edberg
This page (Section 5.2.9: Speed of INSERT Queries) might be of interest:

	http://www.mysql.com/doc/en/Insert_speed.html

You might also want to investigate the INSERT IGNORE command (IGNORE 
means ignore all inserts with duplicate unique keys), for example:

	INSERT IGNORE
	INTO your_table
	(col1,col2,col3)
	VALUES
	(vala1,vala2,vala3),
	(valb1,valb2,valb3),
	(valc1,valc2,valc3)

See
	http://www.mysql.com/doc/en/INSERT.html

for more info.

	-steve


At 9:15 AM +0200 1/20/03, Zysman, Roiy wrote:
Hi All,
I'm trying to insert multiple lines to a table with 3 col. All 3 of them
are a part of the primary key.
But while inserting the data , sometime occurs the situation where I
want to insert an already exist entry with the same keys. And mysql
barfs out that this key already exist in the table.
The solution to it would be probably to query for each entry that I'm
about to insert if that entry exists , but it looks like it would be an
enormous overhead. I'm asking this question on a _performance_ context .
What is the best way , ignore the error messages mysql barfs out or
query each entry for existences before inserting it ?

Roiy

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail 
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


--
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| SETI@Home: 1001 Work units on 23 oct 2002  |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
++

-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Text field question

2003-01-20 Thread Stefan Hinz, iConnect \(Berlin\)
Robyn,

 Could anyone please tell me how I write an SQL statement to seperate
 text from one field into multiple fields based on a aprticular
character
 (i.e. tab/comma/space). For example, I have a text field containing:
 Text=Robyn Bailey Brisbane

I understand you have all of this in just ONE text field (that's not a
good idea, though).

You could use the MySQL string functions to separate substrings, but
that's not a good idea, either, because SQL is not designed for tasks
like this.

You should rather use your favourite programming language (mine is PHP
:) and do something like this (the example is with PHP, but it will work
the same way in PERL etc.):

$sql = SELECT mytext FROM myentries;
$res = mysql_query($sql);
$i   = 0;
while($row = mysql_fetch_array($res)) {
 $arr[$i] = explode('=', $row[0]);
 $i++;
}

When the while loop ends, you have the split values in $arr, and you can
cycle through $arr to create your report.

Note that this is untested code, just to give you an idea what to do.

BTW: After splitting up mytext into pieces ($arr) you should consider
inserting the split values into a new table with a better table design.

Regards,
--
  Stefan Hinz [EMAIL PROTECTED]
  Geschäftsführer / CEO iConnect GmbH http://iConnect.de
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

- Original Message -
From: Robyn Bailey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 2:08 AM
Subject: FW: Text field question


 Could anyone please tell me how I write an SQL statement to seperate
 text from one field into multiple fields based on a aprticular
character
 (i.e. tab/comma/space). For example, I have a text field containing:
 Text=Robyn Bailey Brisbane

 I want to seperate this (per query) into 3 fields so that I can sort
and
 count the fields: Name=Robyn Surname=Bailey Location=Brisbane

 I dont want it permanently just per query (for a report).

 Thanks in advance
 Robyn Bailey, CISSP



 This email and any attachments are subject to copyright. They may also
 contain confidential information. This email and any attachments may
not
 be distributed, reproduced, copied, stored or transmitted in any form
or
 by any means, without the prior written consent of Bridge Point
 Communications Pty Ltd ABN 29 083 424 668. Any personal information in
 this email must be handled in accordance with the Privacy Act 1988
 (Cth). Emails may be interfered with, may contain computer viruses or
 other defects and may not be successfully replicated on other systems.
 Bridge Point Communications Pty Ltd gives no warranties in relation to
 these matters. If you have any doubts about the authenticity of an
email
 purportedly sent by us, please contact Bridge Point Communications Pty
 Ltd immediately.


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Indexing

2003-01-20 Thread Jon Miller
I'm new to MySQL and loving it. So pardon my lack of the simple things. I need to 
index a table where the field is indexed, so when I look at the in the PHP script it 
is in order.
 Also when I run a query how can I save the results as a new table?

Thanks

Jon L. Miller, MCNE, CNS
Director/Sr Systems Consultant
MMT Networks Pty Ltd
http://www.mmtnetworks.com.au

I don't know the key to success, but the key to failure
 is trying to please everybody. -Bill Cosby





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: RedHat 8, mysql-server-3.23.54a-4 and relocating the data directory

2003-01-20 Thread Dobromir Velev
Hi,
It looks you haven't updated the mysql client configuration. Adding this
lines to your my.cnf file should solve the problem.

[client]
port=3306
socket=/raidarrary2/data/mysql/mysql.sock


HTH
Dobromir Velev
[EMAIL PROTECTED]


- Original Message -
From: Michael Pelley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 18, 2003 16:26
Subject: RedHat 8, mysql-server-3.23.54a-4 and relocating the data directory


Hi All!  I'm new to the list, but I've been using MySQL under Red Hat for a
couple of years now.

I'm in the process of setting up a new Red Hat 8 box and I want to change
the data directory to a different location (/raidarray2/data/mysql).  I've
edited the /etc/my.cnf as:
[mysqld]
datadir=/raidarray2/data/mysql
socket=/raidarrary2/data/mysql/mysql.sock
[mysql.server]
user=mysql
basedir=/raidarry2/data

I've also checked RedHat's /etc/rc.d/init.d/mysqld file and changed the line
datadir=/raidarry2/data/mysql
and restarted the server.

Still, I keep getting the error
Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)

On the command line, I get the same error with
bash_$ mysql -u root -p mysql
unless I modify it as
bash_$ mysql -u root -p -S /raidarry2/data/mysql/mysql.sock mysql

How can I fix this?  Is there some other my.cnf file that is being used in
RedHat 8?  Note that I'm running the version that came with RedHat 8 and has
been patched with the up2date command.

Thanks!

Cheers,
Mike

--
Mike Pelley Non illegitimati carborundum
Owner  Misc. Rambler of Pelleys.com
[EMAIL PROTECTED] - www.pelleys.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re:Admin login problem

2003-01-20 Thread Nasser Ossareh
Shutdown you mysqld sever and restart it with

 mysqld -u root -Sg 

then grant all privileges to root, make sure that your root password is okay. Make 
sure that there is an entry in mysql.user table for root@localhost.  Then, restart 
your server and see how it goes...

Nasser.

-- [EMAIL PROTECTED] writes:

Return-Path: [EMAIL PROTECTED]
Received: from mx10.lax.untd.com (mx10.lax.untd.com [10.130.24.70])
by maildeliver03.nyc.untd.com with SMTP id AAA9CZUA4ACZSBUA
for [EMAIL PROTECTED] (sender 
[EMAIL PROTECTED]);
Mon, 20 Jan 2003 04:57:46 -0500 (EST)
Received: from web.mysql.com (web.mysql.com [213.136.49.183])
by mx10.lax.untd.com with SMTP id AAA9CZUA3AGYWQBJ
for [EMAIL PROTECTED] (sender 
[EMAIL PROTECTED]);
Mon, 20 Jan 2003 01:57:45 -0800 (PST)
Received: (qmail 30161 invoked by uid 7797); 20 Jan 2003 09:38:01 -
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm (http://www.ezmlm.org)
List-ID: mysql.mysql.com
Precedence: bulk
List-Help: mailto:[EMAIL PROTECTED]
List-Unsubscribe: mailto:[EMAIL PROTECTED]
List-Post: mailto:[EMAIL PROTECTED]
List-Subscribe: mailto:[EMAIL PROTECTED]
Delivered-To: mailing list [EMAIL PROTECTED]
Received: (qmail 29996 invoked from network); 20 Jan 2003 09:37:51 -
To: [EMAIL PROTECTED]
Subject: Admin login problem
Message-ID: [EMAIL PROTECTED]
Date: Mon, 20 Jan 2003 10:37:51 +0100 (CET)
From: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 8bit
User-Agent: IMP/PHP IMAP webmail program 2.2.3
X-Originating-IP: 193.2.236.15

When I type bin/mysqladmin -u root password mypass (or without password, 
because I didn't set it) then I get Access denied for user: 'root@localhost' 
(Using password: NO) I need help ?? 

Thank you.

---
http://www.email.si

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php






-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Recreating indexes on large tables

2003-01-20 Thread Joseph Bueno
Hi,


Instead of using separate CREATE INDEX statements, you can build all
your index at once with ALTER TABLE:
ALTER TABLE my_table
  ADD INDEX ...,
  ADD INDEX ... ,
  ADD INDEX ... ;

Hope this helps,
-- 
Joseph Bueno

Salvesen, Jens-Petter wrote:
 Hello, everyone
 
 I have the following situation:
 
 After enjoying problems related to deleting a large portion of a table,
 subsequent slow selects and such, I decided to do an alternate route when
 removing data from a table:
 
 The table had transactions for one year, and the table really only needs
 transactions for 6 months. So, I did a mysqldump without table def that
 extracted the data I really want. Then, I dumped the table, created a new
 without indexes, and loaded the data. All fine. 64 so million records.
 Having read a bit about mysql and used it for a few years, I understood that
 first loading data, and then creating indexes is faster than vice versa. All
 fine, still. Then, I started creating indexes. First, it seems that mysql
 makes a complete copy of the table, and then in reindexes it, and then drops
 the original table, replacing it with the newly indexed table. Is this
 correct? If so - how do make sure mysql makes one copy, and then performs
 all the reindexing on that table, rather than making a temp table for each
 index? Obviously, 64 million rows will take days no matter, but how do I
 really speed this up? My current hypothesis is that the temp table copy
 operation is my bottleneck, and that I should only _need_ to perform this
 operation once.
 
 [mysqld]
 port  = 3306
 socket= /var/lib/mysql/mysql.sock
 skip-locking
 datadir = /data/mysql
 set-variable  = key_buffer=384M
 set-variable  = max_allowed_packet=1M
 set-variable  = table_cache=512
 set-variable  = sort_buffer=2M
 set-variable  = record_buffer=2M
 set-variable  = thread_cache=8
 # Try number of CPU's*2 for thread_concurrency
 set-variable  = thread_concurrency=8
 set-variable  = myisam_sort_buffer_size=3000M
 set-variable= myisam_max_sort_file_size=16000M
 set-variable= myisam_max_extra_sort_file_size=2500M
 log-bin
 server-id = 1
 
 is the relevant portion of the my.cnf file.
 
 The table is MyISAM, and the mysql version is 3.23.41-log from red hat 7.2
 (yes, I know, 7.3 is better).
 
 We are performing the reindexing as a series of create index calls.
 
 Please do not hesitate if you have further comments.
 
 Thanks in advance!
 
 Mvh / Best Regards
 
 Jens-Petter Salvesen
 Lead Developer, Risk Management, Europay Norway
 
 Phone : +47 2332 5119
 Mobile : +47 9829 7319
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Indexing

2003-01-20 Thread Alec . Cawley

You asked:

I'm new to MySQL and loving it. So pardon my lack of the simple things. I
need to index a table where the field is indexed, so when I look at the in
the PHP script it is in order.
 Also when I run a query how can I save the results as a new table?

I reply.

1. You need an ORDER BY clause at the end if the SELECT statement.

2. You need the CREATE TABLE  SELECT statement.

Both are easy to find in the online MySQL manual.


  Alec





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




MySQL+NNS doesn't seem to let MySQL start

2003-01-20 Thread Adriaan . Putter
hi,

i have this problem that mysql doesn't want to start.

I am using:
Mandrake Linux 9.0
MySQL 3.23.52


when i start mysql with
[adriaan@megatron adriaan]# service mysql start

then mysqld dies and give me this error log:

--- start of megatron.darkrealm.net.err ---
We will try our best to scrape up some info that will hopefully help
diagnose
the problem, but since we have already crashed, something is definitely
wrong
and this may fail

key_buffer_size=8388600
record_buffer=131072
sort_buffer=2097144
max_used_connections=0
max_connections=100
threads_connected=0
It is possible that mysqld could use up to 
key_buffer_size + (record_buffer + sort_buffer)*max_connections = 225791 K
bytes of memory
Hope that's ok, if not, decrease some variables in the equation

Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Bogus stack limit or frame pointer, fp=0xbfffe128, stack_bottom=0x61642031,
thread_stack=65536, aborting backtrace.
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd-query at 0x35323170  is invalid pointer
thd-thread_id=107

Successfully dumped variables, if you ran with --log, take a look at the
details of what thread 107 did to cause the crash.  In some cases of really
bad corruption, the values shown above may be invalid

The manual page at http://www.mysql.com/doc/C/r/Crashing.html contains
information that should help you find out what is causing the crash
030120 07:33:07  mysqld ended
--- end of megatron.darkrealm.net.err ---

This was not giving much information, and I searched for anything related to
this
but could find anyting.

I also tried one computer that was connected on this network, and got the
same error
and thought that something was wrong with the distro's RPMS, so I don't
loaded 
the updated one for Mandrake 9.0, but with exactly the same results.

I also tried to run MySQL on my laptop which also runs Mandrake 9.0, and it
worked.
I have checked permissions, and run MySQL with --user=root on the server and
it worked, so it must
be permissions, but the laptops permissions is exactly the same as the
permissions on
the server.

The only diffrence between machines is that the laptop is not setup to be
authenticated
by the LDAP server which is also the server that I want to start MySQL on.

I setup my LDAP server according the document on the Mandrake secure site. 

Here is my /etc/nsswitch.conf file:

--- start of nsswitch.conf ---
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
#   nisplus or nis+ Use NIS+ (NIS version 3)
#   nis or yp   Use NIS (NIS version 2), also called YP
#   dns Use DNS (Domain Name Service)
#   files   Use the local files
#   db  Use the local database (.db) files
#   compat  Use NIS on compat mode
#   hesiod  Use Hesiod for user lookups
#   [NOTFOUND=return]   Stop searching if not found so far
#

# To use db, put the db in front of files for entries you want to be
# looked up first in the databases
#
# Example:
#passwd:db files nisplus nis
#shadow:db files nisplus nis
#group: db files nisplus nis

passwd: files ldap
shadow: files ldap
group:  files ldap

#hosts: db files nisplus nis dns
hosts:  files dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files 

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks:   files
networks:   files
protocols:  files
rpc:files
services:   files

netgroup:   nisplus

publickey:  nisplus

automount:  files nisplus
aliases:files nisplus
--- end of nsswitch.conf ---

For the LDAP authentication I only changed these:
passwd: files ldap
shadow: files ldap
group:  files ldap

I did an experement and took out the ldap setting from the above so it only
showed:
passwd: files
shadow: files
group:  files

And guest what, MySQL started and was excepting connections.

Now I am stuck and don't where to look further.

I have no mysql user in LDAP directory, but the user exists in /etc/passwd
and /etc/shadow.

Any suggestions as I am at a blank ?!?!?


Thanks,

Adriaan.









Re: Indexing

2003-01-20 Thread Steve Edberg
At 6:12 PM +0800 1/20/03, Jon  Miller wrote:

I'm new to MySQL and loving it. So pardon my lack of the simple 
things. I need to index a table where the field is indexed, so when 
I look at the in the PHP script it is in order.


Use 'order by' in your select statement:

	http://www.mysql.com/doc/en/SELECT.html



 Also when I run a query how can I save the results as a new table?



Use the 'create table...select' statement:

	http://www.mysql.com/doc/en/CREATE_TABLE.html

alternatively, if you want to save the results in an existing table, 
use the 'insert into...select' statement:

	http://www.mysql.com/doc/en/INSERT_SELECT.html


-steve


Thanks

Jon L. Miller, MCNE, CNS
Director/Sr Systems Consultant
MMT Networks Pty Ltd
http://www.mmtnetworks.com.au

I don't know the key to success, but the key to failure
 is trying to please everybody. -Bill Cosby





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail 
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


--
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| SETI@Home: 1001 Work units on 23 oct 2002  |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
++

-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




query problem

2003-01-20 Thread Jon Miller
I ran a query as follows:
Insert Into db_test.tbl_dbaddr (Client, Contact, Addr, OfcPhone) SELECT Client AS 
Client, Business AS Contact, Addr AS Addr, OfcPhone AS OfcPhone From 
AddressBook.tbl_addr;

I got the following Records: 8989 Duplicates: 16 Warnings:394

Where can I look to see the Warnings? 
Also the information in the Contact and Addr field is wrong.  How do I delete the 
entire table.  I believe I cannot use Drop.  Using Select * delete from tbl_dbaddr 
yields a syntax error.

Thanks

Jon L. Miller, MCNE, CNS
Director/Sr Systems Consultant
MMT Networks Pty Ltd
http://www.mmtnetworks.com.au

I don't know the key to success, but the key to failure
 is trying to please everybody. -Bill Cosby





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




how to write a scheduled job for MySQL

2003-01-20 Thread Akash
Hi,
I want to periodically delete some records from a table. Is there any
mechanism by which I can schedule a job, which will execute a particular
query at periodic intervals ?
MySQL currently doesn't support stored procedures and triggers... but I
guess, there must be some way around. If anyone has ever faced this problem,
please let me know.
Thanks
Akash Agarwal
Senior Member Technical Staff,
Intersolutions Pvt Ltd,
NOIDA, INDIA
(www.lotusinterworks.com)
(www.alacre.com)



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: how to write a scheduled job for MySQL

2003-01-20 Thread Greg_Cope
 From: Akash [mailto:[EMAIL PROTECTED]]
 Sent: 20 January 2003 11:52
 To: [EMAIL PROTECTED]
 Subject: how to write a scheduled job for MySQL
 
 
 Hi,
 I want to periodically delete some records from a table. 
 Is there any
 mechanism by which I can schedule a job, which will execute a 
 particular
 query at periodic intervals ?
 MySQL currently doesn't support stored procedures and 
 triggers... but I
 guess, there must be some way around. If anyone has ever 
 faced this problem,

Use crond or at or your opperating systems alternative to run a mysqlclient
script or command to do the required acction.

Greg

 please let me know.
 Thanks
 Akash Agarwal
 Senior Member Technical Staff,
 Intersolutions Pvt Ltd,
 NOIDA, INDIA
 (www.lotusinterworks.com)
 (www.alacre.com)



This message and any attachment has been virus checked by
Pfizer Corporate Information Technology, Sandwich.



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: how to write a scheduled job for MySQL

2003-01-20 Thread Rafal Jank
On Mon, 20 Jan 2003 17:21:59 +0530
Akash [EMAIL PROTECTED] wrote:

 Hi,
 I want to periodically delete some records from a table. Is there any
 mechanism by which I can schedule a job, which will execute a particular
 query at periodic intervals ?
 MySQL currently doesn't support stored procedures and triggers... but I
 guess, there must be some way around. If anyone has ever faced this problem,
 please let me know.

Use cron or at.

-- 
_/_/  _/_/_/  - Rafa Jank [EMAIL PROTECTED] -
 _/  _/  _/  _/   _/ Wirtualna Polska SA   http://www.wp.pl 
  _/_/_/_/  _/_/_/ul. Traugutta 115c, 80-237 Gdansk, tel/fax. (58)5215625
   _/  _/  _/ ==*  http://szukaj.wp.pl *==--

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: how to write a scheduled job for MySQL

2003-01-20 Thread Rich Gray
Hi Akash

If using *nix investigate using the cron scheduler via crontab/at to execute
your SQL script at regular intervals. If you are running on NT/Win2K then
investigate using the task scheduler instead.

HTH
Rich
-Original Message-
From: Akash [mailto:[EMAIL PROTECTED]]
Sent: 20 January 2003 11:52
To: [EMAIL PROTECTED]
Subject: how to write a scheduled job for MySQL


Hi,
I want to periodically delete some records from a table. Is there any
mechanism by which I can schedule a job, which will execute a particular
query at periodic intervals ?
MySQL currently doesn't support stored procedures and triggers... but I
guess, there must be some way around. If anyone has ever faced this problem,
please let me know.
Thanks
Akash Agarwal
Senior Member Technical Staff,
Intersolutions Pvt Ltd,
NOIDA, INDIA
(www.lotusinterworks.com)
(www.alacre.com)




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




building 4.1 from source

2003-01-20 Thread Rafal Jank
Hi,

I've just downloaded version 4.1 from bk and have problem with building it. 
What version of automake is needed? Because after
 aclocal
I get:
aclocal: configure.in: 459: macro `AM_PROG_AS' not found in library


P.S. MySQL, query,database
-- 
_/_/  _/_/_/  - Rafa Jank [EMAIL PROTECTED] -
 _/  _/  _/  _/   _/ Wirtualna Polska SA   http://www.wp.pl 
  _/_/_/_/  _/_/_/ul. Traugutta 115c, 80-237 Gdansk, tel/fax. (58)5215625
   _/  _/  _/ ==*  http://szukaj.wp.pl *==--

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: how to write a scheduled job for MySQL

2003-01-20 Thread Adriaan . Putter
My geuss would be to write a sql script
and run it from cron

mysql  script.sql


 -Original Message-
 From: Akash [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 20, 2003 1:52 PM
 To: [EMAIL PROTECTED]
 Subject: how to write a scheduled job for MySQL
 
 
 Hi,
 I want to periodically delete some records from a table. 
 Is there any
 mechanism by which I can schedule a job, which will execute a 
 particular
 query at periodic intervals ?
 MySQL currently doesn't support stored procedures and 
 triggers... but I
 guess, there must be some way around. If anyone has ever 
 faced this problem,
 please let me know.
 Thanks
 Akash Agarwal
 Senior Member Technical Staff,
 Intersolutions Pvt Ltd,
 NOIDA, INDIA
 (www.lotusinterworks.com)
 (www.alacre.com)
 
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail 
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: query problem

2003-01-20 Thread Adriaan . Putter


 -Original Message-
 From: Jon Miller [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 20, 2003 1:49 PM
 To: [EMAIL PROTECTED]
 Subject: query problem
 
 
 I ran a query as follows:
 Insert Into db_test.tbl_dbaddr (Client, Contact, Addr, 
 OfcPhone) SELECT Client AS Client, Business AS Contact, Addr 
 AS Addr, OfcPhone AS OfcPhone From AddressBook.tbl_addr;
 
 I got the following Records: 8989 Duplicates: 16 Warnings:394
 
 Where can I look to see the Warnings? 
 Also the information in the Contact and Addr field is wrong.  
 How do I delete the entire table.  I believe I cannot use 
 Drop.  Using Select * delete from tbl_dbaddr yields a syntax error.
 

correct syntax for delete is:
delete from table 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Problem with LEFT JOIN

2003-01-20 Thread Bill Easton
Shalom, Lisi,

(Sure would have been nice if you had indented and simplified your
SQL statements so they could be read by a mere human instead of
just by a computer ;-})

You have
  SELECT ...
  FROM display
LEFT JOIN click
  ON display.name=click.name
  AND ...
  AND DAYOFMONTH(display.date) = '19';

The result of this select consists of the following:
  (1)  The result of the following inner join:
 SELECT ...
 FROM display. click
 WHERE display.name=click.name
   AND ...
   AND DAYOFMONTH(display.date) = '19';
  (2)  For each row of display that did not get used in (1),
   that row together with nulls for all columns of click.

In short, you get at least one row for each row of display--the ON
clause only affects which ones that have data from click.  That's
how LEFT JOIN works.  So, in particular, you get data for the
whole month.

You probably want something like:
  SELECT ...
  FROM display
LEFT JOIN click
  ON display.name=click.name
  WHERE ...
AND DAYOFMONTH(display.date) = '19';

The left join will give you rows with data from both tables and rows
from display that don't have data in click; the where clause will
then narrow the selection to the day you want.

Hope this helps

 Date: Sun, 19 Jan 2003 19:02:25 +0200
 To: [EMAIL PROTECTED]
 From: Lisi [EMAIL PROTECTED]
 Subject: Problem with LEFT JOIN

 I have a page with many ads that stores both the number of times an ad is
 displayed and how many times it gets clicked.  These are stored in two
 different tables (since different information is stored for each) but both
 have identical name columns. I am trying to display both # times displayed
 and # times clicked in the same table in an admin page.

 Here is my query to find ads that were clicked on today:
 SELECT ads_displayrate.name, SUM(ads_displayrate.count) as display, SUM(
 IF( ads_clickrate.date IS NULL, 0, 1 ) ) as click FROM ads_displayrate
LEFT
 JOIN ads_clickrate ON ads_displayrate.name = ads_clickrate.name AND
 YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date) = '01'
 AND DAYOFMONTH(ads_displayrate.date) = '19' GROUP BY ads_displayrate.name
 ORDER BY ads_displayrate.name

 This works for clicks, but no matter what date I put in it only shows
 displays for the whole month - not the selected day. Also, if I use the
 following query to find clicks for the whole month

 SELECT ads_displayrate.name, SUM(ads_displayrate.count) as display, SUM(
 IF( ads_clickrate.date IS NULL, 0, 1 ) ) as click FROM ads_displayrate
LEFT
 JOIN ads_clickrate ON ads_displayrate.name = ads_clickrate.name AND
 YEAR(ads_displayrate.date) = '2003' AND MONTH(ads_displayrate.date) = '01'
 GROUP BY ads_displayrate.name ORDER BY ads_displayrate.name

 it doubles the number from what it should be.

 What am I doing wrong?

 Thanks in advance,

 -Lisi





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




select query to give sum and distinct values

2003-01-20 Thread Steve Mansfield
Using mysql 3.23.51
I have a mysql table that holds records for telephone traffic.
The table fields are as follows:

idstartstop
   clidditot_dur
day_dureve_durwkd_dur   
1 08/12/2002--23:50:0009/12/2002--02:23:551507608105
08451340206923508635600   
2 09/12/2002--00:14:1509/12/2002--00:15:081634324824
0845134012053.1 053.1 0
3 09/12/2002--00:20:1709/12/2002--00:20:591634324824
0845134012041.9 041.9 0
4 09/12/2002--00:28:0009/12/2002--00:28:461634324824
08451340120460460
5 09/12/2002--00:30:2509/12/2002--00:31:041634324824
0845134012038.9 038.9 0
6 09/12/2002--03:22:3009/12/2002--05:08:431507608105
084513402066372.9 06372.9 0
7 09/12/2002--05:25:2509/12/2002--05:35:561622859384
08451340214631.6   0631.6   0


What i'm trying to do is run a query that will give me the sum tot_dur 
for each distinct ddi
ie: distinct ddi will give me the list of all the ddi numbers that were 
called but i need the sum of tot_dur for each distinct ddi.
so it should produce an output like:

dditot_dur
08451340120179.9
0845134020615607.9
08451340214631.6

Anyone have any ideas as i just cannot get the query correct.


Steve Mansfield
[EMAIL PROTECTED]

http://www.getreal.co.uk

Real Data Services Ltd 117-119 Marlborough Road Romford Essex RM7 8AP
[Office] 0870 757 7900 [Fax] 0870 757 8900

http://www.be-an-isp.comhttp://www.isdn4free.co.ukhttp://signup.getreal.co.uk

For our email disclaimer please see the url below.

http://www.getreal.co.uk/disclaimer.htm



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



RE: building 4.1 from source

2003-01-20 Thread Dana Diederich
Yup, I got exactly the same error.

Cheers.
-Dana

-Original Message-
From: Rafal Jank [mailto:[EMAIL PROTECTED]] 
Sent: Monday, January 20, 2003 6:15 AM
To: [EMAIL PROTECTED]
Subject: building 4.1 from source


Hi,

I've just downloaded version 4.1 from bk and have problem with building it. What 
version of automake is needed? Because after
 aclocal
I get:
aclocal: configure.in: 459: macro `AM_PROG_AS' not found in library


P.S. MySQL, query,database
-- 
_/_/  _/_/_/  - Rafa Jank [EMAIL PROTECTED] -
 _/  _/  _/  _/   _/ Wirtualna Polska SA   http://www.wp.pl 
  _/_/_/_/  _/_/_/ul. Traugutta 115c, 80-237 Gdansk, tel/fax.
(58)5215625
   _/  _/  _/ ==*  http://szukaj.wp.pl *==--

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


**
This email and any files transmitted with it are confidential
and intended solely for the individual or entity to 
whom they are addressed.  If you have received this email
in error destroy it immediately.
**
 Wal-Mart Stores, Inc. Confidential
**


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




AW: query problem

2003-01-20 Thread Franz, Fa. PostDirekt MA
Hi Jon,

you can :

DELETE FROM db_test.tbl_dbaddr;

This would delete all data in db_test.tbl_dbaddr by first dropping the
whole table and then rebuild it again.

You can of curse add a 'WHERE CLAUSE' to determin which rows shall be
deleted.

This is from the HTML-manual:

Duplicates indicates the number of rows that couldn't be inserted because
they would duplicate some existing unique index value. Warnings indicates
the number of attempts to insert column values that were problematic in some
way. Warnings can occur under any of the following conditions: 

Inserting NULL into a column that has been declared NOT NULL. The column is
set to its default value. 
Setting a numeric column to a value that lies outside the column's range.
The value is clipped to the appropriate endpoint of the range. 
Setting a numeric column to a value such as '10.34 a'. The trailing garbage
is stripped and the remaining numeric part is inserted. If the value doesn't
make sense as a number at all, the column is set to 0. 
Inserting a string into a CHAR, VARCHAR, TEXT, or BLOB column that exceeds
the column's maximum length. The value is truncated to the column's maximum
length. 
Inserting a value into a date or time column that is illegal for the column
type. The column is set to the appropriate zero value for the type. 

I think the warnings occur in the binary log-files (under the
MySQL-Server-root) , but I think , you must set a Server-variable to get
this.
I'd recommend to read the online-manual , which is really fine to read or
better - buy the fantastiv book of Paul DuBois , which is nice and easy to
read.
I think there are some people on the list (not me my dear) , that don't like
you to ask questions , that aren't difficult to find in
the manual or the faq's.
Just think of everyone on the list has more than 100 mails every day.
I miss Ed Carp for his ultimate statements when his blood-sugar was low ;-)
, his comments about people that didn't read the manual where extreme.

Prosit
Klaus


 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




upgrade hiccups

2003-01-20 Thread Jeffrey Powell
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

I upgraded MySQL as a part of the latest RedHat up2date and now I get an error
when I try to connect to the database.

Any help appreciated.

[root@jeff root]# mysqlshow
mysqlshow: Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)

[root@powell /]# cat /etc/my.cnf
[mysqld]
skip-innodb
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

- --
Jeff Powell
[EMAIL PROTECTED]
http://www.yonezawa-english-school.com
http://www.yonezawa-english-school.com/powell
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+K/eybJk3zHBW5lARAsFPAJ9xy7dNWHcSpki2fr7MWNMJ7JQtEACfbPwG
KYReteQZJNlZc1XwbHAn9Yo=
=u93H
-END PGP SIGNATURE-


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Problem localhost connect

2003-01-20 Thread filip . margan
Hello,

When I reload mysql server settings with 
'mysql -hlocalhost -p reload --port 3306'
'Enter password: *'

or

'mysql -hlocalhost -p reload'
'Enter password: *'

I get error: 'ERROR 2003: Can't connect to MySQL server on 'localhost' (111)'

I tried with new, old and no password!

So?

---
http://www.email.si

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




re: upgrade hiccups

2003-01-20 Thread Victoria Reznichenko
On Monday 20 January 2003 15:20, Jeffrey Powell wrote:

 I upgraded MySQL as a part of the latest RedHat up2date and now I get an
 error when I try to connect to the database.

 Any help appreciated.

 [root@jeff root]# mysqlshow
 mysqlshow: Can't connect to local MySQL server through socket
 '/var/lib/mysql/mysql.sock' (2)

Check that MySQL server is running.


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




mySQL, TCP/IP, Mac OS X --- HELP PLEASE !

2003-01-20 Thread Ram Kumar
greetings

can anyone help to get mySQL on Mac OS X (entropy pkg), work on TCP/IP
rather than unix socket, please ?

Is Marc Liyanage on this list ?

regards, ram

--

 +--+
   Mac Solutions
   http://www.macsolutionsindia.com +91 98102 70848
ram @ macsolutionsindia.com
   MSN: [EMAIL PROTECTED]   support @ macsolutionsindia.com
 +--+
 Simplifying solutions for you...  Macintosh, Windows, Client/Server, Web



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: mysql

2003-01-20 Thread Kamara Eric R-M

On Sun, 19 Jan 2003, M A wrote:



 HI

 i am new to mysql.. i have just installed the source code under
 /user/local/mysql
 but the commnads don't work unless i have ./ infront of the command
 for example: mysqladmin won't work unless its written ./mysqladmin.

 please let me know if i am doing something wrong

 Thanks


Have you tried putting /usr/local/mysql in your search path?add
/usr/local/mysql/bin to the line that has PATH in the file /etc/profile or
something similar

Eric


 _
 MSN 8 with e-mail virus protection service: 2 months FREE*
 http://join.msn.com/?page=features/virus


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




New to MySQL/PHP with Rank-Amateur Questions

2003-01-20 Thread Stephen Tiano
I'm brand-new to MySQL/PHP and to this list, spending an interesting 
holiday weekend devoted to trying to start learning the 
MySQL/PHP/Apached axis.

There're three things that had me thinking of just giving it all up. But 
after a night's sleep I can't deny still wanting to learn how to design 
and lay out database-driven websites.

But three problems prevent me from getting into the meat of some 
really great tutorials I found ...

1) I have administrator rights on the G3 PowerBook on which I'm doing 
this learning. But that's not the same as MySQL recognizing me with 
administrator acces, is it? How can I make MySQL give me administrator 
access, so I can have permission to issue CREATE [and ALL other] 
commands. As it is now, when I try to create a table from the Terminal 
window--and I've decided I DO want to be able to do this in the Terminal 
also, not just thru a GUI--an error message appears, saying that access 
is denied.

2) If I create a table in phpMyAdmin, how do I plant it in, say, 
Dreamweaver--or, really, code it into the HTML Dreamweaver creates--so 
the table can be accessed, as part of a web page, from a browser?

3) I got to the end of November 2002 Macworld magazine's Serve It Up 
article, to the sidebar A Jump Start. I downloaded MacUser's .sit file 
for the 'start application' mentioned, unpacked it all, and put its 
folder in my SItes folder. I called it up thru my browse--using 
http://localhost/stephent/contacts/index.php--and was presented with a 
login page. I put in the username MySQL knows me by and a box drops down 
with 'Select a username' and three options: 'root', the one I'd put in, 
and a third name I use in my email address stiano. Whichever I choose, 
the password I use with each of them, specified earlier in MySQL, is put 
in the second field on the login page. I press the 'Log in' button, and 
a Netscape alert appears. It says:

   The information you have entered is to be sent over an unencryoted 
connection and could easily  be read by a third party.

   Are you sure you want to continue sending this information?

and a third line where I can check off to be alerted any time I submit 
unencrypted info.

Plus two buttons. If I choose the default 'Continue', the process begins 
again, the box dropping with the three choices of user name. The only 
way to get out of this maddening circle is to choose 'Cancel', which of 
course just leaves me sitting on the login page without being logged in, 
and with the sample database nowhere to be seen.

These three issues addressed, I'd be happy as a clam and moving on.

Thanks,
Steve Tiano


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: New to MySQL/PHP with Rank-Amateur Questions

2003-01-20 Thread dunk fordyce


1) I have administrator rights on the G3 PowerBook on which I'm doing 
this learning. But that's not the same as MySQL recognizing me with 
administrator acces, is it? How can I make MySQL give me administrator 
access, so I can have permission to issue CREATE [and ALL other] 
commands. As it is now, when I try to create a table from the Terminal 
window--and I've decided I DO want to be able to do this in the Terminal 
also, not just thru a GUI--an error message appears, saying that access 
is denied.

you need to be root
something like:

mysql -u root



2) If I create a table in phpMyAdmin, how do I plant it in, say, 
Dreamweaver--or, really, code it into the HTML Dreamweaver creates--so 
the table can be accessed, as part of a web page, from a browser?

you need to write some php or perl to get the data from mysql - ive no
idea about doing this in dreamweaver - do it by hand! ;)


3) I got to the end of November 2002 Macworld magazine's Serve It Up 
article, to the sidebar A Jump Start. I downloaded MacUser's .sit file...

Mac? whats that..
ive never even heard of a .sit file


--

---
===
--- :::   :::  :::   :::   :::===   :::===
--- :::  ===  :::  ::   ===  ::   ===  ===  ::: === ===
--- ===  ===  ===   =   === === ===
--- ===  ===  ===   ===   ===  ===  === ===
--- ===   ===      ==   === ===
www.dunkfordyce.co.uk==




-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: query problem

2003-01-20 Thread Stefan Hinz, iConnect \(Berlin\)
Jon,

 Where can I look to see the Warnings?

MySQL 4.1 will come with an enhanced error/warnings reporting system
where you can use SHOW ERRORS and SHOW WARNINGS (see
http://www.mysql.com/doc/en/SHOW_WARNINGS.html for details).

If you don't have 4.1 (as most of us) you can tell the server to log
warnings, too, by starting it with the --warnings option (or write
warnings without quotes in the mysqld section of your my.cnf / my.ini
and restart the server).

You can see warnings in the MySQL error file. Under Unix, this file is
called hostname.err (where hostname is the name of your machine),
under Windows it's mysql.err.

Regards,
--
  Stefan Hinz [EMAIL PROTECTED]
  Geschäftsführer / CEO iConnect GmbH http://iConnect.de
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

- Original Message -
From: Jon Miller [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 12:49 PM
Subject: query problem


I ran a query as follows:
Insert Into db_test.tbl_dbaddr (Client, Contact, Addr, OfcPhone) SELECT
Client AS Client, Business AS Contact, Addr AS Addr, OfcPhone AS
OfcPhone From AddressBook.tbl_addr;

I got the following Records: 8989 Duplicates: 16 Warnings:394

Where can I look to see the Warnings?
Also the information in the Contact and Addr field is wrong.  How do I
delete the entire table.  I believe I cannot use Drop.  Using Select *
delete from tbl_dbaddr yields a syntax error.

Thanks

Jon L. Miller, MCNE, CNS
Director/Sr Systems Consultant
MMT Networks Pty Ltd
http://www.mmtnetworks.com.au

I don't know the key to success, but the key to failure
 is trying to please everybody. -Bill Cosby





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Is it normal?

2003-01-20 Thread Octavian Rasnita
Hi all,

I've tried the following SQL queries:

mysql create table test(id float);
Query OK, 0 rows affected (0.00 sec)

mysql insert into test values(1.123), (3.1495);
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql select * from test where id=1.123;
Empty set (0.00 sec)

Shouldn't this last query show me the record that has the id=1.123?

What query should I use to do this?

Thank you.



Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Substraction

2003-01-20 Thread Octavian Rasnita
But I don't want to perform a 15 - id, meaning 15 - 10.
I want to calculate 5 - id, meaning 5 - 10.

It should give me -5 or 5 but not | 18446744073709551611 |


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: Stefan Hinz, iConnect (Berlin) [EMAIL PROTECTED]
To: Brian Lindner [EMAIL PROTECTED]; Octavian Rasnita
[EMAIL PROTECTED]
Cc: MySQL [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 1:09 AM
Subject: Re: Substraction


Brian,

  create table test(id int unsigned);
  insert into test values(10);
  select 15 - id from test;
  The result is 18446744073709551611 instead of -5.

Trying to confirm this with MySQL 4.0.7 on a Win2K box:

mysql create table test(id int unsigned);
Query OK, 0 rows affected (0.56 sec)

mysql insert into test values(10);
Query OK, 1 row affected (0.08 sec)

mysql select 15 - id from test;
+-+
| 15 - id |
+-+
|   5 |
+-+
1 row in set (0.06 sec)

Now, once again with phpMyAdmin 2.3.3pl1:

SELECT 15 - id
FROM test LIMIT 0, 30
15 - id
5

But with the following statement (same with phpMyAdmin):

mysql select 5 - id from test;
+--+
| 5 - id   |
+--+
| 18446744073709551611 |
+--+
1 row in set (0.00 sec)

Check the 1 in your 15. Maybe there's something wrong.

Regards,
--
  Stefan Hinz [EMAIL PROTECTED]
  Geschäftsführer / CEO iConnect GmbH http://iConnect.de
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

- Original Message -
From: Brian Lindner [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]
Cc: MySQL [EMAIL PROTECTED]
Sent: Sunday, January 19, 2003 10:28 PM
Subject: Re: Substraction


 Octavian,

 Sunday, January 19, 2003, 7:31:57 AM, you wrote:
  Hi all,

  I've tried the following query:

  create table test(id int unsigned);
  insert into test values(10);
  select 15 - id from test;

  The result is 18446744073709551611 instead of -5.

 I ran this.. and it worked for me

 MySql 4.0.7 on Linux... ran it through phpMyAdmin

  Am I doing something wrong?

  Thank you.

  Teddy,
  Teddy's Center: http://teddy.fcc.ro/
  Email: [EMAIL PROTECTED]




 -
  Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)

  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail
[EMAIL PROTECTED]
  Trouble unsubscribing? Try:
http://lists.mysql.com/php/unsubscribe.php





 --
  Brian
  Email: [EMAIL PROTECTED]




 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Mysql and Database Link

2003-01-20 Thread Jeremy Zawodny
On Mon, Jan 20, 2003 at 03:49:00PM +0200, Egor Egorov wrote:
 On Monday 20 January 2003 06:36, MySQL wrote:
 
  I'm woundering if Mysql can use Database link, like Oracle can???
 
  Eg. If i have some tables at my labtop, and want to make the same table(s)
  at my server with this command:
 
  create table test as select * from test@database_link (This is how you do
  it on Oracle), but how do I do this in Mysql
 
 You can use CREATE .. SELECT statement:
   http://www.mysql.com/doc/en/CREATE_TABLE.html
 
 but you must create indexes manually.

I think you misunderstand.  Those are not really the same.  Links in
Oracle (as described to me) allow you to connect multiple servers
together--so you can join between tables on different servers, for
example.

Jeremy
-- 
Jeremy D. Zawodny |  Perl, Web, MySQL, Linux Magazine, Yahoo!
[EMAIL PROTECTED]  |  http://jeremy.zawodny.com/

MySQL 4.0.8: up 1 days, processed 46,297,176 queries (320/sec. avg)

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: mySQL, TCP/IP, Mac OS X --- HELP PLEASE !

2003-01-20 Thread R. Hannes Niedner
On 1/20/03 6:18 AM, Ram Kumar [EMAIL PROTECTED] wrote:

 greetings
 
 can anyone help to get mySQL on Mac OS X (entropy pkg), work on TCP/IP
 rather than unix socket, please ?
 
 Is Marc Liyanage on this list ?
 
 regards, ram

I don't know if Mark is on the list, but I might have some suggestions
nevertheless.

Mysql listens by default on port 3306 (if you specified a different port
you'd probably know it). Do you have this port open on you computer (that
runs mysqld) and on your router (in case you have one)?

As beautifully explained in the manual in most cases permissions are granted
for 'localhost ' (which will use the socket) and for any other machine %
or specific IP, host name , domain etc. Did you grant the user the correct
privileges to connect from the host the client is running on?
http://www.mysql.com/doc/en/GRANT.html

Hth/h


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: indexing a full text

2003-01-20 Thread Thomas Spahni
On Mon, 20 Jan 2003, David T-G wrote:

 OK; here's some code (I didn't want to waste time posting junk, but
 perhaps it's applicable here after all.  Thanks for the couple of
 responses so far!

   # a particular piece
   create table pieces
   (
 # ID number
 id smallint unsigned not null default 0 auto_increment primary key ,
 title char(50) ,
 index (title) ,
 words text (4095) ,
 fulltext index (words(4095))
   ) ;

David,

try the following:

create table pieces (
  id smallint unsigned not null auto_increment primary key,
  title varchar(50),
  words text,
  key (title(16)),
  fulltext (words)
) TYPE=MYISAM;

Are you sure that smallint is enough for your index? Do you really need to
index the full title?

Thomas Spahni
-- 
filter: mysql, query


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Restricting access to results based on field values

2003-01-20 Thread Jesse Sheidlower

I'm developing an application and trying to figure out a good
way to restrict a user's access to data based on the content
of particular fields. I'm sure there must be a standard way of
doing this, but I don't know what it is.

An example might be, in the canonical CD database, having
a user who can only see results where cd.genre = 'Folk',
or where song.length  10.

My first thought was to have a table 'restrictions' with the
userID and some element of a WHERE clause, e.g. cd.genre =
'Folk' hard-coded in it, and then when anyone issues a query,
I grab everything matching their userID from the restrictions
table, join it together, and stick it on to the end of the
existing WHERE clause. But I'm worried that this will be
vastly problematic if the structure of the tables change, or
if I issue a query that turns out not to involve one of the
tables (e.g. even if I usually expect queries to involve all
the tables, I'll be stuck if I'm only querying the titles from
the cd table and try to stick a 'song.length  10' to the
WHERE clause when I'm not querying from the song table).

Is there some standard way of doing this? It doesn't
necessarily have to be neat, in that I'm the only one in
charge of the database and I'm willing to do something in a
manner that's somewhat of a pain to work with. But I also
don't want to do something that will be impossible to 
maintain or convert to a better way.

I'm using Perl, if that matters.

Thanks for any ideas, sql query.

Jesse Sheidlower

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Is it normal?

2003-01-20 Thread Dobromir Velev
Hi,
Please read
http://www.mysql.com/doc/en/Problems_with_float.html

It is a common problem when working with floating point  numbers

Dobromir Velev
[EMAIL PROTECTED]


- Original Message -
From: Octavian Rasnita [EMAIL PROTECTED]
To: MySQL [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 10:34
Subject: Is it normal?


 Hi all,

 I've tried the following SQL queries:

 mysql create table test(id float);
 Query OK, 0 rows affected (0.00 sec)

 mysql insert into test values(1.123), (3.1495);
 Query OK, 2 rows affected (0.01 sec)
 Records: 2  Duplicates: 0  Warnings: 0

 mysql select * from test where id=1.123;
 Empty set (0.00 sec)

 Shouldn't this last query show me the record that has the id=1.123?

 What query should I use to do this?

 Thank you.



 Teddy,
 Teddy's Center: http://teddy.fcc.ro/
 Email: [EMAIL PROTECTED]



 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Substraction

2003-01-20 Thread Dobromir Velev
Hi,
There are several ways to solve the problem -
1. Check if you really need an unsigned column  - if not just alter the
column to signed
2. A simple workaround for substracting unsigned values is to add a floating
point number to the operation - then all values will be converted to float
and the negative value will be displayed. For example this should give you
what you need

select 15.0 - id from test;

3. Use CAST function. Example:

select cast(15-id as signed) from test;

HTH
Dobromir Velev
[EMAIL PROTECTED]



- Original Message -
From: Octavian Rasnita [EMAIL PROTECTED]
To: Stefan Hinz, iConnect (Berlin) [EMAIL PROTECTED]; Brian
Lindner [EMAIL PROTECTED]
Cc: MySQL [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 08:22
Subject: Re: Substraction


 But I don't want to perform a 15 - id, meaning 15 - 10.
 I want to calculate 5 - id, meaning 5 - 10.

 It should give me -5 or 5 but not | 18446744073709551611 |


 Teddy,
 Teddy's Center: http://teddy.fcc.ro/
 Email: [EMAIL PROTECTED]

 - Original Message -
 From: Stefan Hinz, iConnect (Berlin) [EMAIL PROTECTED]
 To: Brian Lindner [EMAIL PROTECTED]; Octavian Rasnita
 [EMAIL PROTECTED]
 Cc: MySQL [EMAIL PROTECTED]
 Sent: Monday, January 20, 2003 1:09 AM
 Subject: Re: Substraction


 Brian,

   create table test(id int unsigned);
   insert into test values(10);
   select 15 - id from test;
   The result is 18446744073709551611 instead of -5.

 Trying to confirm this with MySQL 4.0.7 on a Win2K box:

 mysql create table test(id int unsigned);
 Query OK, 0 rows affected (0.56 sec)

 mysql insert into test values(10);
 Query OK, 1 row affected (0.08 sec)

 mysql select 15 - id from test;
 +-+
 | 15 - id |
 +-+
 |   5 |
 +-+
 1 row in set (0.06 sec)

 Now, once again with phpMyAdmin 2.3.3pl1:

 SELECT 15 - id
 FROM test LIMIT 0, 30
 15 - id
 5

 But with the following statement (same with phpMyAdmin):

 mysql select 5 - id from test;
 +--+
 | 5 - id   |
 +--+
 | 18446744073709551611 |
 +--+
 1 row in set (0.00 sec)

 Check the 1 in your 15. Maybe there's something wrong.

 Regards,
 --
   Stefan Hinz [EMAIL PROTECTED]
   Geschäftsführer / CEO iConnect GmbH http://iConnect.de
   Heesestr. 6, 12169 Berlin (Germany)
   Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

 - Original Message -
 From: Brian Lindner [EMAIL PROTECTED]
 To: Octavian Rasnita [EMAIL PROTECTED]
 Cc: MySQL [EMAIL PROTECTED]
 Sent: Sunday, January 19, 2003 10:28 PM
 Subject: Re: Substraction


  Octavian,
 
  Sunday, January 19, 2003, 7:31:57 AM, you wrote:
   Hi all,
 
   I've tried the following query:
 
   create table test(id int unsigned);
   insert into test values(10);
   select 15 - id from test;
 
   The result is 18446744073709551611 instead of -5.
 
  I ran this.. and it worked for me
 
  MySql 4.0.7 on Linux... ran it through phpMyAdmin
 
   Am I doing something wrong?
 
   Thank you.
 
   Teddy,
   Teddy's Center: http://teddy.fcc.ro/
   Email: [EMAIL PROTECTED]
 
 
 
 
  -
   Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
 
   To request this thread, e-mail [EMAIL PROTECTED]
   To unsubscribe, e-mail
 [EMAIL PROTECTED]
   Trouble unsubscribing? Try:
 http://lists.mysql.com/php/unsubscribe.php
 
 
 
 
 
  --
   Brian
   Email: [EMAIL PROTECTED]
 
 
 
 
  -
  Before posting, please check:
 http://www.mysql.com/manual.php   (the manual)
 http://lists.mysql.com/   (the list archive)
 
  To request this thread, e-mail [EMAIL PROTECTED]
  To unsubscribe, e-mail
 [EMAIL PROTECTED]
  Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 




 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




re: Re: indexing a full text

2003-01-20 Thread Victoria Reznichenko
On Monday 20 January 2003 16:16, David T-G wrote:
 create table pieces
   (
 # ID number
 id smallint unsigned not null default 0 auto_increment primary key ,
 title char(50) ,
 index (title) ,
 words text (4095) ,
 fulltext index (words(4095))
   ) ;

David, words text (4095) is incorrect definition of column. TEXT is a 
variable-length column type with the maximum size 64K:
http://www.mysql.com/doc/en/Storage_requirements.html

You should use
[skip]
...
words TEXT,
FULLTEXT(words)




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




re: Re: Substraction

2003-01-20 Thread Egor Egorov
On Monday 20 January 2003 08:22, Octavian Rasnita wrote:
 But I don't want to perform a 15 - id, meaning 15 - 10.
 I want to calculate 5 - id, meaning 5 - 10.

 It should give me -5 or 5 but not | 18446744073709551611 |

The result of the above expression is UNSIGNED, because column 'id' is INT 
UNSIGNED. If you want to get -5, use CAST() function in v4.0:

mysql select CAST(5 - id AS SIGNED) from test;
++
| CAST(5 - id AS SIGNED) |
++
| -5 |
++
1 row in set (0.00 sec)

or in 3.23 you can do:

mysql select 5 - (id+0.0) from test;
+--+
| 5 - (id+0.0) |
+--+
| -5.0 |
+--+
1 row in set (0.00 sec)

For more info look at:
http://www.mysql.com/doc/en/Cast_Functions.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




3.23 doesn't report dup key on INSERT ... SELECT

2003-01-20 Thread Bill Easton
It appears that the stable, production version, 3.23 doesn't give an SQL
error when an INSERT ... SELECT would cause a duplicate primary key.  4.0
does not appear to have the problem.  (I discovered it when replicating from
3.23.49 Linux to a 4.0.1 Windows 2000--the server did not detect the
duplicate key, but replication crashed.)

The short script below creates a table TEMP_READ and inserts a row with key
(123, 123).  If I then insert the same thing with an INSERT ... SELECT, I
don't get an SQL error.  If I do the insert using INSERT ... VALUES, I do
(correctly) get the error.

This problem occurs on 3.23.49 (and Linux 7.3) and 3.23.54 (Win Me).  It
does not occur on 4.0.1 (Win 2k) and 4.0.8 (Linux 7.3).  The problem
occurred on 3.23.49 (Linux 7.3) using JDBC, as well as the MySQL client.

I looked in the list archives, but did not find it.

---

create database if not exists test;
use test;

drop table if exists GROUPS;
drop table if exists TEMP_READ;

CREATE temporary TABLE GROUPS
   (A int, B int);
insert into GROUPS values
   (123, 123);

CREATE TEMPORARY TABLE TEMP_READ
   (
  SUBJECT   INT NOT NULL,
  TARGETINT NOT NULL,
 PRIMARY KEY (SUBJECT, TARGET)
   );

INSERT INTO TEMP_READ
  values (123,123);

/* should fail, but does not */
INSERT INTO TEMP_READ
   SELECT * from GROUPS;

/* fails (correctly) */
INSERT INTO TEMP_READ
  values (123,123);





-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




MySQL for QNX

2003-01-20 Thread CRUZ M. Juan MAN-TAMSA
sql


 Do you have any idea how the release for qnx will be ready?
 
 Juan Cruz
 Veracruz, Ver.
 Mexico

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: 3.23 doesn't report dup key on INSERT ... SELECT

2003-01-20 Thread Paul DuBois
At 12:29 -0500 1/20/03, Bill Easton wrote:

It appears that the stable, production version, 3.23 doesn't give an SQL
error when an INSERT ... SELECT would cause a duplicate primary key.


I believe the default behavior for INSERT ... SELECT is like INSERT IGNORE
... SELECT for 3.23.


  4.0
does not appear to have the problem.  (I discovered it when replicating from
3.23.49 Linux to a 4.0.1 Windows 2000--the server did not detect the
duplicate key, but replication crashed.)



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Compiling MySQL 4.0.9-gamma under FreeBSD 4.7-Stable with linuxthreads

2003-01-20 Thread Maximo Migliari
Hello there,

I'm trying to compile MySQL 4.0.9-gamma under FreeBSD 4.7-Stable with 
linuxthreads.
I installed linuxthreads through the ports system by doing:
cd /usr/local/ports/devel/linuxthreads
make
make install

it installed just fine.
I downloaded the source distribution of MySQL (not using the ports system, 
as I cannot find the gamma version of mysql4 through it, even after an 
update of my ports collection).

This is the configure command I try to use:
CFLAGS=-O3 -DHAVE_BROKEN_REALPATH -mcpu=pentiumpro -D__USE_UNIX98 
-D_REENTRANT -D_THREAD_SAFE \
-I/usr/local/include/pthread/linuxthreads  \
CXX=gcc CXXFLAGS=-O3 -felide-constructors -fno-exceptions -fno-rtti 
-mcpu=pentiumpro \
 ./configure --prefix=/usr/local/mysql --enable-assembler \
--with-mysqld-ldflags=-all-static \
--with-client-ldflags=-all-static \
--localstatedir=/usr/local/mysql/data \
--enable-thread-safe-client \
--enable-local-infile \
--with-extra-charsets=complex \
--disable-shared \
--with-innodb \
--with-mit-threads=no \
--without-debug \
--with-named-thread-libs='-DHAVE_GLIBC2_STYLE_GETHOSTBYNAME_R -D_THREAD_SAFE \
-I/usr/local/include/pthread/linuxthreads -L/usr/local/lib -llthread -llgcc_r'


this is the error I get:
checking size of char... configure: error: cannot compute sizeof (char), 77

which ends configure.  Does anyone know what could be causing this?


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: What is the best known practice for insertion...?

2003-01-20 Thread Paul DuBois
At 9:47 + 1/20/03, Sean Burlington wrote:

Daevid Vincent wrote:

This may be useful to you:
http://www.mysql.com/doc/en/REPLACE.html



replace works very nicley and is IMO a good extension to standard SQL

another way that may be suitable is to delete first and then insert 
(this may erase data if you are not inserting all columns)

If you're not inserting all columns, so will REPLACE!







-Original Message-
From: Zysman, Roiy [mailto:[EMAIL PROTECTED]] Sent: Sunday, 
January 19, 2003 11:16 PM
To: [EMAIL PROTECTED]
Subject: What is the best known practice for insertion...?


Hi All,
I'm trying to insert multiple lines to a table with 3 col. All 3 of them
are a part of the primary key.
But while inserting the data , sometime occurs the situation where I
want to insert an already exist entry with the same keys. And mysql
barfs out that this key already exist in the table.
The solution to it would be probably to query for each entry that I'm
about to insert if that entry exists , but it looks like it would be an
enormous overhead. I'm asking this question on a _performance_ context .
What is the best way , ignore the error messages mysql barfs out or
query each entry for existences before inserting it ?


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: What is wrong in this time difference query?

2003-01-20 Thread Paul DuBois
At 11:48 +0200 1/20/03, Putte Koivisto wrote:

I use MYSQL TO_DAYS function to grab some statistics from database and I use
next
statement:

SELECT ID FROM database
WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) =7
ORDER BY ID DESC

I have IIS server and I use Dreamweaver MX to build the statistics page,
where we use ASP. Problem is, that I get row from every month with date
difference of 7 instead of rows from last seven days. What went wrong? Do I
have to specify the date format someway to the TO_DAYS function?


If you want just records for the last 7 days, do you want the
difference to be  7 rather than = 7?



Sincerely,

Putte Koivisto



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re:Re: Substraction

2003-01-20 Thread Nasser Ossareh
 1. Check if you really need an unsigned column  - if not just alter the column to 
signed

this is the most appropriate answer.  i.e your table design should cater for the 
limited set or modulus arithmatics.  

Casting wouldn't work simply because you may really want the actual unsigned value of 
2^64 - 5 which is 18446744073709551611 in one case and the 5 - 10 = -5 in another.  If 
you cast both, it will return -5 (not a pleasant view for a very rich bank 
customer!!). 

And by the way this is not a MySQL limitation, it is a computer Science issue as 
computers can not implement infinite sets (N, R, Z, Q etc).  

Luckily, this doesn't happen in practice because database designers do allow for such 
issues in their table designs... Octavian's table is, however designed to show this 
issue and not to solve a commerical problem.

Enough is enough! Let's stop this nonsense.

Nasser.

-- Dobromir Velev [EMAIL PROTECTED] writes:

Return-Path: [EMAIL PROTECTED]
Received: from mx12.lax.untd.com (mx12.lax.untd.com [10.130.24.72])
by maildeliver03.nyc.untd.com with SMTP id AAA9C2PGCAFYS4JA
for [EMAIL PROTECTED] (sender 
[EMAIL PROTECTED]);
Mon, 20 Jan 2003 12:41:22 -0500 (EST)
Received: from web.mysql.com (web.mysql.com [213.136.49.183])
by mx12.lax.untd.com with SMTP id AAA9C2PGBAM2YKK2
for [EMAIL PROTECTED] (sender 
[EMAIL PROTECTED]);
Mon, 20 Jan 2003 09:41:21 -0800 (PST)
Received: (qmail 30395 invoked by uid 7797); 20 Jan 2003 17:12:03 -
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm (http://www.ezmlm.org)
List-ID: mysql.mysql.com
Precedence: bulk
List-Help: mailto:[EMAIL PROTECTED]
List-Unsubscribe: mailto:[EMAIL PROTECTED]
List-Post: mailto:[EMAIL PROTECTED]
List-Subscribe: mailto:[EMAIL PROTECTED]
Delivered-To: mailing list [EMAIL PROTECTED]
Received: (qmail 30024 invoked from network); 20 Jan 2003 17:11:38 -
Message-ID: 05b801c2c0a7$8c882800$1d00a8c0@Dobromir
From: Dobromir Velev [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]
Cc: MySQL [EMAIL PROTECTED]
References: 001901c2bfe4$58e8dda0$[EMAIL PROTECTED] 
[EMAIL PROTECTED] 
00ad01c2c010$45ee73a0$dc4fc7d9@mephisto 
006001c2c09a$9a4fc1d0$[EMAIL PROTECTED]
Subject: Re: Substraction
Date: Mon, 20 Jan 2003 19:15:33 +0200
MIME-Version: 1.0
Content-Type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.
X-Virus-Scanned: by AMaViS perl-11

Hi,
There are several ways to solve the problem -
1. Check if you really need an unsigned column  - if not just alter the
column to signed
2. A simple workaround for substracting unsigned values is to add a floating
point number to the operation - then all values will be converted to float
and the negative value will be displayed. For example this should give you
what you need

select 15.0 - id from test;

3. Use CAST function. Example:

select cast(15-id as signed) from test;

HTH
Dobromir Velev
[EMAIL PROTECTED]



- Original Message -
From: Octavian Rasnita [EMAIL PROTECTED]
To: Stefan Hinz, iConnect (Berlin) [EMAIL PROTECTED]; Brian
Lindner [EMAIL PROTECTED]
Cc: MySQL [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 08:22
Subject: Re: Substraction


 But I don't want to perform a 15 - id, meaning 15 - 10.
 I want to calculate 5 - id, meaning 5 - 10.

 It should give me -5 or 5 but not | 18446744073709551611 |


 Teddy,
 Teddy's Center: http://teddy.fcc.ro/
 Email: [EMAIL PROTECTED]

 - Original Message -
 From: Stefan Hinz, iConnect (Berlin) [EMAIL PROTECTED]
 To: Brian Lindner [EMAIL PROTECTED]; Octavian Rasnita
 [EMAIL PROTECTED]
 Cc: MySQL [EMAIL PROTECTED]
 Sent: Monday, January 20, 2003 1:09 AM
 Subject: Re: Substraction


 Brian,

   create table test(id int unsigned);
   insert into test values(10);
   select 15 - id from test;
   The result is 18446744073709551611 instead of -5.

 Trying to confirm this with MySQL 4.0.7 on a Win2K box:

 mysql create table test(id int unsigned);
 Query OK, 0 rows affected (0.56 sec)

 mysql insert into test values(10);
 Query OK, 1 row affected (0.08 sec)

 mysql select 15 - id from test;
 +-+
 | 15 - id |
 +-+
 |   5 |
 +-+
 1 row in set (0.06 sec)

 Now, once again with phpMyAdmin 2.3.3pl1:

 SELECT 15 - id
 FROM test LIMIT 0, 30
 15 - id
 5

 But with the following statement (same with phpMyAdmin):

 mysql select 5 - id from test;
 +--+
 | 5 - id   |
 +--+
 | 18446744073709551611 |
 +--+
 1 row in set (0.00 sec)

 Check the 1 in your 15. Maybe there's something wrong.

 Regards,
 --
   Stefan Hinz [EMAIL PROTECTED]
   Gesch䦴sf��r / CEO iConnect GmbH http://iConnect.de
   Heesestr. 6, 12169 Berlin (Germany)
   Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

 - Original Message -
 From: Brian Lindner [EMAIL 

FreeBSD 5.0 Thread Work...

2003-01-20 Thread Grigor, Peter
Alrighty then!

Now FreeBSD 5.0 has been released, what are the plans for mysql to evaluate
the new (really new :) thread implementation.

Peter
^_^

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Problem localhost connect

2003-01-20 Thread Diana Soares
Hi,

[root@localhost root]# perror 111
Error code 111:  Connection refused

You don't seem to have the mysql server running.
First, be shure that your mysqld is up and running.
Then, correct your command: to reload the server from the command line
you should use mysqladmin command instead of mysql. Like:

# mysqladmin -hlocalhost -p reload


On Mon, 2003-01-20 at 13:22, [EMAIL PROTECTED] wrote:
 Hello,
 When I reload mysql server settings with 
 'mysql -hlocalhost -p reload --port 3306'
 'Enter password: *'
 
 or
 
 'mysql -hlocalhost -p reload'
 'Enter password: *'
 
 I get error: 'ERROR 2003: Can't connect to MySQL server on 'localhost' (111)'
 
 I tried with new, old and no password!
 
 So?
-- 
Diana Soares


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Table Update Help / Problem

2003-01-20 Thread Diana Soares
Check the REPLACE command...
http://www.mysql.com/doc/en/REPLACE.html

I think it suits your problem...

On Mon, 2003-01-20 at 08:14, Michael Watson wrote:
 This may be very simple, but the solution eludes me..
 
 I have two tables  Products and NewProducts,  The Products table contains a
 list of all the current product line and prices Products.ProdCode,
 Products.Price (amongst other details not relevent here).  NewProducts
 contains a list of changes to be made to the database, ie New Product lines,
 changes of prices to existing lines.  (NewProducts.ProdCode,
 NewProducts.Price).
 
 How can I update existing records in Products if ProdCode are equal in both
 tables, and if ProdCode exists in NewProducts but Not in Products, insert
 that records?
 
 We are using MySQL Version 3.23.54a
 
 Thanks
 
 Michael Watson
 MBW Computing
 [EMAIL PROTECTED]
 Tel: 03 9782-0427 Fax: 03 9782-0657
 Mob: 0425 788-185
-- 
Diana Soares


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: What is the best known practice for insertion...?

2003-01-20 Thread Sasha Pachev
On Monday 20 January 2003 12:15 am, Zysman, Roiy wrote:
 Hi All,
 I'm trying to insert multiple lines to a table with 3 col. All 3 of them
 are a part of the primary key.
 But while inserting the data , sometime occurs the situation where I
 want to insert an already exist entry with the same keys. And mysql
 barfs out that this key already exist in the table.
 The solution to it would be probably to query for each entry that I'm
 about to insert if that entry exists , but it looks like it would be an
 enormous overhead. I'm asking this question on a _performance_ context .
 What is the best way , ignore the error messages mysql barfs out or
 query each entry for existences before inserting it ?

Roiy:

Try INSERT IGNORE...

-- 
MySQL Development Team
For technical support contracts, visit https://order.mysql.com/?ref=mspa
   __  ___ ___   __ 
  /  |/  /_ __/ __/ __ \/ /   Sasha Pachev [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\___/  Provo, Utah, USA
   ___/  

MySQL Users Conference and Expo
http://www.mysql.com/events/uc2003/

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: select query to give sum and distinct values

2003-01-20 Thread Diana Soares
I didn't test it but you may try something like:

SELECT ddi, sum(tot_dur) 
FROM table
GROUP BY ddi
ORDER BY ddi

On Mon, 2003-01-20 at 12:59, Steve Mansfield wrote:
 Using mysql 3.23.51
 I have a mysql table that holds records for telephone traffic.
 The table fields are as follows:
 
 idstartstop
 clidditot_dur
 day_dureve_durwkd_dur   
 1 08/12/2002--23:50:0009/12/2002--02:23:551507608105
 08451340206923508635600   
 2 09/12/2002--00:14:1509/12/2002--00:15:081634324824
 0845134012053.1 053.1 0
 3 09/12/2002--00:20:1709/12/2002--00:20:591634324824
 0845134012041.9 041.9 0
 4 09/12/2002--00:28:0009/12/2002--00:28:461634324824
 08451340120460460
 5 09/12/2002--00:30:2509/12/2002--00:31:041634324824
 0845134012038.9 038.9 0
 6 09/12/2002--03:22:3009/12/2002--05:08:431507608105
 084513402066372.9 06372.9 0
 7 09/12/2002--05:25:2509/12/2002--05:35:561622859384
 08451340214631.6   0631.6   0
 
 
 What i'm trying to do is run a query that will give me the sum tot_dur 
 for each distinct ddi
 ie: distinct ddi will give me the list of all the ddi numbers that were 
 called but i need the sum of tot_dur for each distinct ddi.
 so it should produce an output like:
 
 dditot_dur
 08451340120179.9
 0845134020615607.9
 08451340214631.6
 
 Anyone have any ideas as i just cannot get the query correct.
 
 
 Steve Mansfield
 [EMAIL PROTECTED]
 
 http://www.getreal.co.uk
 Real Data Services Ltd 117-119 Marlborough Road Romford Essex RM7 8AP
 [Office] 0870 757 7900 [Fax] 0870 757 8900
 http://www.be-an-isp.comhttp://www.isdn4free.co.uk
http://signup.getreal.co.uk
 For our email disclaimer please see the url below.
 http://www.getreal.co.uk/disclaimer.htm
-- 
Diana Soares


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: FreeBSD 5.0 Thread Work...

2003-01-20 Thread Maximo Migliari
YES, pretty please, with sugar on top:
from now on also make available for us binary distributions of MySQL 
optimized for FreeBSD 5.0's new threading implementation.

There is a very large FreeBSD user base that must not be ignored :)

Thanks!
Maximo.

At 14:20 20/1/2003 -0500, you wrote:
Alrighty then!

Now FreeBSD 5.0 has been released, what are the plans for mysql to evaluate
the new (really new :) thread implementation.

Peter
^_^

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail 
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Group By

2003-01-20 Thread Doug Coning
Hi everyone,

I want to run a query that will combine the results of 5 columns into 1
column, and then group them by similar results so that only 1 instance is
returned.

I currently have the following query:

SELECT Category
FROM gs_Products
GROUP BY Category
ORDER BY Category ASC

How would I modify this query to return all the items from Category,
Category2, Category3, Category4 and Category5 and then group them all by
similarities?

Thank you,

Doug Coning




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




How to generate my.cnf based on existing configuration?

2003-01-20 Thread Jannie Qu
sql, query

Hi, all,

I started to support on an old mysql production database on SunOS 5.8 and 
mysql version 3.23.47 with only MyISAM type of tables.

I take a look on /etc/init.d/mysql file, and in this file, it will refer 
/etc/my.cnf. But there is no my.cnf file at that directory.

I cannot shutdown the database right now in order to test the 
/etc/init.d/mysql and I am afraid without my.cnf in the specified directory 
will eventually cause this mysql scrip fail.

So my question is:How to generate my.cnf based on existing configuration?

Thank you and regards,
Jannie





_
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Upgrading Red Hat rpms

2003-01-20 Thread Walter
I have a Red Hat 7.3 box running MySQL 3.23.49 (installed with the Red Hat 
rpms).  I am about to upgrade to 4.0.9 and would prefer using the RPMs from 
MySQL.  My plan was to just un-install the Red Hat rpms and then install 
the new rpms (after backing everything up first, of course).  Is there 
anything else I should do or look out for?

Thanks in advance.

Walter


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: New to MySQL/PHP with Rank-Amateur Questions

2003-01-20 Thread Benjamin Pflugmann
Hello.

On Mon 2003-01-20 at 09:26:18 -0500, [EMAIL PROTECTED] wrote:
 I'm brand-new to MySQL/PHP and to this list, spending an interesting 
 holiday weekend devoted to trying to start learning the 
 MySQL/PHP/Apached axis.
 
 There're three things that had me thinking of just giving it all up. But 
 after a night's sleep I can't deny still wanting to learn how to design 
 and lay out database-driven websites.
 
 But three problems prevent me from getting into the meat of some 
 really great tutorials I found ...
 
 1) I have administrator rights on the G3 PowerBook on which I'm doing 
 this learning. But that's not the same as MySQL recognizing me with 
 administrator acces, is it?

Correct. Operating system users have nothing in common with users
known to MySQL. The default administrator account for MySQL is called
root and has an empty password in the default install, usually.

 How can I make MySQL give me administrator access, so I can have
 permission to issue CREATE [and ALL other] commands. As it is now,
 when I try to create a table from the Terminal window--and I've
 decided I DO want to be able to do this in the Terminal also, not
 just thru a GUI--an error message appears, saying that access is
 denied.

As other already pointed out, you have to tell MySQL which user you
want to log in as. If you don't do so, it will try to use the name
with which you authenticated to your OS, which is not what you want in
this case. Use somthing like

  mysqladmin -uroot create your_database

 2) If I create a table in phpMyAdmin, how do I plant it in, say, 
 Dreamweaver--or, really, code it into the HTML Dreamweaver creates--so 
 the table can be accessed, as part of a web page, from a browser?

You need some in-the-middle application that does the work. HTML is a
language to describe pages, not a programming language. MySQL is a
database, it knows nothing about webpages. You want to use a
programming language to read the data from MySQL and create the HTML
from the data you just read.

Some well known are Coldfusion, ASP, PHP, and so on. Or you can use a
general purpose programming language like Perl, C++, Java.

If you have no preference already, I suggest using PHP.

 3) I got to the end of November 2002 Macworld magazine's Serve It Up 
 article, to the sidebar A Jump Start. I downloaded MacUser's .sit file 
 for the 'start application' mentioned, unpacked it all, and put its 
 folder in my SItes folder. I called it up thru my browse--using 
 http://localhost/stephent/contacts/index.php--and was presented with a 
 login page. I put in the username MySQL knows me by and a box drops down 
 with 'Select a username' and three options: 'root', the one I'd put in, 
 and a third name I use in my email address stiano. Whichever I choose, 
 the password I use with each of them, specified earlier in MySQL, is put 
 in the second field on the login page. I press the 'Log in' button, and 
 a Netscape alert appears. It says:
 
The information you have entered is to be sent over an unencryoted 
 connection and could easily  be read by a third party.
 
Are you sure you want to continue sending this information?
 
 and a third line where I can check off to be alerted any time I submit 
 unencrypted info.

Even if it might be obvious, just to be sure: This message has nothing
to do with your problem, but will appear any time you fill in a
formular. It is just a note to make you aware that the data
transmission is kind of unsafe.

 Plus two buttons. If I choose the default 'Continue', the process begins 
 again, the box dropping with the three choices of user name.

If it simply appears again, it means either the username or the
password you entered is invalid.

 The only way to get out of this maddening circle is to choose
 'Cancel', which of course just leaves me sitting on the login page
 without being logged in, and with the sample database nowhere to be
 seen.

I think the problem is that you try the authentication data for MySQL,
but you are accessing a web page. It is rather unusual that a web page
would require the password for the database directly, except for pages
that are meant to work on the database layout (like phpMyAdmin).

Have a look if the article you mentioned doesn't list some test
account or something like that.

HTH,

Benjamin.


-- 
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: How to generate my.cnf based on existing configuration?

2003-01-20 Thread Stefan Hinz, iConnect \(Berlin\)
Jannie,

 /etc/my.cnf. But there is no my.cnf file at that directory.
 So my question is:How to generate my.cnf based on existing
configuration?

You can see the server options for the MySQL server by issuing

 mysqld --print-defaults

The output is pretty ugly, but it will show you all settings for the
server.

Next step, you can put those options into /etc/my.cnf, somehow like
this:

Let's say, the output starts like this:

mysqld would have been started with the following arguments:
--basedir=c:/mysql --datadir=c:/mysql/data --tmpdir=c:/mysql/temp

Then you put this in my.cnf:

[mysqld]
basedir=c:/mysql
datadir=c:/mysql/data
tmpdir=c:/mysql/temp

Restarting the MySQL server, it will start with exactly the options as
before.

Next step, you can experiment with different settings ...

Read more: http://www.mysql.com/doc/en/Command-line_options.html

Regards,
--
  Stefan Hinz [EMAIL PROTECTED]
  Geschäftsführer / CEO iConnect GmbH http://iConnect.de
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

- Original Message -
From: Jannie Qu [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 9:58 PM
Subject: How to generate my.cnf based on existing configuration?


 sql, query

 Hi, all,

 I started to support on an old mysql production database on SunOS 5.8
and
 mysql version 3.23.47 with only MyISAM type of tables.

 I take a look on /etc/init.d/mysql file, and in this file, it will
refer
 /etc/my.cnf. But there is no my.cnf file at that directory.

 I cannot shutdown the database right now in order to test the
 /etc/init.d/mysql and I am afraid without my.cnf in the specified
directory
 will eventually cause this mysql scrip fail.

 So my question is:How to generate my.cnf based on existing
configuration?

 Thank you and regards,
 Jannie





 _
 Protect your PC - get McAfee.com VirusScan Online
 http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Is it normal?

2003-01-20 Thread Stefan Hinz, iConnect \(Berlin\)
Octavian,

 mysql create table test(id float);
 mysql insert into test values(1.123), (3.1495);
 mysql select * from test where id=1.123;
 Empty set (0.00 sec)
 Shouldn't this last query show me the record that has the id=1.123?

Well ... 1.123 is greater than 1.123, see:

mysql select id from octavian where id  1.123;
++
| id |
++
|  1.123 |
| 3.1495 |
++
2 rows in set (0.00 sec)

Now here's why. Floats are simply not precise:

mysql select id*1 from octavian where id  1.123;
+-+
| id*1|
+-+
| 11230.000257492 | --
| 31494.998931885 |
+-+
2 rows in set (0.00 sec)

 What query should I use to do this?

I leave this one to Paul or one of the other gurus.

Regards,
--
  Stefan Hinz [EMAIL PROTECTED]
  Geschäftsführer / CEO iConnect GmbH http://iConnect.de
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

- Original Message -
From: Octavian Rasnita [EMAIL PROTECTED]
To: MySQL [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 9:34 AM
Subject: Is it normal?


 Hi all,

 I've tried the following SQL queries:

 mysql create table test(id float);
 Query OK, 0 rows affected (0.00 sec)

 mysql insert into test values(1.123), (3.1495);
 Query OK, 2 rows affected (0.01 sec)
 Records: 2  Duplicates: 0  Warnings: 0

 mysql select * from test where id=1.123;
 Empty set (0.00 sec)

 Shouldn't this last query show me the record that has the id=1.123?

 What query should I use to do this?

 Thank you.



 Teddy,
 Teddy's Center: http://teddy.fcc.ro/
 Email: [EMAIL PROTECTED]



 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: FreeBSD 5.0 Thread Work...

2003-01-20 Thread Dan Nelson
In the last episode (Jan 20), Maximo Migliari said:
 YES, pretty please, with sugar on top: from now on also make
 available for us binary distributions of MySQL optimized for FreeBSD
 5.0's new threading implementation.
 
 There is a very large FreeBSD user base that must not be ignored :)

FreeBSD 5.0 has the ability for userland processes to create multiple
kernel threads.  It does not yet have a POSIX interface to those
threads, so don't go asking people for kernel threads support just yet :)

5.0 has a lot of new features, but some of them are not complete
(kernel threads), or not very well tested (sparc64/ia64 ports, MAC,
ufs2).  The hope is that lots of people will install 5.0 and report
problems so that 5.2 can be marked -STABLE.

http://www.freebsd.org/releases/5.0R/early-adopter.html

-- 
Dan Nelson
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




is there a floating point type bigger than double?

2003-01-20 Thread Matthew Phillips
We need to store numbers that exceed the precision of the DOUBLE
datatype. The mysql manual makes no mention of a size bigger than
DOUBLE. Storing the number as a string is not preferable because of the
extra space a character string would take up. One thought is to store
two integers: the digits to the right and left of the decimal place. 

The question is: is there an easier way to do this that would take up
less space than a DECIMAL column... perhaps something like a long double
column. Have I exhausted the available options? I got the feeling that I
am going to have to go with the int*2 solution but I decided I would
check with the 'experts' first.

Matthew Alan Phillips

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




mysql backgroup process refers to nonexisting my.cnf file

2003-01-20 Thread Jannie Qu
Sql, query,

Hi, all,

I found on our clients mysql database machines, there is no my.cnf file by 
doing a global search, but when I did the following command, it seems that 
mysql process is referring to this file 
(--default-extra-file=/export/mysql/data/my.cnf ).

Do you think it's normal?

Thank you,
Jannie



bash-2.03$ ps -ef | grep mysql
   root   340 1  0   Jan 13 ?0:00 /bin/sh 
/export/mysql/bin/safe_mysqld --datadir=/export/mysql/data --pid-file=/
  mysql   364   340  0   Jan 13 ?1:41 /export/mysql/bin/mysqld 
--defaults-extra-file=/export/mysql/data/my.cnf --base
  mysql 17102 17100  0 16:17:06 pts/00:00 -bash
  mysql 17239 17102  0 16:57:52 pts/00:00 -bash
=




_
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



FW: Mac OS X 10.1 build

2003-01-20 Thread James LaFountain


I've been trying to compile MySQL 4.0.8 on Mac OS X Server 10.1.4 with the
supplied Development Tools CD.
Thing so far appear to work fine.  But when I connect remotely (from another
machine on socket 3306), the server restarts (crashes).   I've read the news
threads and I see this was also a problem in Linux.  However I don't know
how to fix this on Mac OS X Server 10.1.4.  We are unable to upgrade to the
Jaguar release, and your site does not post binaries for OS X 10.1.4 Server.
Perhaps if there were some notes posted on how to properly build the
binaries, it may help.


Thank You
James 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




New Beginner to List

2003-01-20 Thread Doll Hargrove
List Members:

My web server only accommodates mysql.

I've started to trancribe an 1866 census record with 8 columns of 
information.  The file was created in excel and I used an csv extension 
(delimited) to import this information into the mysql data table.  The 
tables is completed.  

Now, what do I need to do get this table operational for my website?  I 
wanted to create a search program for users.

Your help will be appreciated!

-- 
Researching Macon County Alabama
Surnames:  Bryant, Harris, Thomas, Webb, Wilson

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: New Beginner to List

2003-01-20 Thread Stefan Hinz, iConnect \(Berlin\)
Doll,

 My web server only accommodates mysql.

I wouldn't say only, though :)

 Now, what do I need to do get this table operational for my website?
I
 wanted to create a search program for users.

Use PHP. It's easy to learn and works smoothly with MySQL. You will find
lots of examples how to transform your MySQL data into HTML in the
online documentation: http://www.php.net/docs.php

Regards,
--
  Stefan Hinz [EMAIL PROTECTED]
  Geschäftsführer / CEO iConnect GmbH http://iConnect.de
  Heesestr. 6, 12169 Berlin (Germany)
  Tel: +49 30 7970948-0  Fax: +49 30 7970948-3

- Original Message -
From: Doll Hargrove [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 11:48 PM
Subject: New Beginner to List


 List Members:

 My web server only accommodates mysql.

 I've started to trancribe an 1866 census record with 8 columns of
 information.  The file was created in excel and I used an csv
extension
 (delimited) to import this information into the mysql data table.  The
 tables is completed.

 Now, what do I need to do get this table operational for my website?
I
 wanted to create a search program for users.

 Your help will be appreciated!

 --
 Researching Macon County Alabama
 Surnames:  Bryant, Harris, Thomas, Webb, Wilson

 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Is rename table to another database safe for INNODB tables

2003-01-20 Thread Jannie Qu
sql, query,

Hi, all,

As you may knew, mysql will implement rename database in version 4.1
Right now, I need to rename a database, what I plan to do is rename each 
table (INNODB type, version 3.23.53 on MAC OS) to another new database.

RENAME TABLE current_db.tbl_name TO new_db.tbl_name;

Do you think it's safe to (1) do the rename? or I'd better do a (2) import 
all to the new database? Which way is better?

Thank you,
Jannie




_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
http://join.msn.com/?page=features/junkmail


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: is there a floating point type bigger than double?

2003-01-20 Thread Benjamin Pflugmann
Hi.

On Mon 2003-01-20 at 15:05:46 -0700, [EMAIL PROTECTED] wrote:
 We need to store numbers that exceed the precision of the DOUBLE
 datatype. The mysql manual makes no mention of a size bigger than
 DOUBLE. Storing the number as a string is not preferable because of the
 extra space a character string would take up. One thought is to store
 two integers: the digits to the right and left of the decimal place. 

With INT that gives you 10 digits before and 10 after the decimal
point. Note that double is considered to have a precision of 15-16
digits.

But I would BIGINT instead and just define how to calculate down to
the decimal point (either by dividing by 10^10 or 2^32).

 The question is: is there an easier way to do this that would take up
 less space than a DECIMAL column...

No, the question is: what do you want to do with these numbers? :-)

Do you want to run any operation than simply storing and retrieving
these numbers? If not, you can simply use CHAR(16) or something like
that and store the binary representation of the number. I presume that
you have something like that... it wouldn't make much sense to store
high precision number, if you use double within your application.

If you want to use database functions like AVG() or SUM(), this does
not work, of course.

 perhaps something like a long double
 column.

No there is no native column type that directly stores such numbers.

 Have I exhausted the available options? I got the feeling that I
 am going to have to go with the int*2 solution but I decided I would
 check with the 'experts' first.

For a more specific answer you need to tell us what those numbers are
and what you are going to do with them (what operations you need to
run on them).

HTH,

Benjamin.


-- 
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Quick question.

2003-01-20 Thread NBDesign
Hello,

Just a quick question.  I am just starting to learn MySQL. I am on a
windows XP pro computer but want to create scripts using php and cgi for
all platforms. If I create a database using MySQL on windows, is the
database transportable to Unix and Linux?

Thanks.



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Quick question.

2003-01-20 Thread Benjamin Pflugmann
Hi.

On Mon 2003-01-20 at 16:51:53 -0700, [EMAIL PROTECTED] wrote:
 
 Just a quick question.  I am just starting to learn MySQL. I am on a
 windows XP pro computer but want to create scripts using php and cgi for
 all platforms. If I create a database using MySQL on windows, is the
 database transportable to Unix and Linux?

Generally yes. There are some minor issues (like case sensitivity)
which you should be aware of to create a truly portable database. But
even if you ignore these issues it is easy enough (though maybe time
consuming) to fix them later.

Have a look at 

  http://www.mysql.com/doc/en/Windows_vs_Unix.html
  
which mentions all caveats, AFAICS.

HTH,

Benjamin.

-- 
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




How2unsubscribe?

2003-01-20 Thread Sam4Software
Hi list,

I have migrated to SQLServer, so I wonder if some one can direct me how to unsubscribe 
please.

Thanks.

Sam

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: How2unsubscribe?

2003-01-20 Thread Daniel Kasak
[EMAIL PROTECTED] wrote:


Hi list,

I have migrated to SQLServer, so I wonder if some one can direct me how to unsubscribe please.

Thanks.

Sam

-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 

Maybe you should migrating to truck driving or something dude.
How did you get on the list in the first place?

--
Daniel Kasak
IT Developer
* NUS Consulting Group*
Level 18, 168 Walker Street
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: www.nusconsulting.com


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Mac OS X 10.1 build

2003-01-20 Thread R. Hannes Niedner
If you download the binary, there is nothing to compile. Just follow the
instructions in the file INSTALL_BINARY and you are ready to go. I did the
same on 10.2.2 server and it worked great.

Hth/h

On 1/20/03 2:21 PM, James LaFountain [EMAIL PROTECTED] wrote:

 
 
 I've been trying to compile MySQL 4.0.8 on Mac OS X Server 10.1.4 with the
 supplied Development Tools CD.
 Thing so far appear to work fine.  But when I connect remotely (from another
 machine on socket 3306), the server restarts (crashes).   I've read the news
 threads and I see this was also a problem in Linux.  However I don't know
 how to fix this on Mac OS X Server 10.1.4.  We are unable to upgrade to the
 Jaguar release, and your site does not post binaries for OS X 10.1.4 Server.
 Perhaps if there were some notes posted on how to properly build the
 binaries, it may help.
 
 
 Thank You
 James 



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Article: Using the Ruby DBI Module

2003-01-20 Thread Rich Allen
Paul/others,

/usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:477:in `load_driver': Could not 
load driver (uninitialized constant Mysql at DBI::DBD) 
(DBI::InterfaceError)
	from /usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:384:in `_get_full_driver'
	from /usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:364:in `connect'
	from /Users/hcir/Desktop/simple.rb:8


am getting this when using the simple.rb example with Mac OS X 10.2.3? 
i have Perl working with mysql and DBI ...

followed the install from the link below

thanks
- hcir



http://www.kitebird.com/articles/




-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Another Rank Amateur Question

2003-01-20 Thread Stephen Tiano
The manual I was able to download, I now notice, is for version 
4.0.3-beta of MySQL. So that's the official tutorial I'm working. That 
and Kevin Yank's Building a Database-Driven Web Site Using PHP and 
MySQL--a '10-week course' that I also was able to download.

Problem has surfaced due to my having installed version 3.I-forget-what. 
But I'm fine with staying away from betas. The problem is I'm up to an 
exercise for populating a table with data from a textfile. I downloaded 
the textfile and then ran the command line:

 LOAD DATA LOCAL INFILE pet.txt INTO TABLE pet;

and I was greeted with:

 ERROR 1148: The used command is not allowed with this MySQL version

There has to be a way to load data into tables as far back as the 
ancient 3.__. Could anyone share with me what the correct command/syntax 
is for pre-version 4?

Thank you.

Steve Tiano


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: Another Rank Amateur Question

2003-01-20 Thread Kevin Mihelich
Stephen Tiano wrote:
[snip]

 LOAD DATA LOCAL INFILE pet.txt INTO TABLE pet;

and I was greeted with:

 ERROR 1148: The used command is not allowed with this MySQL version

There has to be a way to load data into tables as far back as the 
ancient 3.__. Could anyone share with me what the correct command/syntax 
is for pre-version 4?

You will have to recompile mysql with the explicit option to enable that 
in the configure.
--
Kevin

Thank you.

Steve Tiano



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Article: Using the Ruby DBI Module

2003-01-20 Thread Paul DuBois
At 15:09 -0900 1/20/03, Rich Allen wrote:

Paul/others,

/usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:477:in `load_driver': Could 
not load driver (uninitialized constant Mysql at DBI::DBD) 
(DBI::InterfaceError)
	from /usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:384:in `_get_full_driver'
	from /usr/lib/ruby/site_ruby/1.6/dbi/dbi.rb:364:in `connect'
	from /Users/hcir/Desktop/simple.rb:8


am getting this when using the simple.rb example with Mac OS X 
10.2.3? i have Perl working with mysql and DBI ...

followed the install from the link below

That's the error you get if you didn't install Ruby DBI's MySQL driver,
so I'd guess you did something a bit different than what the instructions
in the article say.  What were your exact configuration and install commands?



thanks
- hcir



http://www.kitebird.com/articles/




-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




relational tables query help

2003-01-20 Thread Justin French
Hi all,

I have three tables:

partners (id,name,url,desc)
services (id,desc,category)
partner_service_rel (pid,sid)

Each partner offers a range of services, and each services has an id,
description, and category.

Now, it's EASY to search for partners that offer a certain service, but I
can't figure out a smart way to list all services for a specific partnerID,
grouped by category.

I got this far (which I think is perhaps WAY off track!!):

SELECT services.*, partners.id
FROM services, partner_service_rel
WHERE partner_service_rel.pid='1'
AND partners.id=partner_service_rel.sid

And I'm getting Unknown table 'partners' in field list.

Any advice warmly received :)


Justin French


sql,query


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: relational tables query help

2003-01-20 Thread Natale Babbo
because there isn't any partners table in the FROM
clause!

 --- Justin French [EMAIL PROTECTED] ha scritto:
 Hi all,
 
 I have three tables:
 
 partners (id,name,url,desc)
 services (id,desc,category)
 partner_service_rel (pid,sid)
 
 Each partner offers a range of services, and each
 services has an id,
 description, and category.
 
 Now, it's EASY to search for partners that offer a
 certain service, but I
 can't figure out a smart way to list all services
 for a specific partnerID,
 grouped by category.
 
 I got this far (which I think is perhaps WAY off
 track!!):
 
 SELECT services.*, partners.id
 FROM services, partner_service_rel
 WHERE partner_service_rel.pid='1'
 AND partners.id=partner_service_rel.sid
 
 And I'm getting Unknown table 'partners' in field
 list.
 
 Any advice warmly received :)
 
 
 Justin French
 
 
 sql,query
 
 

-
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list
 archive)
 
 To request this thread, e-mail
 [EMAIL PROTECTED]
 To unsubscribe, e-mail

[EMAIL PROTECTED]
 Trouble unsubscribing? Try:
 http://lists.mysql.com/php/unsubscribe.php
  

__
Yahoo! Cellulari: loghi, suonerie, picture message per il tuo telefonino
http://it.yahoo.com/mail_it/foot/?http://it.mobile.yahoo.com/index2002.html

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php