Re: urban myth?

2004-05-12 Thread Michael T. Babcock
Boyd E. Hemphill wrote:

To all who answered thank you.  This answer below is the one that I can
use to convince him what he proposes is not necessarily safe.  
 

I almost always have a timestamp column immediately after my 
auto_increment'ed primary key column which I use for ordering by 
insert/update order.  To get rows from oldest to most recent, I just:

CREATE TableName (
   ID smallint unsigned not null auto_increment primary key,
   MTime timestamp,
   Data ...
);
SELECT * FROM TableName ORDER BY MTime ASC;

If you want created order as well, you can do:

CREATE TableName (
   ID smallint unsigned not null auto_increment primary key,
   MTime timestamp,
   CTime timestamp,
   Data ...
);
INSERT INTO TableName (CTime, Data) values (now(), ...), (now(), ...), ...

That will give you an MTime that's auto-updated based on last 
modification and a CTime that is the creation timestamp.
--
Michael T. Babcock
http://mikebabcock.ca/

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


Re: just the list please!

2004-03-17 Thread Michael T. Babcock
Daniel Kasak wrote:

When someone has a MySQL problem, it is often urgent.
While most of my posts to the list seem to appear withing a few 
minutes, I can remember many occasions when they took more than a few 
hours.


Its also not that difficult to notice duplicates; only the messages to 
yourself are duplicated, not entire threads.

I often remove the person's E-mail address if its not some form of 
urgent posting (like this one) or where they may not care about the 
response, especially if I'm just adding to a thread and not actually 
responding to them.
--
Michael T. Babcock

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


Re: Select and Limit

2004-03-17 Thread Michael T. Babcock
Egor Egorov wrote:

Yes, use LIMIT clause to get only certain number of rows. For example, to retrieve 
forst 10 rows use the following statement:
SELECT .. FROM .. ORDER BY .. LIMIT 0,10;
Then to retrieve next 10 rows:
SELECT .. FROM .. ORDER BY .. LIMIT 10,10; retrieve rows 11-20
 

Assuming, as always, that the contents don't change at all in the mean time.

Remember that if someone deletes an item that fits into what you're 
currently viewing, the 'next' set of 10 items will actually skip over one.

For example:

1-10, [11-20], 21-30 (where the square brackets show your current view 
of the data)

If I delete 16 in another process somewhere for whatever reason (it 
happens), the item that was 21st will now be 20th, but when you ask for 
the next set of results (21-30) you'll miss the old 21 (now 20).

If this applies to you, try selecting to a temporary table and then 
'window' your way through it using the LIMIT clause.

CREATE [ TEMPORARY ] TABLE search_result_abc123 SELECT  (no limit);

Then for each 'page' of data, do:
SELECT * FROM search_result_abc123 LIMIT x, x+10;
--
Michael T. Babcock
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: Innodb logfiles timestamp question

2004-03-17 Thread Michael T. Babcock
John Thorpe wrote:

  524288000 Mar 11 11:19 ib_logfile0
  524288000 Mar  3 08:59 ib_logfile1
  524288000 Mar 11 11:19 ib_logfile2


I would venture a random guess that ib_logfile1 was in use until Mar 3, 
then ib_logfile2 began and that around Mar 11 it switched back up to 
ib_logfile0 where it still was when you looked at it (since you posted 
your message on the 12th).

Given more time, I'd presume ib_logfile0 to eventually show Mar 20 or so 
and ib_logfile1 to show the same as it has moved on to the next file ...
--
Michael T. Babcock

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


Re: XML in MySQL

2003-06-23 Thread Michael T. Babcock
Jeremy Zawodny wrote:

SOAP is one thing.  But what about storing XML documents in the DB
(with validation on the way in) and querying them using XPath?  Oracle
does that.  MySQL does not.
 

And off-topic from the original question but to repeat myself from 
before, using XML and MySQL together isn't that difficult in most 
situations you may encounter.  A little wrapping to be sure, but 
validating parsers are easy to get your hands on and designing an 
expat-based parser that knows your schema (XML  DB) for translation 
isn't a big chore for most data types I've come across.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: How do we convert a well-structured XML file to its corresponding tables in a MySQL Database ?

2003-06-19 Thread Michael T. Babcock
Eldrid Rensburg wrote:

How do we convert a well-structured XML file to its corresponding tables in
a MySQL Database ?
With your own Perl/Python/C code ...

And how do we normalize this well-structured XML file prior to conversion ?
 

By basically tracking how deep you are in the nesting.  In Python, you 
build a mutli-layer dictionary of the XML file and then do something like:

def deconstruct(xmldata, parentdata):
   for item in xmldata:
   if item.has_subitems():
   deconstruct(item, xmldata)
   query = INSERT INTO %s VALUES (...) % (xmldata.name, ...)
--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: I wonder why nobody answered me

2003-06-18 Thread Michael T. Babcock
Primaria Falticeni wrote:

Why nobody answered me?
I posted two questions on this list.
 

When did the website claim that all questions would be answered on the 
list?  More importantly, as someone else has already pointed out, please 
consider paying for support if you really want guaranteed service, just 
like anywhere else.

This list is a convenient place to discuss or ask questions about 
probably 98% of situations.  That last 2% probably requires support.

Please note, as always that 72.83% of all statistics are made up on the 
spot.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: Set no root password

2003-06-14 Thread Michael T. Babcock
I think I have figured out what he wants:

He wants to set a root password (randomly) and then save it in 
~root/.my.cnf so that the root user doesn't (apparently) need a password 
to log into MySQL.

However, any other user trying to log in as root would need to know the 
password.

Am I close?

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: Is this an inefficient query?

2003-06-03 Thread Michael T. Babcock
Jay Blanchard wrote:

$qin .= AND (cdr.dialedno LIKE '800%' ;
$qin .= OR cdr.dialedno LIKE '866%' ;
$qin .= OR cdr.dialedno LIKE '877%' ;
$qin .= OR cdr.dialedno LIKE '888%') ;
OK, I am getting closer to the answer. It seems that the inefficiency is
born in the OR statements. Anyone have any experience with cleaning up
something like this?
 

It seems you're dealing with area code logic.  If you can re-schema your 
tables, consider:

  SELECT ...
LEFT JOIN phoneno on cdr.dialednoid = phoneno.id
   WHERE ...
 AND phoneno.areacode in (866,877,888)
 AND ...
Get the idea?

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: How to secure a MySQL database from people with physical acce ss

2003-05-29 Thread Michael T. Babcock
On Tue, May 27, 2003 at 03:43:14PM -0500, mos wrote:
 Correct, which is why I have a means of compressing and *encrypting* the 
 .exe file. I can also lock it to the person's machine (or server) so it 
 won't fall into the wrong hands.

All such methods have been broken.

If they weren't, the major software companies would all be using them to
prevent cracking ... remember that the EXE has to decrypt itself.

Usually it contains an obfuscated series of jumps that decrypt its image
in memory while at the same time changing word offsets within the image
so the decompile looks wrong from within a debugger.

A couple anti-tracing measures and it makes it pretty hard to reverse-
engineer, but people still do it.

 Other databases that use encryption will decrypt the information when a row 
 is accessed, so there is no unencrypted data lying on the hard drive. It is 
 extremely fast and I don't notice a speed difference between encrypted and 

If I were going to trust anything to be secure, it would involve data that was
encrypted to the public keys of the users who deserve access *before* being
sent to the database for storage.  This of course prevents the use of indexing.

Anything else has the problems others have mentionned.
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/


pgp0.pgp
Description: PGP signature


Re: Mailing Labels from MySQL database on web

2003-05-29 Thread Michael T. Babcock
On Tue, May 27, 2003 at 05:02:47PM -0500, Cal Evans wrote:
 2:  BETTER
 Use PHP to build a PDF on the server in the proper Avery label format and
 then serve it up through the web server. If you get this working, make sure
 you share how you did it.

Generating postscript from PHP is easy enough; ps2pdf on *nix platforms
will do the rest.

 3: Better
 Use a reporting package. There are several reporting packages for MySQL.
 Check freshmeat.net or sourceforge.net to find the one best for you.

May I recommend checking the ability to fetch the data directly from Word
yourself with ADO and ODBC?
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/


pgp0.pgp
Description: PGP signature


Re: mysql ssh tunneling

2003-05-28 Thread Michael T. Babcock
On Sun, May 25, 2003 at 12:09:33PM +0200, Tobias Schittkowski wrote:
 I established the tunneling connection, and a
 mysql -h localhost -u foo -pbar mysql
 connects me nicely to the server.
 
 However, if I use the
 mysql_real_connect(...)
 the host hangs.

What host are you using?

Try running your tunnel with ssh -ddd for extra debugging output on tunnel creation
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

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



Re: Suggestions for choosing GUI Language that has a MySQL DB backend

2003-04-03 Thread Michael T. Babcock


I have been asked to write an interactive GUI program that allows for
the display of results from related queries.
For example, launching the application wil generate the first query,
which will return a list of names of individuals.
 

May I suggest Python with PyGtk+ and using Glade to build the interface.

This code can be made quite small and efficient with Python in my 
experience.  If you have no Python experience; feel free to follow other 
suggestions, but consider trying it.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: MySQL mail servers

2003-04-02 Thread Michael T. Babcock
Steven Nakhla wrote:

Why?  Well, we have our reasons.  Particularly because
we want an efficient way to handle millions of
messages, plus the ability to search/manipulate/data
mine through them using specific applications.
 

I hate to disappoint you, but mail storage as raw files is probably more 
efficient than using MySQL, but YMMV.  I've found qmail with 
Courier-IMAP to be so fast that I can't really say I'd want to try using 
a different back-end at all.  If you end up with any benchmarks, feel 
free to post them.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: Why don't ISPs use v4

2003-04-02 Thread Michael T. Babcock
Ben Edwards wrote:

Sorry everybody.  I assumed that as it had been out for a long time (2 
years?) it was stable.  I should of chequed.


We are also running 3.23.xx because of long-standing stability.  We have 
arranged 4.x installations for customers as necessary, but at this 
point, only 3.23.xx's functionality is required on our own servers.  I'm 
sure the query caching will improve performance when I upgrade, but at 
this point it isn't a necessity.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: Could we make this a web discussion forum?

