RE: natural sort via substrings

2008-06-13 Thread John Trammell
> -Original Message-
> From: Emily Heureux [mailto:[EMAIL PROTECTED]
> Sent: Thursday, June 12, 2008 8:25 PM
> To: mysql@lists.mysql.com
> Subject: natural sort via substrings
>
> Hi, I am attempting to do a "natural sort" from within mysql, if
> possible.  So, for example, jane2 would come before jane10, and
> normal strings would still sort as expected.

I'd try adding a column (e.g. "sort_as") to your table, and then populate that 
with strings suitable for sorting (e.g. "jane2" would become "jane0002", 
"jane10" => "jane0010", and so on).

One nice thing about this is that you can use an external language like Java, 
Perl, or Python to calculate your sort string.  SQL is a painful choice for 
that task in my opinion.

HTH, HAND.
J

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



RE: Floor Decimal Math

2008-05-15 Thread John Trammell
> -Original Message-
> From: Adam de Zoete [mailto:[EMAIL PROTECTED] On Behalf Of
> Adam de Zoete
> Sent: Thursday, May 15, 2008 6:24 AM
> To: mysql@lists.mysql.com
> Subject: Floor Decimal Math
>
> Hi,
>
> I'm running mysql 4.1.20 (Mac OS 10.4.11) and wondering why this ain't
> returning the right answer? Maybe i'm missing something or am i doing
> something wrong?
>
> mysql> select (11.11-FLOOR(11.11))>=0.11;
> ++
> | (11.11-FLOOR(11.11))>=0.11 |
> ++
> | 0  |
> ++

mysql> set @x = 11.11 - FLOOR(11.11);
Query OK, 0 rows affected (0.00 sec)

mysql> select @x;
+--+
| @x   |
+--+
| 0.11 |
+--+
1 row in set (0.00 sec)

mysql> select @x - 0.11;
+--+
| @x - 0.11|
+--+
| -5.6898930012039e-16 |
+--+
1 row in set (0.00 sec)

mysql> select version();
++
| version()  |
++
| 4.1.20-log |
++
1 row in set (0.00 sec)


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



RE: Problem with characters

2007-09-24 Thread John Trammell
> From: Critters [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 24, 2007 5:24 AM
> To: MySQL General
> Subject: Problem with characters
>
> I have a new setup with mySql version 4.1 and myODBC version 3.51
> running on Windows 2k3 standard
>
> In the database we have something like "And this is £200" and when we
> write this out in ASP we get "And this is ?200" The same happens for
> some other symbols like the copy write symbol (c in a circle)
>
> Any ideas? I have googled this for almost an hour now and never had
> this problem on other installs.

I've found the following resources to be very helpful when dealing with
character set issues:

http://www.cs.tut.fi/~jkorpela/chars.html
http://www.joelonsoftware.com/articles/Unicode.html

HTH, HAND
JT

P.S. - Sorry for the earlier post with the abysmal formatting.  I claim
too much blood in my caffeine stream as an excuse.

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



RE: Problem with characters

2007-09-24 Thread John Trammell
I've found the following resources to be very helpful when dealing with 
character set issues:

http://www.cs.tut.fi/~jkorpela/chars.html
http://www.joelonsoftware.com/articles/Unicode.html

HTH, HAND
JT

> -Original Message-
> From: Critters [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 24, 2007 5:24 AM
> To: MySQL General
> Subject: Problem with characters
>
> I have a new setup with mySql version 4.1 and myODBC version 3.51
> running on Windows 2k3 standard
>
> In the database we have something like "And this is £200" and when we
> write this out in ASP we get "And this is ?200" The same happens for
> some other symbols like the copy write symbol (c in a circle)
>
> Any ideas? I have googled this for almost an hour now and never had
> this
> problem on other installs.
> --
> Dave
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
>
>
> __
> This email has been scanned by the MessageLabs Email Security System.
> __

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



RE: Returning All Rows That Repeat

2007-07-29 Thread John Trammell
>> From: John Kopanas [EMAIL PROTECTED]
>> Subject: Returning All Rows That Repeat
>>
>> I want to be able to return all rows that have one or more other rows
>> with the same customer_number and job_number.
>>
>> So for instance.  If their are two jobs in my jobs table with a
>> customer_number = '0123' and job_number ='12' then I want both of
>> those jobs to return one right after another so I can compare their
>> other fields.  And I want to run a query once a day over the whole
>> table to see if their are any repeats.

One way would be a self-join, e.g.:

SELECT *
FROM mytable t1, mytable t2-- same table twice
WHERE t1.customer_number = t2.customer_number-- with same cust. no.
AND t1.job_number = t2.job_number-- and same job no.
AND t1.id <> t2.id;-- but the records are distinct

INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

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



RE: zipcode to timezone

2007-07-06 Thread John Trammell
> -Original Message-
> From: Hiep Nguyen [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 06, 2007 12:15 PM
> To: Dirk Bremer
> Cc: David T. Ashley; mysql@lists.mysql.com
> Subject: RE: zipcode to timezone
>
> now, why do they do this??? it doesn't make any sense at all to have
> multiple timezones in a state, at least to me.  men, they have too much
> time in their hand and this is they came up, two timezones in a state.

Me neither.  I was interested to learn that there are noticeable energy savings 
associated with the Daylight Savings time change.  Who'd a thunk it?

JT

INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

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



RE: zipcode to timezone

2007-07-06 Thread John Trammell
> -Original Message-
> From: Hiep Nguyen [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 06, 2007 10:51 AM
> To: David T. Ashley
> Cc: mysql@lists.mysql.com
> Subject: Re: zipcode to timezone
>
> i don't think there is any state got 2 timezones, i could be wrong.

Yeah, you are.

http://worldatlas.com/webimage/countrys/namerica/usstates/timezone.htm

INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

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



RE: Less | More

2007-05-03 Thread John Trammell
> -Original Message-
> From: John Kebbel [mailto:[EMAIL PROTECTED]
> Sent: Thursday, May 03, 2007 7:34 AM
> To: MySQL
> Subject: Less | More
>
> Is there a mysql command line equivalent to | less or | more to make it
> easier to scan rows one screen at a time?

I have the command:

pager="less -n -S"

in my ".my.cnf" file.  Works like a charm.  The "-S" prevents line wrapping, 
and the "-n" is a speed hack IIRC.

JT




INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

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



RE: [OT} How to pronounce GIF

2007-01-12 Thread John Trammell
Way offoptic now

How do you pronounce "gift"?  :^)

$ egrep '^gif' /usr/share/dict/words
gift
gift's
gifted
gifting
gifts

To heck with the spec, all precedent in English says hard G.

Next they'll tell us to pronounce "jpeg" as "gay-peg".


-Original Message-
From: Gerald L. Clark [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 12, 2007 1:04 PM
To: Brian Dunning
Cc: mysql
Subject: Re: [OT} How to pronounce GIF

Brian Dunning wrote:
> On Jan 7, 2007, at 4:23 PM, TK wrote:
> 
>> In short, the original inventors of the GIF format (CompuServe,  
>> 1987) have always defined the pronunciation to be like "JIF."  So,  
>> that has always been the "correct" pronunciation.
> 
> 
> Sure, so I'll start pronouncing "graphics" as "jraphics".
> 
> 
How do you pronounce "giraffe"?

--
Gerald L. Clark
Supplier Systems Corporation

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



INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

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



RE: Error. Need help (Bad arguments.)

2006-12-04 Thread John Trammell
Sounds more like a PHP error than a MySQL error. 

-Original Message-
From: John [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 04, 2006 12:53 AM
To: mysql@lists.mysql.com
Subject: Error. Need help (Bad arguments.)



  I get this error:

Warning: implode(): Bad arguments. in
/home/b/cl/TP2/admin/defaults.php on line 102


102-104 Code is:
 {
  $cat_array=explode(":",$_POST['cat_str']);
 }

Ideas?




 

Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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



INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

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



RE: comparing two databases

2006-09-28 Thread John Trammell
When I need to do so, I use mysqldump -d to dump the schemas to files, then use 
"diff" on the files.  It's pretty good at highlighting the differences. 

-Original Message-
From: Steve Buehler [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 28, 2006 3:06 PM
To: mysql
Subject: comparing two databases

Is there a program out there that I can use to compare two databases?  Just the 
structure, not the content.

Thanks
Steve


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



INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

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



RE: Check out this Free software I found to document your IT infrastruct

2006-08-03 Thread John Trammell
Will L. wrote: 
> Nabble hates spam as much as you do. We are currently monitoring this
> user and we will take necessary action just like a mailing list owner
> will do.

If you hated spam as much as I did, you would have terminated this user,
based on the egregious and well-documented abuse of this list.

Sayonara, spammy.
*plonk*


INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

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



RE: Number Searches

2006-02-24 Thread John Trammell
> On Wed, 2006-02-22 at 16:49 -0600, Ariel Sánchez Mora wrote:
> > So far i've been able to store ip addresses as strings like 
> you would
> > type them in DOS, for ex, '192.168.0.1'. This serves me 
> great since my
> > application uses IP addresses as strings in all cases. I've done
> > queries with the IP column , for example, select office_name from
> > table_1 where ip='10.100.1.1'; and have never had any problems.
> > However, if you plan on sorting based on this column, strings with
> > periods do not behave correctly, and the answers to my previous
> > question on this list do not apply; it makes a good aproximation,
> > though.

You might want to look into MySQL functions INET_ATON() and INET_NTOA():

http://dev.mysql.com/doc/refman/4.1/en/miscellaneous-functions.html


INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

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



RE: need to upgrade

2006-01-03 Thread John Trammell
The online documentation would be a good place to start.

http://dev.mysql.com/doc/refman/4.1/en/upgrade.html 

> -Original Message-
> From: Jon Miller [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, January 01, 2006 7:44 PM
> To: mysql@lists.mysql.com
> Subject: need to upgrade
> 
> I need to upgrade MySQL from a RH7.2 server to either a Suse 
> Enterprise 9.2 or Debian 3.1 server.  I understand that the 
> only way to get the data from the RH7.2 server is via 
> mysqldump.  Are there any gotchas or issues doing this?
> 
> Thanks
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 


INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

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



RE: update or insert if necessary?

2005-12-28 Thread John Trammell
You should read
http://dev.mysql.com/doc/refman/4.1/en/insert.html 
and maybe
http://dev.mysql.com/doc/refman/4.1/en/replace.html

> -Original Message-
> From: steve [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, December 28, 2005 8:57 AM
> To: mysql@lists.mysql.com
> Subject: update or insert if necessary?
> 
> I have a situation where I need to update a record for a 
> given key in a MySQL table, but insert a record if the key 
> doesn't exist.  I could do this by doing a SELECT on the key, 
> then doing an UPDATE if anything comes back, or and INSERT 
> otherwise.  This seems rather clunky though, and I'm 
> wondering if there is anything like and "up-sert" command, or 
> at least a preferred way of doing this operation.
> 
> TIASteve
> 


INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

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



RE: INSTALLING MYSQL 5.0 ON LINUX DEBIAN 2.8

2005-12-22 Thread John Trammell
There is no such thing as Debian 2.8--see
http://www.us.debian.org/releases/. 

> -Original Message-
> From: John Galatti [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 22, 2005 8:53 AM
> To: mysqlList
> Subject: INSTALLING MYSQL 5.0 ON LINUX DEBIAN 2.8
> 
> All
> I am trying to build the mysql 5.0 from the source
> When I run the configure scripts it error out saying it can 
> not find termcap  data base  also, can not find tegenent  in 
> any library
> I am running under debian linux 2.8   
> Does any one have nay idea on what I should do
> 
> John
> 


INFORMATION IN THIS MESSAGE, INCLUDING ANY ATTACHMENTS, IS INTENDED FOR THE 
PERSONAL AND CONFIDENTIAL USE OF THE INTENDED RECIPIENT(S) NAMED ABOVE. If you 
are not an intended recipient of this message, or an agent responsible for 
delivering it to an intended recipient, you are hereby notified that you have 
received this message in error, and that any review, dissemination, 
distribution, or copying of this message is strictly prohibited. If you 
received this message in error, please notify the sender immediately, delete 
the message, and return any hard copy print-outs.

This message has been scanned for viruses by McAfee's Groupshield.

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



RE: HTML in MySQL?

2005-09-11 Thread John Trammell
$input = "This is  the \n input";# value from user
$saved = "This is  the  input";  # value in database
$recovered = "This is \n the \n input";  # retrieved from db, != $input

-Original Message-
From: Vladimir B. Tsarkov [mailto:[EMAIL PROTECTED]
Sent: Sun 9/11/2005 2:15 PM
To: mysql@lists.mysql.com
Cc: mysql@lists.mysql.com
Subject: Re: HTML in MySQL?
 
Hello!

> But once you have done that, you can never recover the origional text.
> Try it on this email if you doubt it.

Why? Why not to use regular expressions?

> Use addslashes($htmlCode) and execute query normally. 
> $slashedHtmlCode = addslashes($htmlCode);

The problem is not in the executing of a query.

After the execution of the script:



we will get:

1

and no empty lines.

If you want to output the same data, that was written using a textarea field 
of a form, you should use the "" tag.

-- 
Good Luck!
Vladimir

Please, avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

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




RE: HTML in MySQL?

2005-09-09 Thread John Trammell
Amen.  Translating user input into HTML is great until you need to read
the data *out*, and someone decides the output should be formatted as
RTF or PDF or text.  Best to store it as you got it, IMO.

> -Original Message-
> From: Alan Williamson [mailto:[EMAIL PROTECTED] 
> Sent: Friday, September 09, 2005 10:11 AM
> To: mysql@lists.mysql.com
> Subject: RE: HTML in MySQL?
> 
> > If you use textarea field of a form, it produces "null" 
> characters (\n) in 
> the 
> > end of every string. I recommed to replace them with "" 
> tags before 
> > writing into the database. It'll help to avoid output problems. Use 
> > preg_replace(); for it.
> 
> Be careful here Vladimir, the (\n) are not 'null' characters; 
> but newline
> characters.  And i would highly recommend *not* replacing 
> them with 
> tags as you write them into the database.  This is asking for 
> trouble on
> so many levels.
> 
> The database will cope with carriage returns and newlines 
> just like any
> other character, so will have no problems.
> 
> HTML is just string; treat it as such and don't give it anymore credit
> than that and you'll be fine.
> 
> -- 
>  Alan Williamson, Technology Evangelist
>  SpikeSource Inc.
>  Daily OS News @ http://compiledby.spikesource.com/
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: Newbie needs info!

2005-09-06 Thread John Trammell
The DuBois book is a good start: http://www.kitebird.com/mysql-book/ 

> -Original Message-
> From: Jay Paulson [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, September 06, 2005 10:56 AM
> To: mysql@lists.mysql.com
> Subject: Newbie needs info!
> 
> Hi everyone,
> 
> Long time reader, first time poster.
> 
> I've been using MySQL for some years now and never really did any 
> advance stuff in it.  I mainly do updates, deletes, and selects.  My 
> selects aren't even that complex as I don't have a very good 
> understanding of the join syntax and exactly what it does.  I was 
> wondering a few things.  First of all what is a good book for 
> beginners/intermediate level people?  I'd really like to learn more 
> complex query structure and how to optimize a database as a whole as 
> well as individual tables in the database (example what's the 
> difference between a primary key and just a regular key in a 
> table?).  
> I'm also looking for something that can explain stored procedures and 
> why they are useful (I really don't have any clue about stored 
> procedures) as well as transactions, replication, and master/slave 
> databases.  Finally, I'd like to figure out the difference 
> between each 
> table type (MyISM and InnoDB etc).
> 
> Thanks for any help or advice!
> jay
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: How to use Like Clause in Perl? Works fine in MySQL control center!

2005-08-08 Thread John Trammell
Funny you should bring up this subject, as it was recently rehashed
(more like re-re-re-re-hashed!) on perlmonks.org in this discussion
thread:

http://perlmonks.org/?node_id=481652

The conclusion of the discussion(s) is that there are valid reasons to
use single and double quotes in various circumstances, and that the CPU
difference due to possible variable interpolation is minor compared to
other considerations.

If performance is a problem for your app, your time would be better
spent profiling your code and address real issues before addressing the
non-issue of variable interpolation.

JT 

> -Original Message-
> From: Nuno Pereira [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 08, 2005 5:04 AM
> To: mysql@lists.mysql.com
> Subject: Re: How to use Like Clause in Perl? Works fine in 
> MySQL control center!
> 
> Knowing not too much from perl, I would like to remember the last 
> paragraph of Jeremiah:
> 
>  > Keep in mind that interpolation is work, so using one of the
>  > single quotes
>  > strings which does not search your string for variables to
>  > replace is going
>  > to be higher performance than the double quoted version, 
> although the
>  > difference may be a little or a lot depending on how many
>  > times the string
>  > is interpreted (if it is in a loop or something).
> 
> If performance is a problem, don't forget this.

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



RE: How to use Like Clause in Perl? Works fine in MySQL control center!

2005-07-25 Thread John Trammell
>From 'perldoc perldata':

  Variable substitution inside strings is limited to scalar
  variables, arrays, and array or hash slices.  (In other
  words, names beginning with $ or @, followed by an optional
  bracketed expression as a subscript.)

You can check this from the command line:

  % perl -le 'print "$s -- @s -- %s"'
  --  -- %s

So the '%' isn't the issue here.  The issue is certainly the (mis)use of
join(), as was pointed out by a previous poster.


> -Original Message-
> From: Jeremiah Gowdy [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 25, 2005 9:14 AM
> To: Siegfried Heintze; mysql@lists.mysql.com
> Subject: Re: How to use Like Clause in Perl? Works fine in 
> MySQL control center!
> 
> When you use double quotes for strings in Perl, Perl looks 
> through your 
> strings for variables like $foo, and replaces them with the 
> current value of 
> $foo.  This is called interpolation.  When you use single quotes, it 
> considers your string a literal.
> 
> So when you use double quotes, you need to escape any special 
> characters 
> like $ % " or @.  When you use single quotes, the only 
> character you have to 
> worry about is '.  Here are ways you could make this string work.
> 
> Double quotes with special characters escaped (due to interpolation)
> 
> "SELECT 'David!' LIKE '\%D\%v\%'"
> 
> Single quotes with double quote usage for the SQL quoting (no 
> escaping 
> required)
> 
> 'SELECT "David!" LIKE "%D%v%"'
> 
> Single quotes with single quotes escaped for the SQL quoting
> 
> 'SELECT \'David!\' LIKE \'%D%v%\''
> 
> Keep in mind that interpolation is work, so using one of the 
> single quotes 
> strings which does not search your string for variables to 
> replace is going 
> to be higher performance than the double quoted version, although the 
> difference may be a little or a lot depending on how many 
> times the string 
> is interpreted (if it is in a loop or something).
> 
> 
> - Original Message - 
> From: "Siegfried Heintze" <[EMAIL PROTECTED]>
> To: 
> Sent: Friday, July 22, 2005 4:03 PM
> Subject: How to use Like Clause in Perl? Works fine in MySQL 
> control center!
> 
> 
> > I'm having trouble getting the like clause to work. It 
> seems to work fine 
> > in
> > the MySQL Control Center 9.4.beta. I'm using MySQL 4.0.23-debug.
> >
> > use DBH;
> > my $sth = DBH->prepare("SELECT 'David!' LIKE '%D%v%'");
> > $sth->execute();
> > my $row;
> > print join(@$row,",")."\n" while ($row = $sth->fetch);
> >
> >
> > This does not print a "1" in perl. It just prints a ",".
> >
> > I've posted a query on this in [EMAIL PROTECTED] with no luck.
> >
> > Anybody have any suggestions?
> > Thanks,
> > Siegfried
> >
> > Here is DBH.pm. Below that is my original post in 
> [EMAIL PROTECTED]
> >
> >
> > package DBH;
> > use DBI;
> > require Exporter;
> > our @ISA = qw(Exporter);
> > our @EXPORT = qw(DBH); # Symbols to be exported by default
> > our @EXPORT_OK = qw(); # Symbols to exported by request
> > our $VERSION = 0.1;
> >
> >
> > our $dbh;
> > sub DBH{
> >unless ( $dbh && $dbh->ping ) {
> >$dbh = DBI->connect ( 
> 'dbi:mysql:dbname=hotjobs;host=SALES', 'xyz',
> > 'xyz' ) ;
> >die DBI->errstr unless $dbh && $dbh->ping;
> >}
> >return $dbh;
> > }
> >
> > 1;
> > 
> --
> --
> > 
> >
> >
> > The following code works with Activestate perl 8.4/MySQL. 
> If I comment the
> > second line, however, it does not work. No error messages 
> and no results.
> >
> > If I use the MySQL Enterprise console and type in my first SELECT 
> > statement
> > that includes the LIKE clause, it works.
> >
> > I'm stumped. There must be something strange with that "%", 
> but I cannot
> > figure it out.
> > Anyone got any suggestions?
> >
> > Siegfried
> >
> > my $sJobTitle = "SELECT sName FROM keywords ORDER BY sName 
> WHERE sName 
> > LIKE
> > '%'";
> >  $sJobTitle = q[SELECT sName FROM keywords ORDER BY sName];
> >
> >  my $sth = DBH->prepare($sJobTitle);
> >  $sth->execute();
> >  my $row;
> >  while ($row = $sth->fetch){
> >push @sResult,"".join( "", @$row)."\n";
> >  }
> >
> >
> > -- 
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> >
> > 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: Questions about backups, InnoDB tables, etc.

2005-07-22 Thread John Trammell
Did you try that link?  When I follow it, I get a search results page
saying <>.  Too
bad it doesn't actually show the search results 

> -Original Message-
> From: Michael Monashev [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, July 21, 2005 5:45 PM
> To: Ryan Stille; mysql@lists.mysql.com
> Subject: Re: Questions about backups, InnoDB tables, etc.
> 
> Hello
> 
> RS> I'm trying to get a handle on MySQL backups and hot 
> backups using MyISAM
> RS> and InnoDB tables together.  We plan to switch from SQL 
> Server to MySQL
> RS> soon.
> 
> Did you see it:
> http://solutions.mysql.com/search.php?pc=0%2C0&q=backup&level=0 ?
>   
> 
> Sincerely,
> Michael,
>  http://xoib.com/ http://3d2f.com/
>  http://qaix.com/ http://ryxi.com/
>  http://gyxe.com/ http://gyxu.com/
>  http://xywe.com/ http://xyqe.com/
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: Reload mysqld configuration without restart?

2005-07-18 Thread John Trammell
Thanks for replying.  Some doc pages pertaining to this are:

http://dev.mysql.com/doc/mysql/en/dynamic-system-variables.html
http://dev.mysql.com/doc/mysql/en/system-variables.html

Unfortunately I need to change some that are not dynamic.  Many (most?)
servers offer this functionality; it would be nice if MySQL had it.

 

> -Original Message-
> From: Gleb Paharenko [mailto:[EMAIL PROTECTED] 
> Sent: Monday, July 18, 2005 1:10 PM
> To: mysql@lists.mysql.com
> Subject: Re: Reload mysqld configuration without restart?
> 
> Hello.
> 
> 
> 
> I don't know a general way to force MySQL Server to reread it's
> 
> configuration file, however you could dynamically change lots
> 
> of variables using SET @@global.xx syntax. FLUSH command could be
> 
> helpful as well. See:
> 
>   http://dev.mysql.com/doc/mysql/en/system-variables.html
> 
>   http://dev.mysql.com/doc/mysql/en/flush.html
> 
> 
> 
> 
> 
> 
> 
> 
> 
> "John Trammell" <[EMAIL PROTECTED]> wrote:
> 
> > Is it possible for mysqld to reload its configuration files without
> 
> > doing an explicit stop/start?  I've searched the online 
> documentation
> 
> > plus my copy of the DuBois book to no avail.
> 
> > 
> 
> > The fact that the Debian init scripts don't do a proper 
> config reload
> 
> > (just the GRANT tables) does not give me lots of hope.
> 
> > 
> 
> > Thanks,
> 
> > J. Trammell
> 
> > 
> 
> 
> 
> -- 
> For technical support contracts, goto 
> https://order.mysql.com/?ref=ensita
> This email is sponsored by Ensita.NET http://www.ensita.net/
>__  ___ ___   __
>   /  |/  /_ __/ __/ __ \/ /Gleb Paharenko
>  / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
> /_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
><___/   www.mysql.com
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



Reload mysqld configuration without restart?

2005-07-18 Thread John Trammell
Is it possible for mysqld to reload its configuration files without
doing an explicit stop/start?  I've searched the online documentation
plus my copy of the DuBois book to no avail.

The fact that the Debian init scripts don't do a proper config reload
(just the GRANT tables) does not give me lots of hope.

Thanks,
J. Trammell

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



RE: Getting first and last day of week

2005-07-13 Thread John Trammell
How about "adddate(20050101, INTERVAL 7*23 DAY)" for getting a date in
week 23?

> -Original Message-
> From: Eric Jensen [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 13, 2005 4:29 PM
> To: mysql@lists.mysql.com
> Subject: Re: Getting first and last day of week
> 
> John Trammell wrote:
> 
> 
> >>Playing around with the date/time functions, I came up with:
> >>
> >>select subdate(now(), INTERVAL weekday(now()) DAY);
> >>select adddate(now(), INTERVAL 6-weekday(now()) DAY);
> >>
> >>So once you have a date in the desired week, it's easy to 
> calculate the
> >>first/last days in that calendar week.
> >>
> >>  
> >>
> >  
> >
> I can think of a lot of ways once I have the date, that's not 
> really the
> problem.  All I have is a week number, I.E. 23, 24, 25, etc.  
> I need to
> find out some dates they correspond to and I'm not sure how 
> to do that.
> 
> Eric
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: Getting first and last day of week

2005-07-13 Thread John Trammell
Playing around with the date/time functions, I came up with:

select subdate(now(), INTERVAL weekday(now()) DAY);
select adddate(now(), INTERVAL 6-weekday(now()) DAY);

So once you have a date in the desired week, it's easy to calculate the
first/last days in that calendar week.

> -Original Message-
> From: Eric Jensen [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 13, 2005 12:52 PM
> To: mysql@lists.mysql.com
> Subject: Getting first and last day of week
> 
> Is there an easy way of finding the first and last day of a week?  I'm
> looping through week numbers, I.E. 2005-06-12 is week 23, but for
> display I would like to know the first and last day of that week.  I
> usually just loop through some days and find them myself, but I am
> curious to know if there is a more efficient way with MySQL.
> 
> Eric
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: Timestamp problem.

2005-07-13 Thread John Trammell
If you run the select "SELECT NOW() + 1*RAND();" a few times, you'll
see that not all values are valid timestamps, e.g.:

mysql> SELECT NOW() + 1*RAND();
+--+
| NOW() + 1*RAND() |
+--+
|   20050713112881 |
+--+
1 row in set (0.00 sec)

If you're trying to add seconds onto a timestamp, you're probably
looking for something like:

SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(NOW()) + 1*RAND());

> -Original Message-
> From: Antonio Gulli [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, July 13, 2005 8:31 AM
> To: mysql@lists.mysql.com
> Subject: Timestamp problem.
> 
> I have the following part in a schema
> 
> describe feeds
> .
> 
> | pubdate | timestamp| YES  | | CURRENT_TIMESTAMP 
> |   |
> 
> show create table feeds;
> 
>  `pubdate` timestamp NOT NULL default CURRENT_TIMESTAMP on update 
> CURRENT_TIMESTAMP,
> 
> when i make an
> 
> INSERT INTO feeds(, pubdate) VALUES (,NOW()+1*RAND())
> 
> is there any chance to have:
> 
> mysql> select count(*) from feeds where pubdate = 0;
> +--+
> | count(*) |
> +--+
> |   593923 |
> +--+
> 1 row in set (5.90 sec)
> 
> mysql> select count(*) from feeds where pubdate > 0;
> +--+
> | count(*) |
> +--+
> |   287532 |
> +--+
> 1 row in set (5.33 sec)
> 
> 
> 
> 
> 
> 
> -- 
> Sometimes life hits you in the head with a brick. 
> Don't lose faith.
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: Underscore functions as a wildcard ?

2005-06-29 Thread John Trammell
Just so.  What I was referring to were these reports:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=285276 
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0957

As documented, this is clearly a feature, and not a bug.

> -Original Message-
> From: Michael Stassen [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 29, 2005 10:27 AM
> To: John Trammell
> Cc: mysql@lists.mysql.com
> Subject: Re: Underscore functions as a wildcard ?
> 
> This is not a bug.  Mysql uses _ as the single-character 
> wildcard, and % as 
> the multi-character wildcard in pattern matches.  This is 
> clearly explained in 
> the manual <http://dev.mysql.com/doc/mysql/en/grant.html>:
> 
>Note: the '_' and '%' wildcards are allowed when 
> specifying database
>names in GRANT statements that grant privileges at the 
> global or database
>levels. This means, for example, that if you want to use a 
> '_' character
>as part of a database name, you should specify it as '\_' 
> in the GRANT
>statement, to prevent the user from being able to access additional
>databases matching the wildcard pattern; for example, GRANT ... ON
>`foo\_bar`.* TO 
> 
> Michael
> 
> John Trammell wrote:
> 
> > I recall seeing this "feature" discussed on Bugtraq a few weeks ago.
> > IIRC there are updated MySQL versions that fix this bug.  
> What version
> > of MySQL are you running? 
> > 
> > 
> >>-Original Message-
> >>From: Jeroen Bosch [mailto:[EMAIL PROTECTED] 
> >>Sent: Wednesday, June 29, 2005 6:59 AM
> >>To: mysql@lists.mysql.com
> >>Subject: Underscore functions as a wildcard ?
> >>
> >>We stumbled upon the following 'feature' of MySQL:
> >>
> >> 
> >>
> >>If, for example user 'x' has a database called 'user_data' he 
> >>is able to
> >>create a table called user2data and so on without create privileges.
> >>
> >>It looks like the underscore is used as some kind of 
> >>wildcard, now is the
> >>question: is this correct or is this something that should not be?
> >>
> >> 
> >>
> >>Kind regards,
> >>
> >> 
> >>
> >>Jeroen Bosch 
> 
> 

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



RE: Underscore functions as a wildcard ?

2005-06-29 Thread John Trammell
I recall seeing this "feature" discussed on Bugtraq a few weeks ago.
IIRC there are updated MySQL versions that fix this bug.  What version
of MySQL are you running? 

> -Original Message-
> From: Jeroen Bosch [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, June 29, 2005 6:59 AM
> To: mysql@lists.mysql.com
> Subject: Underscore functions as a wildcard ?
> 
> We stumbled upon the following 'feature' of MySQL:
> 
>  
> 
> If, for example user 'x' has a database called 'user_data' he 
> is able to
> create a table called user2data and so on without create privileges.
> 
> It looks like the underscore is used as some kind of 
> wildcard, now is the
> question: is this correct or is this something that should not be?
> 
>  
> 
> Kind regards,
> 
>  
> 
> Jeroen Bosch 
> 
>  
> 
>  
> 
> 

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



RE: Sarge problems with MySQL and DBI / DBD::mysql

2005-06-21 Thread John Trammell
#!perl

use strict;
use warnings;

sub foo {
warn "wantarray() in foo() is: ", wantarray(), "\n";
my @r = 3 .. 8;
return @r;
}

my @x = foo() or warn "in ... or warn() #1\n";
warn "[EMAIL PROTECTED]: @x\n";

my $x = foo() or warn "in ... or warn() #2\n";
warn "\$x: $x\n"; 

> -Original Message-
> From: Michael Stassen [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, June 21, 2005 12:48 PM
> To: olly@lfix.co.uk
> Cc: debian-user@lists.debian.org; mysql@lists.mysql.com
> Subject: Re: Sarge problems with MySQL and DBI / DBD::mysql
> 
> Oliver Elphick wrote:
> 
> > We have an application that has just upgraded to Debian 
> sarge with mysql
> > upgrading from 3.23.49 to 4.0.24.  As far as I know I have 
> followed all
> > the procedures for upgrading the database.
> > 
> > Some queries always fail in DBD::mysql (in DBI) although 
> they work OK
> > with the mysql client.
> > 
> > For example, this SQL command:
> > 
> > SELECT description
> > FROM IncoCountry
> > WHERE value = "EW";
> > 
> > which returns 0 rows, works correctly in mysql.  But when 
> it is passed
> > through this statement in Perl:
> > 
> > my @row = $dbh->selectrow_array($sql) or
> > &failed(__FILE__, __LINE__,
> >  "Failed to run the sql statement with error
> >   $DBI::errstr");
> > 
> > it fails inside DBD::mysql without giving any message in 
> $DBI::errstr:
> 
> This does not fail.  Your logic is wrong.  You are evaluating 
> $dbh->selectrow_array($sql) in a scalar context 
> (selectrow_array or ...). 
> According to `perldoc DBI`, in the section on 
> selectrow_array, "in a scalar 
> context, an "undef" is returned if there are no more rows".  
> Your query 
> successfully returns 0 rows, so $dbh->selectrow_array($sql) 
> is "undef".  undef 
> is false, so the part of your query after the "or" gets run.  
> You've coded an 
> error message which claims the query produced a DBI error, 
> but it did not.
> 
> > DBD::mysql::db::prepare(/usr/lib/perl5/DBD/mysql.pm:208):
> > 208:my $sth = DBI::_new_sth($dbh, {'Statement' => 
> $statement});
> >   DB<2> n
> > DBD::mysql::db::prepare(/usr/lib/perl5/DBD/mysql.pm:211):
> > 211:if (!DBD::mysql::st::_prepare($sth, $statement, 
> $attribs)) {
> >   DB<2> s
> > DBD::mysql::db::prepare(/usr/lib/perl5/DBD/mysql.pm:215):
> > 215:$sth;
> >   DB<2> s
> > 
> main::failed(/home/domain/www.chpresenters.co.uk/web/cgi-bin/o
> cms-multi/common/cgi-lib.pl:117):
> > 
> > If a row is added to the table to be returned by this 
> query, the problem
> > goes away.
> > 
> > How can I debug or fix this problem, please?
> 
> You need to revise your code to distinguish between DBI 
> errors and 0 rows 
> returned.
> 
> Michael
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: error 2002:

2005-03-11 Thread John Trammell
Is the mysqld daemon running?  (It should be.)  What does the command

   ps aux | grep mysqld

say? 

> -Original Message-
> From: Mark Sargent [mailto:[EMAIL PROTECTED] 
> Sent: Friday, March 11, 2005 8:52 AM
> To: mysql@lists.mysql.com
> Subject: error 2002:
> 
> Hi All,
> 
> I get the following error in Fedora3 when trying to run mysql 
> from the cli,
> 
> [EMAIL PROTECTED] mysql]# mysql
> ERROR 2002: Can't connect to local MySQL server through socket 
> '/var/lib/mysql/mysql.sock' (2)
> 
>  I installed mysql via yum. I'm rather new to Linux and even 
> more so to 
> MysSQL. Cheers.
> 
> Mark Sargent.
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: Perl DBI does not print error.

2005-03-10 Thread John Trammell
The print string you show is:

"prepare: $insert_sql: $DBI::errstr"

but your error message is

Unable to execute query: DBI::db=HASH(0x8647df0)->errstr

I think your problem is with a print line like:

print "Unable to execute query: $dbh->errstr"

and Perl is interpolating $dbh, but not the full method call
$dbh->errstr.
You want instead:

print "Unable to execute query: ", $dbh->errstr

or

print "Unable to execute query: @{[ $dbh->errstr ]}"

You will probably have better luck with your Perl questions on Usenet
newsgroup comp.lang.perl.misc, or on the Perl Monks site
www.perlmonks.org.

> -Original Message-
> From: sam [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 10, 2005 7:56 AM
> To: Mysql
> Subject: Perl DBI does not print error.
> 
> Hi,
> 
> The perl DBI does not prints error message:
> $sth = $dbh->prepare($insert_sql)
>|| print ERRFILE_OUT "prepare: $insert_sql: $DBI::errstr";
> 
> The out of this error only does not print why the error was occurred.
> eg.
> Unable to execute query: DBI::db=HASH(0x8647df0)->errstr:
> 
> Dan anyone please tell me how to prints how a description of 
> the error 
> from DBI when sql executed failed?
> 
> Thanks
> Sam
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: Partial and inexact matches

2005-03-07 Thread John Trammell
> I'd like users to be able to enter the first 
> few characters of a contact's name to do a search, and I'd 
> like the option of doing inexact matches or phonetic matches.

MySQL does have the SOUNDEX function; see the docs for details...

  SELECT * FROM people WHERE SOUNDEX(lastname) = SOUNDEX('Smith');

I'm sure others can suggest optimizations...

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



RE: insert data

2005-03-04 Thread John Trammell
Gerals Preston wrote:
[snip]
> my $sth = $dbh->prepare( $sql ) or die $dbh->errstr if $dbh->err;
[snip]

Regardless of other problems you may be having, I think you're not
doing what you want to do here.  How about instead:

my $sth = $dbh->prepare($sql);
$sth || die "Error preparing sth from '$sql': ", $dbh->errstr;

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



RE: Difficulty starting mysql

2005-02-23 Thread John Trammell
Did you follow the procedure in

http://dev.mysql.com/doc/mysql/en/quick-install.html

?

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, February 23, 2005 1:29 PM
> To: mysql@lists.mysql.com
> Subject: Difficulty starting mysql
> 
> Hello,
>   I'm attempting to start mysql 4.1.10 compiled source code 
> on Red Hat 
> Advanced Server 2.1 with apache 2.0.49.  ./configure, make and make 
> install went successfully.  But when I attempt to start mysql 
> using this 
> command:
> sudo mysqld_safe --user=mysql
> 
> I get the following errors:
> Starting mysqld daemon with databases from /var/lib/mysql
> STOPPING server from pid file /var/run/mysqld/mysqld.pid
> 050223 11:31:46  mysqld ended
> 
> The error log states:
> 050223 11:16:03  mysqld started
> 050223 11:16:03  InnoDB: Database was not shut down normally!
> InnoDB: Starting crash recovery.
> InnoDB: Reading tablespace information from the .ibd files...
> InnoDB: Restoring possible half-written data pages from the 
> doublewrite
> InnoDB: buffer...
> 050223 11:16:03  InnoDB: Starting log scan based on checkpoint at
> InnoDB: log sequence number 0 43634.
> InnoDB: Doing recovery: scanned up to log sequence number 0 43634
> 050223 11:16:03  InnoDB: Flushing modified pages from the 
> buffer pool...
> 050223 11:16:03  InnoDB: Started; log sequence number 0 43634
> 050223 11:16:03 [ERROR] /usr/local/libexec/mysqld: Can't find file: 
> './mysql/host.frm' (errno: 13)
> 050223 11:16:03 [ERROR] Fatal error: Can't open privilege 
> tables: Can't 
> find file: './mysql/host.frm' (errno: 13)
> 050223 11:16:03  mysqld ended
> 
> 
> I also did a find on mysld and found this:
> ./var/run/mysqld
> ./etc/rc.d/init.d/mysqld
> ./etc/logrotate.d/mysqld
> ./usr/libexec/mysqld
> ./usr/local/libexec/mysqld
> ./home/webcollab/mysql-4.1.10/sql/mysqld
> 
> What do I need to do to make it start properly?  Thanks in advance!
> 
> Kelly S. Brace
> Information Technology Exchange Center
> Twin Rise 200
> 1300 Elmwood Avenue
> Buffalo, NY 14222
> http://www.itec.suny.edu
> 
> Main: 716-878-4832
> Fax: 716-878-3485
> Office: 716-878-3984
> Cell: 716-432-4978
> [EMAIL PROTECTED]
> 

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



RE: Physical limitations ... ?

2005-02-18 Thread John Trammell
Depends a lot on your server setup and table engine choices.  See

http://dev.mysql.com/doc/mysql/en/table-size.html

etc.   

> -Original Message-
> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Raph
> Sent: Friday, February 18, 2005 10:08 AM
> To: mysql@lists.mysql.com
> Subject: Physical limitations ... ?
> 
> Hi all,
> My 1st post in this ng !
> Does anyone know what is the "physical limitation" of a mysql server ?
> I have several db on my server (freebsd,p4,mysql 4.0.22), one 
> of them with
> many tables (2394), and I'm afraid to reach this "pysical 
> limit" one day 
> 
> Please tell me that I'm far from it ;-)
> Thanks.
> Raph
> 
> 
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: MySQL and DNS problem

2005-02-17 Thread John Trammell
You can specify a wildcard in the host IP, eg.

  grant select on mydb.* to 'someuser'@'192.168.2.%' ...

which you can use to get around your DHCP issue until host lookups are
fixed.

> -Original Message-
> From: Ian Meyer [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 17, 2005 11:46 AM
> To: mysql@lists.mysql.com
> Subject: Re: MySQL and DNS problem
> 
> Jeff Smelser wrote:
> > On Thursday 17 February 2005 09:41 am, Ian Meyer wrote:
> > 
> > 
> >>When trying to connect, it fails with the message:
> >>'MySQL Error Number 1045
> >>Access denied for user 'user'@'192.168.2.103' (using password: YES'
> > 
> > 
> > The 192.168.2.103 is your tip that its not using a host. grant 
> > [EMAIL PROTECTED] and things will work.
> > 
> > Then you can solve why its not resolving.
> > 
> > Jeff
> 
> I wish we could do that, however, it's not an option as we 
> use DHCP.. so 
> the IP's change, yet the hostname does not. Besides, that's 
> just a cheap 
> way to avoid fixing the problem when it should work to begin 
> with. Our 
> access tables are ridiculously messy as you can guess.
> 
> Ian
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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



RE: ENCODE & DECODE

2005-02-04 Thread John Trammell
In my version of MySQL (4.1.9), your sample code generates an error:

mysql> select decode(encode("foo"));
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '))' at line 1

Apparently encode()/decode() take two args, at least on my version of
MySQL:

mysql> select decode(encode("foo","bar"),"bar");
+---+
| decode(encode("foo","bar"),"bar") |
+---+
| foo   |
+---+
1 row in set (0.00 sec) 

> -Original Message-
> From: Jeff Smelser [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 04, 2005 2:14 PM
> To: mysql@lists.mysql.com
> Subject: Re: ENCODE & DECODE
> 
> On Friday 04 February 2005 11:00 am, shaun thornburgh wrote:
> > Apparently not!
> >
> > mysql> SELECT DECODE ( CSV_DATA_ENC_FORENAME, "test_password" ) FROM
> > DATA_TABLE_PID_1_DESC_137;
> 
> Is it so hard to read directions?
> 
> select decode(csv_data_enc_forename) from DATA_TABLE_PID_1_DESC_137;
> 
> This assumes whatever is in that column, was encoded.
> 
> Jeff
> 

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



RE: Pulling a database schema out of a unknown MySQL database?

2005-02-02 Thread John Trammell
I'd do something like 'mysqldump -d foo'; the -d option only dumps the
table defs.

> -Original Message-
> From: Dan Stromberg [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, February 02, 2005 12:31 PM
> To: mysql@lists.mysql.com
> Cc: [EMAIL PROTECTED]
> Subject: Pulling a database schema out of a unknown MySQL database?
> 
> 
> I have a system with set of web pages that use PHP and a 
> MySQL database.
> 
> Apparently the old webmaster has disappeared, and a new webmaster has
> been hired.  She needs to know the schema of the database.
> 
> So my question is: Is there a way of querying MySQL not for values of
> fields, but rather for the schema of the database?
> 
> Thanks!
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 

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