2003-04-02 Thread Michael T. Babcock
David Brodbeck wrote:

I know a lot of people who refuse to use Yahoo Groups because of Yahoo's
very open and ever-changing privacy policy.
Most of the other combination web discussion board/mailing list systems I've seen are not very good at doing mail.  They're web chat boards with mail notification tacked on.
 

Mind if I throw my hand up as one of those people? :-)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


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


Re: decimal type

2003-02-25 Thread Michael T. Babcock
Stitchin' wrote:

Why couldn't you use float(10,2) ... just an example ... where the first
number in the parentheses is the total characters for the number and the
second number represents how many of those are right of the decimal point?)
 

Computers represent data in binary format at floating point numbers are 
quite innaccurate.  Going into the details on why is for another place 
and time; feel free to search Google w.r.t. floating point vs. fixed 
point values.  When you're working with money (for example), you don't 
want that kind of imprecision, so DECIMAL (which doesn't use floating 
point values) comes into play.  For one company I work with, all their 
values are stored as long integers for pennies.  $100 is stored as 
1.  That way they just drop a decimal before displaying the last two 
digits of the value and they're all set (not using MySQL).

Old versions of Quick Basic, by way of reference had this neat bug:

a = 0
for i = 1 to 100
a = a + 0.01
next i
print a
... printed 0.99 or 1.01 depending on your platform.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


-
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


Heiki, InnoDB crash #2 (update)

2003-02-24 Thread Michael T. Babcock
The patch got my server up and going again for a bit, but now it has died again
after running for about 8 hours or so.

InnoDB: Error: trying to access a stray pointer c22fbff8
InnoDB: buf pool start is at 413cc000, number of pages 1024
030223 19:14:31  InnoDB: Assertion failure in thread 66581 in file 
../include/buf0buf.ic line 284
InnoDB: We intentionally generate a memory trap.

Stack trace:

0x80cd61f handle_segfault__Fi + 379
0x40029532 _end + 935703418
0x82ae78f page_cur_search_with_match + 1807
0x821af59 btr_cur_search_to_nth_level + 2889
0x81e425e row_ins_index_entry_low + 182
0x81e49bf row_ins_index_entry + 59
0x81e4a5c row_ins_index_entry_step + 116
0x81e4d1d row_ins + 693
0x81e4e6a row_ins_step + 278
0x81e606d row_insert_for_mysql + 457
0x811ce6d write_row__11ha_innobasePc + 977
0x80f8df8 write_record__FP8st_tableP12st_copy_info + 484
0x80f86ef 
mysql_insert__FP3THDP13st_table_listRt4List1Z4ItemRt4List1Zt4List1Z4Item15enum_duplicates13thr_lock_type
 + 1043
0x80d4a4b mysql_execute_command__Fv + 5311
0x80d68e3 mysql_parse__FP3THDPcUi + 63
0x80d2bed do_command__FP3THD + 1181
0x80d21cb handle_one_connection__FPv + 563

And now that its running again, I'm going to be doing a full backup and then
rebuild my data files for a full restore.  Should I keep my original files for
your reference/debugging?
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
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: when to normalize out to a table

2003-02-23 Thread Michael T. Babcock
David T-G wrote:

Well, I do, though I'm not surprised that I shouldn't.  I still don't
know anything about left, right, inner, and outer joins; they sound like
belly buttons to me :-)
The best thing to do is find a website with some sample data and sample 
queries and see how they actually work yourself.  The 'direction' of a 
join simply refers to the tables in the query itself, assuming its 
written left to right; so a LEFT join joins the table to the RIGHT of it 
to the one to the LEFT of it, using data from the LEFT one and then 
finding the matching data (from the ON) in the RIGHT one. Reverse RIGHT, 
LEFT above for RIGHT JOIN.  The others will make more sense when you get 
that.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock


-
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


InnoDB Crash [help!]

2003-02-21 Thread Michael T. Babcock
I've got a nice MySQL crash that happened during the night last night and I 
can't seem to get it to come back online for me without --skip-innodb.

Version 3.23.55 compiled from sources with egcs-2.91.66.  Configure at end.

I'll be trying to watch my E-mail even though its authenticated via an InnoDB
table usually :-)

030221 12:22:55  InnoDB: Flushing modified pages from the buffer pool...
030221 12:22:55  InnoDB: Started
/usr/libexec/mysqld: ready for connections
030221 12:22:58  InnoDB: Assertion failure in thread 7176 in file ibuf0ibuf.c line 2538
[...]
Cannot determine thread, fp=0xbebff114, backtrace may not be correct.
Stack range sanity check OK, backtrace follows: [after resolving symbols]
0x80cd61f handle_segfault__Fi + 379
0x40029532 _end + 935704122
0x81dfc09 ibuf_merge_or_delete_for_page + 853
0x825749e buf_page_io_complete + 334
0x825f7a5 buf_read_page_low + 197
0x8260234 buf_read_ibuf_merge_pages + 116
0x81da802 ibuf_contract_ext + 1370
0x81da85b ibuf_contract_for_n_pages + 31
0x81b8c5d srv_master_thread + 937
0x40026b85 _end + 935693453
0x4015614a _end + 936936018

CC=gcc
CXX=gcc
CFLAGS=-O2 -march=pentium
CXXFLAGS=-O2 -march=pentium
LDFLAGS=-static

export CC CXX CFLAGS CXXFLAGS LDFLAGS

./configure \
--sysconfdir=/etc \
--prefix=/usr \
--localstatedir=/var/mysql \
--enable-assembler \
--with-berkeley-db \
--with-innodb \
--with-comment \
--enable-thread-safe-client

-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
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: InnoDB Crash [more info]

2003-02-21 Thread Michael T. Babcock
Michael T. Babcock wrote:


I've got a nice MySQL crash that happened during the night last night and I 
can't seem to get it to come back online for me without --skip-innodb.
 


Follow-up with mysql's bug report:

MySQL support: none
Synopsis:InnoDB Crashing on Startup
Severity:critical
Priority:medium
Category:mysql
Class:sw-bug
Release:mysql-3.23.55 (yes)

Environment:
System: Linux web.fibrespeed.net 2.2.14-10.0 #21 Fri Apr 21 00:22:11 EDT 
2000 i686 unknown
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc 
/usr/bin/cc
GCC: Reading specs from 
/usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)

Compilation info: CC='gcc'  CFLAGS='-O2 -march=pentium'  CXX='gcc'  
CXXFLAGS='-O2 -march=pentium'  LDFLAGS='-static'

LIBC:
lrwxrwxrwx1 root root   13 Apr 10  2000 /lib/libc.so.6 
- libc-2.1.3.so
-rwxr-xr-x1 root root  4101836 Jan 15  2001 /lib/libc-2.1.3.so
-rw-r--r--1 root root 20273324 Jan 15  2001 /usr/lib/libc.a
-rw-r--r--1 root root  178 Jan 15  2001 /usr/lib/libc.so
lrwxrwxrwx1 root root   10 Jul 20  2001 
/usr/lib/libc-client.a - c-client.a

Configure command: ./configure '--sysconfdir=/etc' '--prefix=/usr' 
'--localstatedir=/var/mysql' '--enable-assembler' '--with-berkeley-db' 
'--with-innodb' '--with-comment' '--enable-thread-safe-client' 'CC=gcc' 
'CFLAGS=-O2 -march=pentium' 'CXXFLAGS=-O2 -march=pentium' 'CXX=gcc' 
'LDFLAGS=-static'

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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



[Fwd: Re: Re: Examples needed of MYSQl/PHP update, delete scriptsand relevant]

2003-02-21 Thread Michael T. Babcock
Blah blah blah ...

 Original Message 
Received: (qmail 14594 invoked from network); 21 Feb 2003 19:30:26 -
Received: from unknown (HELO web.mysql.com) (213.136.49.183) by 
mail.fibrespeed.net with SMTP; 21 Feb 2003 19:30:26 -
Received: (from lists@localhost) by web.mysql.com (8.11.6/8.11.6) id 
h1LJVhi24085; Fri, 21 Feb 2003 20:31:43 +0100
Date: Fri, 21 Feb 2003 20:31:43 +0100
Message-Id: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
To: Michael T. Babcock [EMAIL PROTECTED]
Subject: Re: Re: Examples needed of MYSQl/PHP update, delete scripts and 
relevant



Your message cannot be posted because it appears to be either spam or
simply off topic to our filter. To bypass the filter you must include
one of the following words in your message:

sql,query,queries,smallint

If you just reply to this message, and include the entire text of it in the
reply, your reply will go through. However, you should
first review the text of the message to make sure it has something to do
with MySQL. Just typing the word MySQL once will be sufficient, for example.

You have written the following:

Scott wrote:

sers can either have the option to update eg via a update button, or also
have a delete button that deletes that record.

Any ideas?
 


Several dozen, none of which bear typing in here when they're all on 
zend.com, php.com, webmonkey.com, or google.com (ok, the last one's 
cheating).

Search for php form source and see what you get :-)  Most pages that 
display results with PHP support this type of functionality.  I'll give 
you a hint; pump your primary key into the HREFs.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock





--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Hash-Functions

2003-02-19 Thread Michael T. Babcock
Bernhard Döbler wrote:


there's a Password()-Function in MySQL. Can somebody tell my on what standard is based (MD5 etc.) and if there's something similar in a DBMS that also supports triggers? InterBase does not support many functions...
 


Its deprecated; use MD5() or SHA1() ...

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: AW: InterBase vs. Mysql

2003-02-18 Thread Michael T. Babcock
Ben Clewett wrote:


Here MySQL cannot compete.  Your too expensive.  Possibly only that 
MS-MSDE is 50Mb to download that anybody thinks about MySQL at all.

Here there are very little competitive DBMS systems.  But there are 
some, and more each day.  PostgreSQL, MSDE, SapDB, OpenInterbase (or 
what ever it's called).


Write your software to handle mutiple backends and let the customer 
choose what they're willing to pay for.  If they want to use it with 
MySQL, they pay the licensing fees.  If they want to use it with 
Postgres, they don't.  I they find Postgres too slow and want to use 
MySQL, that's their choice.  If they decide they want to use it with 
Oracle, that's their choice too.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: rownum

2003-02-18 Thread Michael T. Babcock
geeta varu wrote:


does mySQL have 
rowid or rownum 
if yes please give an exampl
 


Please search the archives for _rowid to find the previous discussions 
on this.  It comes down to having an unsigned int auto_increment primary 
key value in your table to use as the rowid.  That's what we all use 
(some people here may not, of course).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Slow retrieval of distinct on indexed fields [OT?]

2003-02-18 Thread Michael T. Babcock
Dan Nelson wrote:


You need to walk the entire index to make sure you have all the values.
There might be a single AAB inbetween those million AAA's and
million BBB's.
 


Another DBA and I once discussed that an index of index values would be 
helpful for such large searches as web search engines (for example).  An 
index would list all the words that are indexed with their offsets 
within the index itself, and then those offsets would contain the 
locations in the document for that word; if you needed to find AAB, its 
the second entry (in alpha order) in the word index, and its list of 
positions within the document is the 10234th entry (or byte position) 
within the index file.  To know how many entries, one would simply grab 
the next index item (AAC in this case) and subtract (10235 - 10234 = 1 
entry for AAB).  

AAA - 1
AAB - 10234
AAC - 10235

1: 12
2: 25
[...]
10233: 4285
10234: 73
10235: 4123

To top that off, finding closest matches to AAA with relation to AAC in 
a sentence (for example) would be simple as you can walk the index for 
AAA and AAC at the same time (since you know where both start in the 
index very quickly) and simply increment each according to the diff. 
between the position offsets in each (which are sorted in position order).

Just thinking out-loud, and no, I've never benchmarked it but I played 
with the idea in Python a few times as a proof-of-concept.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd. SQL
http://www.fibrespeed.net/~mbabcock



-
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: InterBase vs. Mysql

2003-02-18 Thread Michael T. Babcock
Ben Clewett wrote:


MySQL say that this is an extension of the application, and therefore 
breaks the GPL, and therefore a licence is needed.  They are however, 
the only big GPL user who thinks this way.  


No they're not.  The issue is not the use of the server (as previously 
discussed a few weeks back), but the library.  If you use the older 
library version (which is LGPL'd), you can basically do as you please as 
you believe you should be able to.  As the new library is under the GPL, 
you can't legally link it to a non-GPL-compatible program at all 
(without purchasing a different license).

Therefore, I can see no reason why not somebody could fork MySQL into 
FreeSQL.  


You forget that (as someone else pointed out, perhaps Ben) MySQL's 
Copyright still lies with MySQL AB.  You can fork the code and modify 
and distribute it _under the GPL_ but that doesn't buy you anything -- 
you don't then have the right to link it against a commercial program or 
even to relicense it.  All you have is a renamed version of MySQL that 
is still under the GPL.  That's not what you're hoping for, is it?

It's either GPL or cpryright, not both.   Then use this without 
commercial licence... 


You obviously need a good lawyer.  The GPL is a license agreement, not a 
Copyleft statement.  Copyright still applies (as it does to all works) 
and the license specifically states that.  In fact, the GPL text says 
that if you don't agree to all the limitations of the GPL then you 
simply fall under those of international Copyright law, which are much 
harsher (and still apply).  You need to re-read the GPL a few times and 
pay a lawyer to help you understand it.

MySQL really that good?  I do worry that with arrogant statements like 
this, this is exactly what people will do, in droves.


Many people here are perfectly happy with the GPL, I might add.  I 
license all my MySQL-related code under the GPL.  I don't distribute it 
to anyone, so its not terribly relevant, but its well marked and noted 
as being either GPL'd or for personal use only (most of which is GPL'd 
as well).

I don't write much commercial, non-GPL code.  I write a lot of 
commercial and GPL'd code though, and so do many other people (like 
MySQL AB).  You might want to consider it too.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: InterBase vs. Mysql

2003-02-18 Thread Michael T. Babcock
Ben Clewett wrote:


What you say is that the API is in my application.  The API is part of 
MySQL.  Therefore my application is GPL or needs a licence. 


Please don't confuse API and library.  The libmysql or libmysqld 
libraries are GPL'd.  Anything linked against them is automatically also 
GPL'd (unless licensed otherwise).  The API simply describes how to use 
the library.

Therefore, if I was to use ODBC, I would not be using your API in my 
application, and could install MySQL under the GPL and use my 
application without licence?  (If I so choose.) 


Technically speaking, if you had an ODBC server and MySQL server 
installed and connected with an LGPL or BSD or commercial ODBC client to 
those services and never modified or linked against those services or 
the mysql library in any way, you'd be clear of the GPL as far as the 
MySQL library is concerned.

Some will argue that, of course, but claiming that connecting over a 
network port to an ODBC server is somehow linking against that server is 
pretty tough.  That said, ODBC doesn't give you all the features of the 
library.

I better copyright all my GPL projects ASAP... 


Everything you write _is_ Copyright to you (unless its a work-for-hire, 
etc.) automatically.  Registering those Copyrights is often unnecessary 
(sign a copy with PGP, E-mail it to someone, have them sign it and store 
a copy of it; that'll pretty much prove you wrote it for many cases).

Maybe my own applications will be replaced with a GPL ones.  I might 
even wright them my self.  Until then, saving money on erronious 
licence fees payes for my family to eat.


I might add that I believe most of the MySQL AB programmers' families do 
in fact eat.  They're paid.  As are the programmers for ReiserFS (also 
GPL'd).  These types of business models are different, but not unprofitable.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: CREATE INDEX is sooo slow! any ideas?

2003-02-17 Thread Michael T. Babcock
Sergei Golubchik wrote:


Which decision, putting all the indexes in one file, or rebuilding all
indexes whenever you ALTER TABLE or add an index?  If the latter, I
agree with you.  Modifying unrelated indexes or columns should not
force a rebuild of every index.
   


Of course not.
And it won't eventually - it's in the todo.




Wow, I love this list (and the MySQL team).  Go to bed with a question, 
wake up with an answer.

Well, in EST5EDT at least.  Thanks.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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



max_user_connections

2003-02-17 Thread Michael T. Babcock
It would be nice to extend the user permissions table to have per-user 
limits like max_user_connections and the various timeouts applying 
directly to specific user/host combinations.

Just a thought / suggestion.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.  SQL
http://www.fibrespeed.net/~mbabcock



-
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: max_user_connections

2003-02-17 Thread Michael T. Babcock
Stefan Hinz wrote:


It would be nice to extend the user permissions table to have per-user 
limits like max_user_connections and the various timeouts applying 
directly to specific user/host combinations.
   


As of MySQL 4.0.2, you can set some limits per user. Here's an excerpt
from my mysql.user table:

- max_question:number of commands user can send to server,
- max_updates: number of changes user can submit,
- max_connections: well, I let you guess ;-)
 


Maybe I'll have to take the plunge and upgrade after all.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Row numbers

2003-02-16 Thread Michael T. Babcock
Luc Foisy wrote:


I didn't say it had nothing to do with the data, I said it had nothing to do with the data in the database.



I'm making the assumption as a DBA that _all_ the data relevant is in 
the database; so the comment I made was equivalent to the above.

As I said, sure I could make external functions to do the job. But why? (I did because I have no choice at the moment)



If the row number is not _used_ but only for show, it _shouldn't_ be 
done by the database to properly sequester and segment your data and 
program models.  However, if you're going to use that row number in any 
way (like: lia href=/showdetails.php?id=$rowid$row data/a/li) 
then it should be an auto_increment value from the database itself 
(although you may very well display a fake programmatically generated ID 
as well).

1. There are a lot of functions that return values that have nothing to do with data contained in the database. Math functions for one, they calculate return values using data that is in the database. And many many other functions. Why not one more.



They calculate results based on data in the database; the row number is 
a meta-value.  Unless its a _rowid type value, you're talking about a 
cosmetic value that isn't data-related.

In the 4.x series the developers implemented SQL_CALC_FOUND_ROWS and FOUND_ROWS(), something that could just have easily been handled by external programming...



Those values can be useful within a query though.  Also, someone may 
have paid for those features (hint).

3. Going through the archives, I have seen many many people ask for it.



Most of those people are now using the methods everyone else on here has 
described because they're correct.  Lots of people have asked for other 
things that may never be done by the MySQL team as well.

4. Those numbers probably already exist, how else does it ORDER BY, it has to put the results in an array of some kind



I have my doubts, I bet they don't exist :)

For a pseudo-php example:

$results = Select(id, name from names order by name limit $start, 
$maxperpage);
print ol;
while ($row = mysql_fetch_array($results))
{
? lia href=showdetail.php?id=?php echo $row['id'] ??php echo 
$row['name'] ?/a/li ?php
}
echo /ol

You'll see how the 'ol' tag provides me with numbered results up to the 
number of $maxperpage on each display, but I use the actual unique ID 
value from the database as a reference value.  The 'ol' values are just 
as easily put in the PHP itself, of course, since they have nothing to 
do with the data (no association to that data).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Need Help With MySQL Query

2003-02-16 Thread Michael T. Babcock
Veysel Harun Sahin wrote:


select vanNumber, sum(grossPay) from usertableDaily group by vanNumber; 


The above is the correct query, to save yourself some time.  As for your 
problem:

But when I execute I get this:
 Resource id#3
 Resource id#4




This means you're using a resource response from a query, not the data 
in the query.  Don't forget to do a mysql_fetch_array or mysql_fetch_row 
on the resource before using it.

As a test:

$res = mysql_query(...);
print $res;
while ($row = mysql_fetch_array($res)) {
   print $row;
   print $row['id'];
}

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: encrypted password

2003-02-16 Thread Michael T. Babcock
Curtis Maurand wrote:


need to encrypt data and then retrieve it later (credit card data).  I could
probably pass it through and md5 or des function via openssl I suppose and
then store it.  Perl and PHP both have functions to handle that.
 


Just to be a security nut, you shouldn't use the encryption functions in 
MySQL at all unless you're always connecting (guaranteed) to the server 
as localhost (and always will be).  You should always do your 
encryption/decryption/hashing in your program and then do the queries 
based on that data.  Download a copy of mcrypt and mhash and you'll see 
that they're quite easy to use.  openssl is another option if you feel 
so inclined.

For example:

$pass = ...;
$pass_md5 = md5sum($pass);
mysql_query('update users set password = $pass_md5 where id = $id');

or

$res = mysql_query('select password from users where id = $id');
$row = mysql_fetch_array($res);
if ($row['password'] != $pass_md5) die(Bad password);

This way, the data going over the MySQL link is already secure before it 
goes over your network or leaves your program.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: bandwidth, etc.

2003-02-16 Thread Michael T. Babcock
Paul DuBois wrote something vaguely resembling a message about SQL and QUERY:



Bandwidth may appear to be adequate, but it seem to me like the 
network is
where you want to look to find the latency problems.
 



To follow up on that, set up something like RRDTool on the network (or 
get someone to do it) and measure your actual bandwidth usage; you may 
be surprised.  Cross-reference with a ping log (also done with RRDTool 
on my machines) to see if its a latency or bandwidth cap issue.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: CREATE INDEX is sooo slow! any ideas?

2003-02-16 Thread Michael T. Babcock
At 06:27 PM 2/16/2003 -0500, Peter Grigor wrote:


Well, MySql stores all its index information in one index file, so 
when you
add another index it has to rebuild the WHOLE file. :)



Anyone on the MySQL team feel like explaining that design decision, 
besides historical reasons?  I doubt its any more efficient except in 
file descriptor usage (although I've expressed the same doubts about 
InnoDB's avoidance of the filesystem too).

SQL and all that ...

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Row numbers

2003-02-14 Thread Michael T. Babcock
On Thu, Feb 13, 2003 at 03:52:18PM -0800, Steve Edberg wrote:
 That means no field exists or should exist in the database. I only want to 
 generate at query time.
 I can't use an autoincrement field since that wont work very well with 
 results that are returned out of order and maybe not with all the data.
 
 Using variables is the best response to my question. I just dislike using 
 them cause they are ugly to work with because of the session persistance 
 and because I have to issue multiple queries to do the job.

If the value isn't being used to even select a row, why not wrap the lines
with OL...results.../OL or perhaps just use PHP/Perl/? to do an $i++ for
display?

Why put this in the query at all, if it has nothing to do with the data?
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
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 book TOC

2003-02-11 Thread Michael T. Babcock
On Sat, Feb 08, 2003 at 10:47:55PM -0800, Nasser Ossareh wrote:
 
 SQL in the What is SQL? phrase threw me... I thought
 you were talking about MS SQL..

SQL is and should be known as a query language, not a product.
It should be perhaps clarified the first time it is used as
not refering to the Microsoft SQL Server product often mis-
named as 'SQL' itself (by people who don't know what SQL is).

 If I were you, I would explain relational databases
 and normalization (at list to normal form III).

Very well described by many other books; especially Oracle
certification books.

-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
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: Robot Replies (WAS: Re: support question (win98_se) (auto))

2003-02-11 Thread Michael T. Babcock
On Sun, Feb 09, 2003 at 03:11:54PM -0700, Doug Thompson wrote:
 Am I the only one that equates these robot replies with spam?  Most of
 them are as meaningful as talking to micro$oft.

I don't know why they're sent to the list and not to the Sender address.

 
  * http://www.mysql.com/doc/en/Business_Services_Support.html
  * http://www.mysql.com/doc/en/Which_OS.html
  * http://www.mysql.com/doc/en/MySQL_licenses.html
  * http://www.mysql.com/doc/en/Support.html
  * http://www.mysql.com/doc/en/Languages.html
 
 This was an automated response to your email 'support question (win98_se)'.
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
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: IP Addresses -- How to Store

2003-02-11 Thread Michael T. Babcock
On Tue, Feb 11, 2003 at 01:15:01PM -0500, Aaron Conaway wrote:
 I'm looking to develop a database of IP addresses for the company and
 have, of course, chosen mySQL as the backend.  I want the app to add
 (remove, etc.) a host, giving its hostname and segment.  The app will
 add the next available address to the database and, looking at the
 segment, provide the subnet mask and default gateway for said new host.
 I've got the db structure written out, but I'm having issues on how to
 store the data like address, subnet mask, default gateway.

Consider familiarizing yourself with bit-level network masking
math and then store your IP addresses as 16 bit long integer
values (until you're storing ipv6 addresses, of course).  Store
your network mask as either the 16 bit value of the mask or if
you care about space, a tinyint of how many bits are in the mask.
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
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: IP Addresses -- How to Store

2003-02-11 Thread Michael T. Babcock
On Tue, Feb 11, 2003 at 03:34:52PM -0500, Peter Grigor wrote:
 Dood, he's not gonna be very happy storing an IP as 16 bits :)
 
Excuse my long day; 32 bits would be much more useful.
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, SQL)
http://www.fibrespeed.net/~mbabcock/

-
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: sex vs. gender or conciseness and accuracy in English text

2003-02-10 Thread Michael T. Babcock
Paul DuBois wrote:


I won't. It's silly to switch terms when the sentence has already been
reworded. The original post was based on an old version of the manual.

Gender is more correctly used for behavior or culture, not biology.



I hate to dissapoint you, but according to dictionary.com at least, they 
are exactly equivalent. In fact, definition 3.a) is The condition of 
being female or male; sex.

Gender is a much less loaded term and for that reason alone should be 
used in place of 'sex' for any such occurrence in public documentation. 
For the sake of non-native English readers, gender is also much more 
obvious in meaning as the nuances of the meaning of the overused word 
'sex' can be difficult to distinguish.

There are, incidentally, 7 entries for 'gender' on dictionary.com and 11 
for 'sex'. Which word has more obvious usage is somewhat clearer right 
there; using the more concise term should always be a goal of a good 
writer. Also note that defintinition 3 for 'sex' mentions The condition 
or character of being female or male; the physiological, functional, and 
psychological differences that distinguish the female and the male. See 
Usage Note at gender http://dictionary.reference.com/search?q=gender.

I think 'sex' was poorly chosen in the first place and the fact that the 
documentation was already reworded once is partial proof of that. The 
reuse of 'sex' instead of 'gender' isn't my fault, and I suggest it be 
reworded _again_ to use the more correct term 'gender'.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd. SQL
http://www.fibrespeed.net/~mbabcock



-
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: [OT] Gender, Sex, political correctness (and age?)

2003-02-10 Thread Michael T. Babcock
Andrew Braithwaite wrote:


When I first read the phrase in question it made perfect sense in the
context in which it was written.



The fact that it made sense to you is somewhat irrelevant to whether it 
made sense to the complainant(s).

mysql UPDATE persondata SET age=age*2, age=age+1;

Removed because it's ageist and therefore branded as non politically correct
and subsequently binned?
 


You seem to have a hard time distinguishing between valid complaints of 
usage and invalid ones.  How, may I ask, is the use of age = age + 1 
supposed to be politically incorrect?  The fact that an unspecified 
individuals' age has increased by a year is not a matter of political 
incorrectness by any definition or from any angle.  You can't even spin 
that to look politically incorrect if you were the type to do such a 
thing.  Obviously you believe that the very mention of something that is 
remotely linked to something politically incorrect makes the former 
worthy of mention, but this is not the case for those who are in fact 
concerned about not being offensive.

I've never pushed anyone to say 'person-hole cover' or 'person-made' or 
even told someone to avoid referring to one's actions as 'maternal' when 
being caring.  I do however see the potential for confusion in the 'sex' 
case, especially when it is so _simple_ to change it to 'gender'.  You 
cannot argue against the use of 'gender' in this case (although Paul 
made an admirable attempt to do so) and there is no meaning lost by 
doing so (and therefore no reason _not_ to do it, except sheer laziness, 
of which most of us are probably guilty).

My appologies for spamming the list with this drivel.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd. SQL
http://www.fibrespeed.net/~mbabcock



-
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 IMAP Server

2003-02-09 Thread Michael T. Babcock
Ben Clewett wrote:


I was rather trying to find an IMAP server using MySQL.  Ie, somewhere 
to store my millions of email messages, from many execlent mailing 
lists, and get at them fast...


What you want is the Courier-IMAP mail server which uses the Maildir 
format to store its messages, running on ReiserFS.

Maildir is a one file per message storage format for more reliability 
and faster message finding because of ReiserFS which uses very fast 
B+-type tree searching of filenames.

See http://www.inter7.com for more information.

(This is what I use, and I have hundreds of thousands of E-mails in IMAP 
format, some of my clients, using the same servers have gigabytes of 
E-mails stored this way and find it to be faster than local storage).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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 my English or does this sound bad?

2003-02-08 Thread Michael T. Babcock
Zak Greant wrote:


 Heh. There are still some gems like this in the manual.:)

 I have let our documentation team know about the awkward wording.
 


Just use the term gender instead of sex and everyone will be happy :-)

(Esp. the people searching for 'animal sex' on Google ...)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd. SQL.
http://www.fibrespeed.net/~mbabcock



-
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 limitations

2003-02-08 Thread Michael T. Babcock
Martin Hudec wrote:


I would like to know what are limitations for mysql in number of records, size 
of records, size of tables etc.
 


Check the free online user-commented manual first, ask any questions you 
still have afterward.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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



Replication comment

2003-02-08 Thread Michael T. Babcock
Just out of comment ... couldn't (shouldn't?) MySQL's replication been 
set up as a seperate process altogether from the server process? 
Replication *could* be done in its present form (afaict) by running 
something like:

tail --follow=name --retry -n0 query_log | grep -v SELECT | mysql 
{servername}

Correct?

If setting up a semi-automated version of this pipe is all it requires 
to do replication (a few greps and pipes), then writing such a program 
would allow for multi-to-multi replication (for example).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: interface to python?

2003-02-02 Thread Michael T. Babcock
I use MySQL-python (use freshmeat to find it).

I've written my own class to use around it which looks a lot like:

class MyDBClass:
   def __init__(self):
   self.db = None
   self.dbname, self.user, self.passwd = None, None, None

   def connect(self, user = , passwd = , dbname = ):
   Connect to the database

   # Allow overrides during connect call:
   if user: self.user = user
   if passwd: self.passwd = passwd
   if dbname: self.dbname = dbname

   # Make sure the info is valid
   if not self.user or not self.passwd:
   raise MyDBExcept()

   if not self.dbname:
   self.db = MySQLdb.connect(user=self.user, 
passwd=self.passwd)
   else:
   self.db = MySQLdb.connect(user=self.user, 
passwd=self.passwd, db=self.dbna
me)

   def doquery(self, QUERY, DEBUG = 0):
   Run the query against the database

   if not self.db:
   return (-1, None)

   if DEBUG:
   print QUERY + ;

   cursor = self.db.cursor()
   try:
   count = cursor.execute(QUERY)
   except IntegrityError:
   count = 0

   if not count:
#   print No results for  + QUERY
   return (0, None)
   results = cursor.fetchall()
   return (count, results)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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



Changing InnoDB files

2003-01-23 Thread Michael T. Babcock
As the person who's asking a question and just had it rejected twice, 
here it is again ... sql, query, blah, blah.

I have three InnoDB data files that I've created as time has gone on; 
100M, 250M and 1G (autoextend).  I would like to create a new data file 
on a new raid partition and make it autoextend instead of the current 
one.  How do I properly set the size on the current file so that it has 
no problems if I remove the autoextend keyword, or is this not.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: mysqlstat (WAS Re: Optimizing Ext3 for MySQL)

2003-01-23 Thread Michael T. Babcock
Jeremy Zawodny wrote:


Now, I just have to remember to push out mytop 1.3 so that folks can
shake out any new bugs I've introduced...
 


Just make it one binary that recognizes its argv[0] calling (like gzip) 
and also supports command-line options.  The two data collection methods 
are the same ... so you might as well have essentially `alias mysqlstat 
$x='mytop --vmstat=$x'` (yes, I know that's not valid bash symantics).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: ReiserFS vs Ext3

2003-01-22 Thread Michael T. Babcock
Nicholas Gaugler wrote:


said that ReiserFS handled large amounts of files much better than ext2 or ext, but what about a MySQL database situation with a very limited numbers of files.  Such as 300, or less than 100 even?  Is Reiser a better FS than ext3 for MySQL when you have a very limited number of files, and when the files are larger in size, such as 2-3GB each?  Or is there not much
 


I would E-mail the reiserfs list and ask for whether ReiserFS would be 
better for a MySQL-only partition than ext3 and see what answers you 
get.  In the worst case, you'll have some extreme resierfs is always 
better responses that don't help you decide.  In the best (and what I 
think will happen), someone will tell you the differences in CPU usage 
or fast file access speeds or some such value that will mean something, 
or even that it is not actually going to make a difference.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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 joins are slow things to deal with. . .

2003-01-22 Thread Michael T. Babcock
Steve Quezadas wrote:


PS Here is some information about my tables and indexes:



Maybe I missed it, but where's the EXPLAIN on the JOIN query?

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Rank Amateur Back for More

2003-01-22 Thread Michael T. Babcock
Stephen Tiano wrote:


Observation: I guess there's no way to just give myself a 'free pass' 
to be able to load data into any database. It appears I have to name a 
particular database right at the start. 


A database is a database; there is nothing _outside_ a database.  If you 
load the mysql shell without specifying a database, you are in limbo.

What's up with that? I checked the folder 'menagerie' in the Sites 
folder. pet.txt is most definitely there, and it contains comma 
delimited rows to go with the tutorial table I'm working at.


LOAD DATA is executed by the server, therefore within the server's 
directory namespace.

Please read http://www.mysql.com/doc/en/LOAD_DATA.html

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: ReiserFS vs Ext3

2003-01-22 Thread Michael T. Babcock
David Brodbeck wrote:


If Nicholas does this, I hope he'll report back here with what he finds out.



I would recommend that as well.


I'm facing the same choice very soon, for a database that will eventually have millions of entries (but each individual entry very small.)  I'm trying to decide whether to go with reiserfs or ext3.  ext3's my current favorite, but only because it's more of a known, stable quantity.



If I may cause a flame-war here (j/k), reiserfs is a very known, very 
stable quantity.  I've been using reiserfs for years now and it has 
never failed me except in the case of a physical drive failure (and it 
still saved me most of my files).  Reiserfs is _very_ fast compared with 
the ext filesystems; I can't imagine running my /home and /var 
partitions on anything else ever again (and the rest are ext3 only 
because the RedHat installer wouldn't do reiserfs during the install).

For what its worth, reiser4 (the new version of reiserfs that seems 
almost complete) as well as a patched version of reiserfs (version 3) 
have hooks in them to allow software (currently Squid) to use the 
internal tree and storage routines and bypass the filesystem layer 
altogether.  This would make a lot of sense for a program like the mysql 
daemon (much as InnoDB probably does for its raw storage already) and 
I'd be very interested in the speed with which InnoDB can open and find 
records vs. the tree structure speeds in reiser4.  Reiser4 is also 
supposed to have full filesystem transaction support, which is a great 
feature for databases in the first place.

If you want an idea of how ReiserFS is built to work, you'd probably 
(untested) get quite good performance (for a specific group of test 
cases) out of writing a MySQL backend that stored tables as directories 
under their database directories with row values as files under row 
directories, with directories named by their primary index values 
(randomly otherwise?).  It would make an interesting project at any rate.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Mandatory server downtime?

2003-01-22 Thread Michael T. Babcock
David T-G wrote:


 - do you have redundant networking to my machine, both to handle a
   failed switch and a backhoe accident?



... and do you have the ability to get such incidents repaired quickly 
... our one upstream ISP had their entire fibre bundle torn out of the 
ground by a construction crew and had the entire bundle spliced back 
together the same day (6 hours).  I almost poured coffee on myself when 
they called to say it was back online.

Speaking of which -- find out what networks they're connected to and 
check those companies' current SEC filings :-)

 - do you store your tapes in a disaster-proof facility?



... and who is responsible for doing so, and calculate how far back this 
means you have to go.  If they move tapes to another site every night, 
it may still mean a 48 hour rollback in the case of a flood or fire, 
depending on how tapes are handled.

PS, there's no reason not to buy cheap space at another ISP that allows 
SSH and simply run a secure tunnel to your primary ISP and run it as a 
replication client to save your MySQL data.  I'm sure David, myself or 
any other ISP person in this list would be happy to quote you on such a job.

 - what is your expected restore time for a file or db table on my
   machine?
 - what is your expected recovery time for a complete disaster on my
   machine?



I have a client who cancelled their support contract with us and still 
does their regular backups but has absolutely no-one on staff who knows 
how to do a proper restore.  Don't be in that situation.  (We'd do one 
if they paid us, of course ...)

and go from there; if any of the answers don't sound right, then ask more questions about that topic.



If they tell you its a stupid question, that's another good hint :-)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Unicode

2003-01-22 Thread Michael T. Babcock
Michelle de Beer wrote:


3) I read some of the things on unicode.org, but this
is only the pros. Is there any cons for using unicode?
When should I use it?
 


If you do primarily english but want other language support, UTF-8 is 
_exactly_ the same as ASCII for the first 127 characters.  If you store 
UTF-8 in binary fields you're fine -- and you can compare and sort it 
properly, since its in proper language search order for the most part 
already (accents and combination characters excluded).  Full Unicode 
support in MySQL will best be described by the team, but will probably 
just mean that it knows how to combine characters for comparisons and 
sorting.

Hopefully, they support UTF-8 and not just UCS-16 (like Microsoft does). 
UCS-16 is more efficient for storage but its a pain to rewrite code to 
use it (I convert to UTF-8 immediately for internal processing and any 
I/O I do in Unicode.  UCS-16 is useful for storing the data on disk in 
only specific circumstances; like a database).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Optimizing Ext3 for MySQL

2003-01-22 Thread Michael T. Babcock
Steven Roussey wrote:


Might also look at:
  vmstat 1
 


`vmstat 1` is my favorite instant-info server debugging tool.  I 
wouldn't mind the same program for MySQL (where's that mytop author 
anyhow? j/k)

Blocked processes (second column) is a very useful piece of info too.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: three table join

2003-01-22 Thread Michael T. Babcock
Tab Alleman wrote:


SELECT SomeStuff
FROM Table1 AS T1
LEFT JOIN Table2 AS T2 ON T1.PK = T2.FK1
RIGHT JOIN Table3 AS T3 ON T2.FK2 = T3.PK
WHERE T1.PK=999
 


Either right-join it or reverse the table order (because you're not 
asking for data from t1 that is like t2 that is like t3 that is like 
999, you're asking for data from t3 which has data ... in t2 which has 
data ... in t1 which has pk 999

You have to think of the queries 'in order', left to right ... so that 
your LEFT join means what it should mean :).  I rarely do right joins in 
small queries; it makes more sense to just reverse the query.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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 Secure Replication

2003-01-22 Thread Michael T. Babcock
Ivan Hoo wrote:


how do you secure the replication link between the master  and the slave
using SSH. i understand that you can do that over mysql client and its
server. pls enlighten me coz i m looking high and low for a solution on this issue.
 


On the slave:

ssh --local-forward(?) 3307:localhost:3306 foreignhost

...then set up the info for master (on the slave) to be localhost:3307.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Mandatory server downtime?

2003-01-21 Thread Michael T. Babcock
David T-G wrote:


Hmmm...  Speaking as a SysAdmin, that looks like a cover-all-bases
general announcement.



I was going to say the same thing; its always good (legally) to say you 
might be down, instead of doing it and having people sue you.

Indeed.  If your provider is going to take down your web site on a daily
basis, you may need to find another provider [...] We do hot backups of mysql with no down time.  Drop me a note if you'd like more info on how to switch to us.



Ditto ;-)

For what its worth, sites like http://www.findsp.com will help you 
search for ISPs that support various features like MySQL.  Just talk to 
the techs responsible for MySQL at your ISP (they have at least one, 
right?) and ask if they pay for support (helps if they have a problem; 
but I'm in a glass house here -- we don't yet) and how they do the backups.

No, it doesn't; one can use mysqlhotcopy, a filesystem copy, a slave
server, or backup software smart enough to quickly lock things as it
reads a table -- just to name a few of the *many* possibilities and
permutations thereof.



Depending on server load, it may be more reasonable to shut down MySQL 
or at least lock it solid with table locks before doing a backup to get 
it over with, but backing up from a replication client is much smarter, 
imho.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Joins are damn slow. . .

2003-01-21 Thread Michael T. Babcock
Steve Quezadas wrote:


However. I notice that if I do two separate searches it goes quicker 
(about 2.5 seconds combined). I can do a criteria search on defendants 
and then put all the resulting case numbers in a temporary table. Then 
do a join of that temporary table to the much smaller Cases table and 
do a search on that. I get the same results, and the query time is 
halved.


Do an explain on all those queries, post the output here and the time it 
took to run the queries.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Mandatory server downtime?

2003-01-21 Thread Michael T. Babcock
Clemente wrote:


The question is then whether such backup is necessary on a daily basis



I run incremental tapes hourly at some client locations.  You may only 
need weekly backups.  If the server room filled with water tomorrow and 
you had to return to your last backup, when do you want that backup to 
be from?

find this kind of detailed technical information from hosting companies to be able to choose one with a good quality/price ratio.
 


Call them, say you've got a problem with MySQL you need to talk to a 
tech person about and talk to whoever you get about what's been 
discussed here.  Ask if they're on the list :).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: innodb foreign keys problem

2003-01-16 Thread Michael T. Babcock
Heikki Tuuri wrote:


In the future, MySQL might do the following: in

CREATE TABLE abbaguu (
...
FOREIGN KEY (column1) REFERENCES frobboz (column2)
) TYPE=InnoDB;

it could check if there is a suitable index in abbaguu. If not, it would
create the index automatically.
 


For what its worth, and I'm sure you've considered this, at least table 
creation is a semi-rare enough event in the life and activity of the 
average database that adding more overhead to the process wouldn't 
affect much.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: three table join

2003-01-15 Thread Michael T. Babcock
I've wanted to post this query example a few times (and I hope I got it 
right; mornings aren't my best time) ... multiple JOINs:

SELECT stuff
  FROM table1
 LEFT JOIN table2
ON table1.fk = table2.pk
 LEFT JOIN table3
ON table2.fk = table3.pk
 WHERE other_conditions
   ...

You can repeat that as many levels as you want (performance depends on 
indexing and the optimizer).  You need to think in terms of what would 
be equal to what between tables in the correct result row.  So if you 
would do a secondary sub-select of SELECT fk from table2 where ... 
then you end up with a left join like above.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: when to normalize out to a table

2003-01-15 Thread Michael T. Babcock
Cal Evans wrote:


Always start with a *fully* normalized design. You can always denormalize for speed but it's real hard to normalize once you are in production.
 


I'd rather be 'stupid' about how normalized my data is and then write 
caching into my program (or use MySQL 4's query cache, which I don't 
have yet) than have to extract data properly after the fact for 
normalization.

Reading any old website about normalization will say basically the same 
thing (and if they don't, they shouldn't be writing about normalization).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Linux Mysql vs Windows Mysql

2003-01-15 Thread Michael T. Babcock
Jeremy Zawodny wrote:


Add error checking to all MySQL API calls and the problem will become
apparent.  Right now you're assuming they all just work (except for
the mysql_connect()) but they probably don't.
 


I highly recommend anyone using MySQL use either AdoDB 
http://php.weblogs.com/adodb or write their own handler (wrapper) 
functions around the MySQL library calls.  Most of my code uses 
something that looks like:

$Vehicles = db_get_vehicles($Params);
meta_show_vehicles($Vehicles, $Format);

... where db_get_vehicles might do something like:

if (!($Params = sql_check_params($Params))) return -1;
list ($rows, $error) = sql_do_query(SELECT ... FROM Vehicles LEFT JOIN 
... WHERE $Params);
...
return $rows;

I worry about connecting, doing the actual query once connected and 
error checking in sql_do_query, so my main code looks clean(er).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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 Secure Replication

2003-01-15 Thread Michael T. Babcock
Jeremy Zawodny wrote:


there seem to be a lack of documentation on this part.
   


Mostly because it can't be done (that I'm aware of).
 


Except with stunnel (often recommended) or SSH (which I've had running 
for months doing this).  PS, as with the MySQL daemon, I run my ssh 
tunnel under 'supervise' so as to make sure its always there and 
restarts if it gets killed / dies / is stupid / upgraded.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: InnoDB table, NOT NULL question

2003-01-15 Thread Michael T. Babcock
Harald Fuchs wrote:


You _did_ enter some data, namely a string which just happens to be
the empty string (which in turn is different from no data, i.e. NULL).
How should MySQL know that you don't want empty strings?
 


I think the user expects:

INSERT INTO table (bar) VALUES (text);
to behave the same as:
INSERT INTO table (foo, bar) VALUES (NULL, text);
which would throw an error (correctly).

No comment ;-)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Removing users

2003-01-13 Thread Michael T. Babcock
[EMAIL PROTECTED] wrote:


I've read the manual concerning REVOKE commands but how would I
completely remove a user inside MySQL? I can't imagine that it's as easy
as removing them from the user table.
 


If you remove them (or blank their password) in the user table, they'll 
have no way of logging in, since MySQL won't be able to authenticate them.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Perl vs. PHP with MySQL - performance?

2003-01-13 Thread Michael T. Babcock
Angel Flow wrote:


Would like to ask people's thoughts on whether Perl or
PHP has higher performance with MySQL. I've heard
rumours that DBI is slower than the PHP MySQL driver.
 


I would say that comparing DBI to ADODB is more appropriate; PHP more or 
less directly calls the mysql C library functions whereas PERL actually 
does some additional work in there.  In PERL's case, its probably a 
similar code distance to just do a single executed query and return an 
array of results as it is in PHP though.  I'd benchmark it to be sure 
though.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock




-
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: take one database offline

2003-01-13 Thread Michael T. Babcock
Stephen Brownlow wrote:


You can make backup of the database and then drop the database..
Why do you want to do it?
   


When maintenance is necessary, it would be far better to be able to:
1. turn off one database,
2. use myisamchk, Unix or other applications to adjust it in any way,
3. turn it back on.
 


I must second that request, although someone else pointed out that using 
a LOCK FOR UPDATE would work as well since no processes would be able to 
touch the database during the lock.

As long as the MySQL team thinks thats a safe way to handle things, and 
is willing to make sure it keeps working that way safely, I'd say we 
already have a solution though.

Oh yeah, without the words SQL or QUERY, this message would be spam.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock




-
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: converting text to hypertext

2003-01-13 Thread Michael T. Babcock
Rodney Broom wrote:


If so, then the answer is that there isn't such a data type. If you want a link, then you'll have to make it yourself. I suggest making your column a varchar(). Then, you ~might~ get the data with a query like this:

 SELECT CONCAT(CONCAT('a href=', link, ''), link, '/a') FROM stuff;
 


But please remember, as was said earlier, to use the appropriate 
escaping functions for your language to make sure link contains no 
special HTML characters in the second instance and no URL characters in 
the first.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock




-
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 backend for mailing list

2003-01-13 Thread Michael T. Babcock
Mike wrote:


I'm making a library website where users can store preferences about the
types of books/cds/etc... they like (e.g. romance, rock, cooking, 
etc).
Once a month the list of 'New Releases' is updated. Currently there is 
a New
Release box which shows releases based on the users preferences.


This type of functionality is the responsibility of your program, not 
the MySQL backend.  MS SQL Server may offer this option, but MySQL does 
not and there are thousands of programs and libraries you can use to do 
this very simply.

Please consider going to freshmeat.net or whatever your favorite search 
for programs I want search engine is and search for Send E-mail.

If you were using PERL, there are several libraries available.  In PHP, 
its built-in.  With C or C++ I'm sure you could find one but I wrote my 
own, and in a *nix shell script, you can do something like:

#!/bin/sh
cat $message | sendmail [EMAIL PROTECTED]

Look up how E-mail messages are formatted (its text; do a view source on 
this message, for an example) and you're probably home-free.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock




-
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: Book recomendations

2003-01-13 Thread Michael T. Babcock
Matthew K. Gold wrote:


I agre with the DuBois recommendation.  I have a couple of quibbles, but
overall, I think it's a great book (and I did a pretty exhaustive check when
I was first learning mysql.
 


Of course, if you want a generic how-to on designing databases or SQL 
itself, there are an even larger list of books to consider.  The ones I 
found most helpful initially were the Oracle certification course books.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock




-
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 startup (FYI)

2003-01-10 Thread Michael T. Babcock
Just for the sake of showing what we do, here's our setup for MySQL at 
all our sites.

We use Dan Bernstein's daemontools package to monitor all our services, 
MySQL included.  You can download and install them easily from 
http://cr.yp.to/daemontools.html.  They won't touch your system files 
except by adding a line (by default) to your /etc/inittab to start 
svscan, the service starter.

Having this installed and working, we create a /var/mysql/service 
directory and /var/mysql/service/log.

/var/mysql/service/log/run is an executable file containing one line to 
log all output with nanosecond timestamps to a file: exec setuidgid 
logging multilog t /var/log/mysql/

/var/mysql/service/run contains a shell script to start mysqld:

#!/bin/sh

sleep 2 # To make `mysqladmin shutdown` work properly

exec 21
exec envdir ./env /usr/bin/safe_mysqld \
   --log-slow-queries=/var/log/mysql/slow_queries \
   --log-bin=/var/log/mysql/transactions \
   --log=/var/log/mysql/queries
{eof}

We're using `envdir` to empty and initialize the environment so 
/var/mysql/service/env contains one file for each environment variable 
to be set, including PATH, TMPDIR, TZ, UMASK and UMASK_DIR.

After the directories are all set up and the `run` files are executable, 
simply:
$ cd /service
$ ln -s /var/mysql/service mysqld
... and the MySQL service will start up, monitored by supervise and 
restarted automatically if killed (after the two second sleep in the run 
file).  The sleep is there to stop respawns from being too fast and to 
keep from confusing mysqladmin; when you do mysqladmin shutdown, it gets 
confused if mysqld starts back up too soon (thinking it didn't shut down 
yet I suppose).

Just FYI ... :-)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd. (sql)
http://www.fibrespeed.net/~mbabcock



-
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: logrotate problem with mysql

2003-01-10 Thread Michael T. Babcock
Jiann-Ming Su wrote:


   if test -n `ps acx|grep mysqld`; then
   /usr/bin/mysqladmin flush-logs
   fi
 


You're probably running it as root with the password loading from the 
/root/.my.cnf or something.  Try adding the -uroot -p command-line 
options, or a [mysqladmin] section to your ~root/.my.cnf file.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: relations between tables

2003-01-10 Thread Michael T. Babcock
Octavian Rasnita wrote:


Is MySQL able (like MS Access) to define permanent relations between tables?

For example, I want to define a master - child relation between 2 tables so
when deleting some entries from the master table to automaticly delete the
entries from the details table without specifying this in the query.
 


Search for REFERENCES in the MySQL manual; it only applies to InnoDB 
type tables though.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: converting text to hypertext

2003-01-09 Thread Michael T. Babcock
Rick Tucker wrote:


This is the code I'm using.  I'm pretty new to PHP, so there may be a simple
solution within PHP of which I'm unaware.  I just thought it could be done
from the MySQL side of things.



I think the point is more that there's no reason to have MySQL do it at 
all since the logic is specific to what you're doing.

$resultID = mysql_query(SELECT * FROM ports, $linkID);

print tabletrthPort #/th;
print thTransport/thth align=centerApplication/thth
align=centerRFC/Vendor's URL/MS KB article/th;

while ($row = mysql_fetch_row($resultID))
{
print tr;
foreach ($row as $field)
{
print td align=center$field/td;
}
print /tr;
}
print /table;
mysql_close ($linkID);
 


If these fields are intended to be URIs, try something like (I didn't 
check my PHP function names; look them up first):

function LinkURI($URI)
{
   $HREF = urlencode($URI);
   $Text = htmlentities($URI);
   return a href=\$HREF\$Text/a;
}

print td align=center.LinkURI($field)./td;

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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 Database Design

2003-01-09 Thread Michael T. Babcock
Colaluca, Brian wrote:


I have come to a brick wall on one facet of my design, however.  I've come
to understand that having a lot of NULLs in your database may be a sign of a
poor design.  And yet I'm having a problem reconciling this with the wildly
un-uniform world of wines from around the world.  For instance, I would like
to have a table called GrapeVariety, and have the variety_id be a primary
key.  Another table would be Wine.  And yet, one wine could have one type
of grape or more. 
 


Just an idea ... to get your head spinning (and some sample queries):

Wine
-
ID int unsigned not null auto_increment primary key,
Name ...
Winery ...

Grapes
-
ID int unsigned not null auto_increment primary key,
Name ...
Vineyard? ...

GrapesInWine
-
WineID int unsigned not null,
GrapesID int unsigned not null,
Percentage int unsigned not null

... where Percentage is between 0 and 100.

Then you can, to insert a wine named Foo with 50% of each Grape1 and 
Grape2:

INSERT INTO Wine (Name) VALUES (Foo);
SELECT @WinesID := last_insert_id();# I'm using server 
variables here for the sake of demo ...
INSERT INTO Grapes (Name) VALUES (Grape1);
SELECT @GrapesID := last_insert_id();
INSERT INTO GrapesInWine (WineID, GrapesID, Percent) VALUES (@WinesID, 
@GrapesID, 50);
INSERT INTO Grapes (Name) VALUES (Grape2);
SELECT @GrapesID := last_insert_id();
INSERT INTO GrapesInWine (WineID, GrapesID, Percent) VALUES (@WineID, 
@GrapesID, 50);

Then, to find out what's in the wine named Foo:

SELECT * FROM Grapes
   LEFT JOIN GrapesInWine
  ON Grapes.ID = GrapesID
   LEFT JOIN Wine
  ON WinesID = Wine.ID
   WHERE Wine.Name = Foo;

Or, to find the amounts of Grape1 in all wines:

SELECT * FROM Wine
   LEFT JOIN GrapesInWine
  ON WineID = Wine.ID
   LEFT JOIN Grapes
  ON Grapes.ID = GrapesID
   WHERE Grapes.Name = Grape1;

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Autonum broken

2003-01-06 Thread Michael T. Babcock
John Morrison wrote:


In the interests of better normalisation I decided to divide one table's data 
between two tables.  So I created another table and copied selected rows into 
it.
 


I'd love to know how you believe that copying rows to another table is 
better for normalization.  If you mean that you moved columns to a new 
table, then it makes sense; but rows?  Where you getting bad query 
response time?

Just curious.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: [OT] Palestine

2003-01-06 Thread Michael T. Babcock
Sam Przyswa wrote:


Yes I know, his name is PLO, and in this case Palestine is not a country but a
terrorist organisation.



Palestine is a name given to the region in which Israel currently has 
governing authority.  It was recognized by the romans, and other 
occupying governments before that.  Much as Canada sits on North 
America, but isn't America, Israel sits on Palestine.

3) Israel is the only one democratic country in middle east where catholics,
muslems, jewish, can leave together instead of yours where jewish, catholics, are
killed as in Islamic Republic of Soudan, Irak, Syria, etc.



This is true enough; and Israel (and the US) are pushing for the 
Palestinian aurhority to have elections for a new leadership.  The 
current Palestinian authority was actually enabled by Israel in the 
early 80's (1984?) and given weapons (by Israel) to allow the 
Palestinian people self-governance within Israel's territory, and 
perhaps have their own land at a later time.  This didn't go so well 
(obviously).  Anyone in favor of Palestinians having their own land 
should not stop being angry at Israel, but should push for a strong 
government to further their interests.  In this case, politics is 
everything and terrorism is bad politics.

Also worth noting is that I don't believe most Palestinians or Israelies 
care if they do or don't have their own land, but simply their own 
government to represent their interests, the ability to move freely 
within the land (no more checkpoints) and the ability to work and live a 
'free' life.  You have to choose your goals properly (much like SQL 
design) before taking the first steps.  If self-governance is a goal, 
get good leaders.

--
Michael T. Babcock (no, I'm not a sympathizer to either side)
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: LEFT JOIN function locking up when using large database

2003-01-06 Thread Michael T. Babcock
Rob Taft wrote:


I have 2 tables, one with 1,000 entries, the other with 10,000 entries. I'll
call these table1 and table2. The query uses both tables:

SELECT something to select FROM table1 LEFT JOIN table2 ON (table1.ID =
table2.table1_ID) WHERE some condition;
 


Do you have indexes on these?

alter table2 add index table1_id_idx(table1_ID);

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: user updates trace

2003-01-03 Thread Michael T. Babcock
Egor Egorov wrote:


... i mean ... in my database i have a lot of users
with different privileges.
what i need is to reach all the insert, update and
delete queries executed by one user.
is it possible?
   


Nope.
 


A good question might be whether the TODO includes auditing of this 
kind.  That is, adding the username to the comments in the binary update 
log (and other logs).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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 MySQL is

2003-01-03 Thread Michael T. Babcock
Suggestion page: What MySQL is; layman style (unless one exists I 
haven't seen).

Something like:
MySQL is a back-end database program.  It stores data for your programs 
and allows you to interface with that data using SQL commands (see 
reference manual).  MySQL has a command-line interface program (CLI) 
called 'mysql' [ed. note: source of confusion?] that allows commands to 
be typed in directly and executed immediately.  If you are only familiar 
with visual database tools like Access, Paradox, etc. then you may find 
MySQL daunting.  Consider downloading a visual front end program (see 
downloads / links page) as you learn SQL.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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



Info: Using MySQL as Mutex

2003-01-03 Thread Michael T. Babcock
Just as an FYI to fellow developpers out there (feeling generous today):

How many times have you written a semaphore locking system for your 
programs and worried they weren't thread-safe, or wished you didn't have 
to?  Well, if you're feeling especially lazy (as I often do) and you 
have MySQL on hand, try using its locking features instead of writing 
your own (especially if your program already involves MySQL).  Connect 
to MySQL [this assumes you're using InnoDB/BDB], do a BEGIN and try to 
UPDATE a row in a locks table for your mutex (UPDATE Locks SET Holder = 
me WHERE Name = ThreadMutex4) and do your work.  MySQL will block 
the UPDATE until the previous thread (if any) rolls back or commits its 
transaction.

Any thoughts / technical comments? (I just started doing this in a large 
internal log tracking project that does, in fact, use MySQL) :-)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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



ARGH! :) [OT]

2003-01-02 Thread Michael T. Babcock


 Original Message 
Received: (qmail 24061 invoked from network); 2 Jan 2003 20:14:30 -
Received: from unknown (HELO web.mysql.com) ([EMAIL PROTECTED]) by 
mail.fibrespeed.net with SMTP; 2 Jan 2003 20:14:30 -
Received: (from lists@localhost) by web.mysql.com (8.11.6/8.11.6) id 
h02JEGm29551; Thu, 2 Jan 2003 20:14:16 +0100
Date: Thu, 2 Jan 2003 20:14:16 +0100
Message-Id: [EMAIL PROTECTED]
From: [EMAIL PROTECTED]
To: Michael T. Babcock [EMAIL PROTECTED]
Subject: Re: Re: Using files stored as blob [OT]



Your message cannot be posted because it appears to be either spam or
simply off topic to our filter. To bypass the filter you must include
one of the following words in your message:

sql,query,queries,smallint

If you just reply to this message, and include the entire text of it in the
reply, your reply will go through. However, you should
first review the text of the message to make sure it has something to do
with MySQL. Just typing the word MySQL once will be sufficient, for example.

You have written the following:

Tim Best wrote:

/var/tmp//phptkYxkV

I'm not sure where that is but I need to retrieve that file and distribute
it...
 


I'm assuming you're not familiar with *nix systems (as opposed to 
Windows).  This name is the full name of the file with the directories 
(similar to, for example c:\windows\mscdex.exe).  Just open it, as you 
would open any file (http://php.net/fopen comes to mind) and you should 
be fine.  Don't forget to unlink it when you're done.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock





--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: FAQ hosting site [FAQTS.COM]

2003-01-02 Thread Michael T. Babcock
David T-G wrote:


I suppose they might.  Never heard of 'em...

 


Can I strongly suggest there be a link from the MySQL documentation page to:

http://www.faqts.com/knowledge_base/index.phtml/fid/52

It is the MySQL section of FAQTS.com which, IMHO, is the best online FAQ 
site.  It has very good QA's and does a good job of rating them as 
well.  You'll notice that many of the subjects are practically taken 
straight off this list.  

Posting an answer is relatively simple, and all answer posters have 
their information tracked so that all the answers they've given are 
available.  Take a look (please) and I'm in NO way affiliated with this 
site.

For example, How can I make MySQL user friendly, what program can I use 
as an interface at 
http://www.faqts.com/knowledge_base/view.phtml/aid/6588/fid/52 is 
answered with:

If you are looking for a web-based administration program myPHPAdmin is 
great.  You (or your ISP) must be have PHP installed on the server for 
this application to run. 

If you are looking for a language to create your own application 
interface to a mySQL database, PHP is the best choice.

Zachary Kent
-

You can also use MS Access as a front-end. Make your SQL database,
install the MyODBC drivers, and link to the tables from Access. From
there, it's easy to program Access to make update screens, etc. 
Chuck


--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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/Client GUI - Win32 and Linux

2003-01-02 Thread Michael T. Babcock
Nilza Lafayette wrote:


I'm running MySQL onto a Windows Advanced Server. I´m
looking for a good and free admin/client GUI for Win32
and Linux. Can anyone guide me or share with me about
good and free admin/client GUI?
 


There's at least one linked to from the mysql site and several 
mentionned on freshmeat.net.  Searching MySQL admin windows on Google 
should get you quite a few responses as well.

FWIW, this comes up a lot and phpMyAdmin gets mentionned almost as often.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: An Idea

2003-01-02 Thread Michael T. Babcock
R. Hannes Niedner wrote:


Isn't that funny: if I have a mysql related question and search google I end
up in the mysql online documentation in 90%  of cases.
 


I find if I just use the word 'mysql' in my query on Google, I get 
fairly appropriate results too.

Not using the word mysql often gives me generic SQL responses regarding 
many products (often MS SQL Server, since they decided to use the lone 
word 'sql' in its name).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Newbie - Where do I look for answers?

2003-01-02 Thread Michael T. Babcock
B. van Ouwerkerk wrote:


www.google.com
www.mysql.com (the manual)
www.devshed.com --server side -- mysql



Also see http://www.webmonkey.com ... they had a MySQL + PHP tutorial on 
there at one point, specifically targetted to running an Apache + PHP + 
MySQL Linux box for Windows users.  That's probably a good place to look 
as well (just skip to the MySQL bits).

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: filters

2003-01-02 Thread Michael T. Babcock
On Thu, Jan 02, 2003 at 04:06:57PM -0600, Aaron Scribner wrote:
 I am using Eudora and trying to filter these messages.  I set it up to 
 monitor the To: field, however this is not doing anything.  I also 
 noticed that there are no tags in the Subject lines of the messages sent to 
 the list, that is what I usually use to filter messages.
 
FWIW, filtering both TO and CC should do what you want, but more importantly
the messages (as with all ezmlm lists -- search Google for more info on ezmlm)
contains the headers:

Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm (http://www.ezmlm.org)
List-ID: mysql.mysql.com

If Eudora can't filter on arbitrary headers, complain to them frequently.

To be more specific: filter for the List-ID to contain mysql.
-- 
Michael T. Babcock
CTO, FibreSpeed Ltd. (Hosting, Security, Consultation, Database, etc)
http://www.fibrespeed.net/~mbabcock/

-
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: nested transactions?

2002-12-31 Thread Michael T. Babcock
Heikki Tuuri wrote:


Transaction savepoints are already implemented internally inside InnoDB. The
MySQL support for the syntax might come around August 2003. If someone is
willing to sponsor the implementation, they may come quicker.
 


For the sake of those with more programming time than money, what kind 
of theoretical work is required to allow nested transactions?

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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, if anything, is wrong with UNIX Epoch time stamps? [Was:R E: TimeStamp in MySQL reqd NULL]

2002-12-23 Thread Michael T. Babcock
Dana Diederich wrote:


Can anyone share and/or comment about the use of Epoch time, especially the
hazards?  I'm asking because I want to make sure that I haven't built a
comfortable little box that un-necessarily excludes some useful functions.
 


I use Epoch time myself, except where I use TIMESTAMP to record 
last-updated values automatically (and select it with 
UNIX_TIMESTAMP(...) every time.

I personally prefer TAI64 time (sub-second precision; see 
http://cr.yp.to/libtai/tai64.html).  For a comparison of how this 
differs from UNIX time, see http://cr.yp.to/proto/utctai.html at the 
same site.  I'm surprised SQL hasn't been updated to support new time 
formats yet, but oh well.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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, if anything, is wrong with UNIX Epoch time stamps? [Was:R E: TimeStamp in MySQL reqd NULL]

2002-12-23 Thread Michael T. Babcock
Csongor Fagyal wrote:


Oh and one more thing I am not really sure of: sometimes defining the 
day as 3600*24 or the year as 3600*24*365 is not the best idea... just 
think about leap years. How do you handle that? And there are some 
more artifacts in the Gregorian calendar, too...


But MySQL doesn't guarantee correctness in time values in the first 
place.  You can still insert 2002-02-31 as a date if you like:

mysql create table temp (date datetime);   
Query OK, 0 rows affected

mysql insert into temp(date) values (2002-02-31);
Query OK, 1 row affected

mysql select * from temp;
+-+
| date|
+-+
| 2002-02-31 00:00:00 |
+-+
1 row in set

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: [Fwd: Need help revising CREATE TABLE]

2002-12-23 Thread Michael T. Babcock
Gloria L. McMillan wrote:


I recently posted this query and it doesn't seem to be getting any responses.
Is there something important that I left unsaid, making this one tough to
answer or is it, perhaps, not addressed to the right list?
 


I'm sure you could find a full app that already does this if you 
searched sourceforge or freshmeat.net.  FWIW, I'd be tempted to 
normalize your table down to:

Survey
SurveyQuestion
Question
UserQuestionResponse
User

You can try to figure out the rest from there ...

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: SOLVED! (was: Re: What is wrong with this query?)

2002-12-23 Thread Michael T. Babcock


I do not understand why. It seems that the parent exit-ing while the child
is doing stuff, makes the child lose its query to MySQL (always more or less
at the same point). And this is really strange; for the parent has nothing
to do with MySQL. It is the child who makes the connection and does all
queries. So, having the parent linger a bit should have no affect on the
child. Yet it does.
 


I'm not a PERL god, but from C experience, try looking up wait and 
wait on your child instead of just exiting.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd. SQL
http://www.fibrespeed.net/~mbabcock



-
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, if anything, is wrong with UNIX Epoch time stamps? [Was:R E: TimeStamp in MySQL reqd NULL]

2002-12-23 Thread Michael T. Babcock
Csongor Fagyal wrote:


I personally prefer TAI64 time (sub-second precision; see 
http://cr.yp.to/libtai/tai64.html).  For a comparison of how this 
differs from UNIX time, see http://cr.yp.to/proto/utctai.html at the 
same site.  I'm surprised SQL hasn't been updated to support new time 
formats yet, but oh well.


Well, there is BIGINT, isn't there? :-))



TAI64N sub-second precision is 64 bits for the integer and 64 bits for 
the floating-point value ... :)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Can MySQL handle 120 million records?

2002-12-22 Thread Michael T. Babcock
Michael She wrote:


The gravity is a great analogy.  It works with databases too.  People 
are confident in gravity because it is an observable fact of our 
planet.  For millennia people have experienced gravity and have grown 
accustomed to it.  The same can be said of DB2 and Oracle.  People 
have been using it for years, hence the comfort level with these 
products.


People have been using databases for years.  Some of them were produced 
by Oracle Corp or IBM.  However, many people have _not_ directly used 
Oracle or IBM DB2 that are entering or currently in the database market. 
They have used products built on those engines and have certain levels 
of faith in those engines but have to consider the DBA's involvement as 
well as any support contracts with Oracle or IBM that kept the software 
running as it was, as well as Oracle and IBM's tendancies to recommend 
specific (very high-end and fault-tolerant) hardware.

MySQL is another iteration of the database engine by another group of 
people.  This group of people may or may not be 'new' to database 
design, just as the people currently working on Oracle 10 (or X?) may be 
freshmen in college (for all I know, but I highly doubt it).  People 
have faith in Oracle or IBM because they have chosen to have that faith, 
often on the basis of their high marketing profiles, not on the basis of 
hard facts or evidence.

I'm not saying that Oracle and IBM don't make good DB products.  They 
certainly make some of the best software in the world, but don't have 
faith in any software product just because you've heard its name a lot. 
OpenBSD and Linux were helping run the majority of the Internet long 
before most people had heard either name.

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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: Can MySQL handle 120 million records?

2002-12-22 Thread Michael T. Babcock
Jeremy Zawodny wrote:


It's a sad day when confidence is built by a company's PR budget
rather than the product's track record.
 


You mean like Microsoft?

Oh, sorry to bring that up ... :-)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd. ... sql ... for this one :)
http://www.fibrespeed.net/~mbabcock



-
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: i have given up -- bug

2002-12-22 Thread Michael T. Babcock
Joseph Dietz wrote:


I think I'll throw in the towel. Here is the slow performance I'm 
getting when joining 13 tables. The query simply takes too long.


Did you E-mail the MySQL staff to ask how much it would cost to have 
them look at this problem?  Or perhaps one of the other paid consultants 
available on this list?  I don't often analyze 13 SQL table queries for 
free.

PS, you've got several tables not using indexes.  Fix it :)

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



-
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



  1   2   3   4   >