Re: can't find /tmp/mysql.sock

2003-03-01 Thread Andreas
Ryan McDougall wrote:
when I do this this is what I get:
starting mysql with databases from /var/lib/mysql

This may be your culprit right here... not sure where the mysql_install_db
defaults its installs to, but I'm guessing its not /var/lib/mysql. And you
installed everything into /usr/local/mysql, so you may need to edit your config
file to tell it where to look for the install.
At least SuSE has the homedir of user mysql at /var/lib/mysql.
So it might be the default for red hat's mysql installation, too.
If one installs the binary from mysql.com there are some paths to be 
redirected.

One problem is that a number of applications (e.g. PHP) have the path to 
mysql's socket and data-dir compiled in their binary. Just setting up 
mysql in /usr/local/mysql and editing /etc/my.cnf won't solve all issues.


shell ./mysqladmin ping
I get the error message:
./mysqladmin: connect to server at 'localhost' failed
error: 'can't connect to local MySQL server through socket '/tmp/mysql.sock'
(2)'
check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
The error message above said the server couldn't properly start.
That's why ther is no mysql.sock


This is happening because mysqld is not running... I believe that when you run
safe_mysqld it creates the /tmp/mysql.sock file. So if it never runs no file is
ever made.
no
mysql.sock exists when the mysqld (server daemon) is running.

People please correct me if I'm wrong... I've never done a binary install. I've
only installed MySQL at the time of my RH8.0 install.
There you are.
I only know SuSE.
They install it like that:
Mysql's Base dir is /usr
Data. logs and socket in /var/lib/mysql
Mysql.com's binary is setup like this:
Basedir /usr/local/mysql
Datadir /usr/local/mysql/data
Socket in /tmp
1) If you already have data in /var/lib/mysql make a backup.
a) install the old software again which you used to create the database.
b) mysqldump all important stuff and store it under your pillow
c) uninstall the old mysql binary
2) lets fix the missing socket
a) Erase /var/lib/mysql
b) create symlink so that /var/lib/mysql points to /tmp
c) light a candle for the saint that manages system security
d) mysql.com's binary will put it's socket in /tmp so edit the 
socket-parameter in /etc/my.cnf to this location. Some clients will 
actually read it.

3) extract mysql.com's binary and put it where it is supposed
-- /usr/local/mysql
(OK, put it where you like, but point a symlink from /usr/local/mysql to 
the right place)

4) find a place for the data-files like e.g. /var/lib/mysql/data
(OK, ... bla ... symlink ... bla)
b) edit  /etc/my.cnf  acordingly
5) read the INSTALL docu and follow what they say
b) the user mysql will probaply already exist but perhaps not in the 
group mysql ... so what ?  ;)
c) set the right rights acording to the documentation

6) if you mindlessly do everything on the console with MC, like I do, 
use a plain shell to start mysqld_save.
I had a hard time to find out why the mysql daemon came up but died 
instantly all the time for no imaginal reason.

All above should bring you at least near a working mysql.com binary 
install. It's by far not the proper way to do it, but it's either that 
or recompiling mysql and/or a lot of other packets that came with you 
linux distribution.
Obviously it's not the way to go in a production environment but it 
should be OK to get started.

The whole crap results from distributors who don't use /usr/local for 
applications they provide precompiled.
A SuSE dude told me they weren't allowed to do that. Users should be 
certain that there are only applications they put there themselves so it 
was easier to backup stuff which was applied later.
Yeah great ... now we fight hardcoded non standard paths.

BS !   I say.

regards

-
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


Best way to dump for daily archiving

2003-03-01 Thread Scott Haneda
I wrote a sh script to use mysqldump to iterate through my databases and
dump them to .sql files, I am supplying no flags to mysqldump, and wonder,
is there a best way to dump your files, if the idea is they are backups
and to be used in the case of emergency.

-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com   Fax: 313.557.5052
[EMAIL PROTECTED]Novato, CA U.S.A.


-
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: A Simple Query!

2003-03-01 Thread Bruce Feist
Hello, Uttam;

We can simplify this, actually... any time L.idFilm is NULL (i.e., no 
row in Loans is found), L.dateReturn will have to be NULL as well.  So, 
specifying the L.idFilm IS NULL condition is redundant.  It's sufficient 
to look only at L.dateReturn IS NULL in the WHERE clause.

Yours is an improvement over my original, though, in that it's correct 
g.  Mine would have missed films having Loans with non-NULL dateReturns.

Uttam wrote:

here's my version of the answer:

SELECT
F.idFilm, F.title
FROM
Films F LEFT JOIN Loans L ON F.idFilm = L.idFilm
WHERE
(L.idFilm IS NULL) OR (L.dateReutrn IS NULL)
;
regds,

-Original Message-
From: Bruce Feist [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 08:13
select F.idFilm, F.title
from Films F left join Loans L on F.idFilm = L.idFilm and L.dateReturn
IS NULL
where L.idFilm IS NULL;
 

Remi Mikalsen wrote:
 

Scheme:
 Films (idFilm, title)
 Loans (idFilm, dateLoan, dateReturn, idContact, idLoan)
 Contacts (idContact, name)
Question:
 What films aren't on loan right now? 

Using the SQL standards it should be possible to write the following
   

query.
 

SELECT F.idFilm, F.title
   

FROM Films F
 

WHERE F.idFilm NOT IN ( SELECT L.idFilm
FROM Loans L
WHERE L.dateReturn IS NULL)




-
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't start mysql

2003-03-01 Thread Stefan Hinz
John,

 I'm trying to install MySQL 3.23 on a RedHat Linux Version 8.0 box
 using RPMs. The install seems to go well, but the log file
 contains:

 mysqld: Can't find file: './mysql/host.frm'

 From the docs, I understand this happens because I haven't set up
 the grant tables, but how can I do that if I can't start the
 database? Seems like a Catch-22 situation!

All you have to do is set up the grant tables. You don't need a
running MySQL server for this. You can find details here:

http://www.mysql.com/doc/en/Post-installation.html

If you just want to see your MySQL server running, you can start it
like this:

mysqld --skip-grant-tables 

But be warned. This is VERY insecure. Everyone will have access to
your server without username and password. You can try yourself:

mysql

should give you an unrestricted mysql prompt (i.e. you can do
whatever you want; drop databases, create tables, etc.).

Regards,
--
  Stefan Hinz [EMAIL PROTECTED]
  iConnect GmbH http://iConnect.de
  Heesestr. 6, 12169 Berlin (Germany)
  Telefon: +49 30 7970948-0  Fax: +49 30 7970948-3

[filter fodder: sql, mysql, query]


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

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



RE: Best way to dump for daily archiving

2003-03-01 Thread Cal Evans
use the -opt flag. 

=C=

* Cal Evans
* Stay Plugged Into Your Audience
* http://www.christianperformer.com

-Original Message-
From: Scott Haneda [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 4:27 PM
To: MySql
Subject: Best way to dump for daily archiving


I wrote a sh script to use mysqldump to iterate through my databases and
dump them to .sql files, I am supplying no flags to mysqldump, and wonder,
is there a best way to dump your files, if the idea is they are backups
and to be used in the case of emergency.

-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com   Fax: 313.557.5052
[EMAIL PROTECTED]Novato, CA U.S.A.


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

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



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

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



RE: Best way to dump for daily archiving

2003-03-01 Thread Don Read

On 01-Mar-2003 Scott Haneda wrote:
 I wrote a sh script to use mysqldump to iterate through my databases and
 dump them to .sql files, I am supplying no flags to mysqldump, and wonder,
 is there a best way to dump your files, if the idea is they are backups
 and to be used in the case of emergency.
 

Here's what I use :

---
#!/bin/sh
#
# dump database(s) each day --table by table
#

DBS=auth sales ar ap gl misc
DUMP=$HOME/archive/database
DIR=`date +%a`

cd $DUMP
mkdir -p $DIR
rm -f Today
ln -sf $DIR Todayauth
cd $DIR

for K in $DBS
do
TBLS=`mysql -N -e show tables $K`
for I in $TBLS
do
mysqldump -e -q --add-drop-table $K $I  $K.$I.dmp
rm -rf $K.$I.dmp.gz
gzip $K.$I.dmp
done
done

---

This gives a 7 day rotation, Mon-Sun.
With the latest dump in the 'Today' directory.

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)

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

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



Re: Best way to dump for daily archiving

2003-03-01 Thread Scott Haneda
on 03/01/2003 3:03 PM, Cal Evans at [EMAIL PROTECTED] wrote:

 use the -opt flag.

Can you tell me how to add in the username as well, I get a
./bin/mysqldump: invalid option -- o error

Here is the pertinent line
 /usr/local/bin/mysqldump -uUserName $db  $location$db.sql

-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com   Fax: 313.557.5052
[EMAIL PROTECTED]Novato, CA U.S.A.


-
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: Deleting records while parsing query results (in Perl DBI)?

2003-03-01 Thread Don Read
ExpiryDate
On 28-Feb-2003 Jeff Snoxell wrote:
 Hi,
 
 If I run a mysql query then work through the results of that query one at a 
 time, deleting the record sometimes eg:
 
 while (my $href = $sth-fetchrow_hashref())
 {
if ($href-{'ExpiryDate'} eq '2003-02-22 00:00:00') {
  # Do something
  # then...
  $db-do(DELETE FROM MyTable WHERE ID=$href-{'ID'});
}
else {
  # Do something else
}
 }
 
 Does the DELETE cause a change in the results of the surrounding $sth 
 parsing loop?
 
 I know it would be best to do a:
 
 DELETE FROM MyTable WHERE ExpiryDate = whatever
 
 But I need to use the data to do some other stuff, only from those records 
 that are up for deletion.
 
 Any ideas?
 

Fetch all the IDs of interest into an array and loop on that.
In my libsql.pl I wrote a sub:

sub GetArray {
my $qry= shift;
my @na=();

my $res=SQLQuery($qry);
if ($res) {
 while (my(@row) = $res-fetchrow()) {
push( @na, $row[0]) ;
}
}
return(@na);
}

$tbl='mytable';
$qry=SELECT id FROM $tbl WHERE ExpiryDate='2003-02-22';

@ids=GetArray($qry);
while ( my(@id)= splice (@ids,0,64)) {
   $deleteqry=DELETE FROM $tbl WHERE id IN ( .join(',',@id) .);
   SQLQuery($deleteqry);
}

$qry=SELECT id FROM $tbl 
  WHERE ExpiryDate  DATE_ADD(CURRENT_DATE, INTERVAL 1 WEEK);

@ids=GetArray($qry);
while ( @id= splice (@ids,0,64)) {
   $weekqry=UPDATE $tbl SET foo='bar'
  WHERE id IN ( .join(',',@id) .);
   SQLQuery($weekqry);
}


Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)

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

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



RE: Very basic If statement problem

2003-03-01 Thread Don Read

On 28-Feb-2003 Stitchin wrote:
 
 This is so simple and basic, I must be missing something
 
 I have php code for displaying my embroidery designs on the web page.  It's
 going through the mySql database and the query to pull up all the designs
 for a
 chosen category works fine.  I have two fields in
 my database called applique and puffyfoam both are set up as tinyint(1)
 because all I'm storing there is a zero for no and a 1 for yes.
 
 But for the screen output I don't want these codes to show, I'd like a
 comment to show up.  So I set up this if statement to place the proper
 statement in a variable to be used in my echo statement (if both answers are
 no, I don't want to print oops, I just put that there to see where stuff was
 happening)...
 
 
 if($applique == 1 and $puffyfoam == 0)
{
   $message1 = Digitized for APPLIQUE;
}
elseif($applique == 0 and $puffyfoam == 1)
{
   $message1 = Digitized for PUFFY FOAM;
}
elseif($applique == 1 and $puffyfoam == 1)
{
   $message1 = Digitized for APPLIQUE and PUFFY FOAM;
}
else
{
   $message1 = oops;
}
 
 I have three records in this category that I've set up with answers to the
 two fields as 1,1 0,1 and 1,0 to see what message would show  none
 should show up as oops since none are 0,0.  I've also put the applique
 raw field data in my echo to see if it is pulling up the right answer as
 well ...
 
 The field is showing the correct field info for applique, they're showing up
 as 1,0,1 BUT every one of the designs are showing the message oops.  What
 am I doing wrong???
 
 TIA
 Renee :)
 
 

$vals=array(
'APPLIQUE',
'PUFFY FOAM',
'APPLIQUE and PUFFY FOAM'
);

$k=$applique + ($puffyfoam  1);

$message1='Digitized for ' .$vals[$k];


Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)

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

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



Re: Best way to dump for daily archiving

2003-03-01 Thread Gerald R. Jensen
Try ...

/usr/local/bin/mysqldump -uUserName --opt $db  $location$db.sql



- Original Message -
From: Scott Haneda [EMAIL PROTECTED]
To: Cal Evans [EMAIL PROTECTED]; MySql [EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 5:18 PM
Subject: Re: Best way to dump for daily archiving


on 03/01/2003 3:03 PM, Cal Evans at [EMAIL PROTECTED] wrote:

 use the -opt flag.

Can you tell me how to add in the username as well, I get a
./bin/mysqldump: invalid option -- o error

Here is the pertinent line
 /usr/local/bin/mysqldump -uUserName $db  $location$db.sql

-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com   Fax: 313.557.5052
[EMAIL PROTECTED]Novato, CA U.S.A.


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

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




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

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



Days in a month

2003-03-01 Thread Steffan A. Cline
Is there a function that I missed for calculating the number of days in a
month?


Steffan



MySQL
---
T E L  6 0 2 . 5 7 9 . 4 2 3 0 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline
[EMAIL PROTECTED] Phoenix, Az
http://www.ExecuChoice.net  USA
AIM : SteffanC  ICQ : 57234309
The Executive's Choice in Lasso driven Internet Applications
---



-
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: Days in a month

2003-03-01 Thread Paul DuBois
At 17:13 -0700 3/1/03, Steffan A. Cline wrote:
Is there a function that I missed for calculating the number of days in a
month?
No, but you can calculate it.  One way:
- Find the first of the month
- Add a month
- Subtract a day.  That gives you the last day of the month.
- Extract the day-of-the-month
Example:

SET @d = '2003-03-01';
SELECT @d,
DATE_SUB(
DATE_ADD(
DATE_SUB(@d,INTERVAL DAYOFMONTH(@d) - 1 DAY),
INTERVAL 1 MONTH),
INTERVAL 1 DAY)
AS 'last of month';
SELECT @d,
DAYOFMONTH(
DATE_SUB(
DATE_ADD(
DATE_SUB(@d,INTERVAL DAYOFMONTH(@d) - 1 DAY),
INTERVAL 1 MONTH),
INTERVAL 1 DAY)
)
AS 'days in month';
Which produces this output:

++---+
| @d | last of month |
++---+
| 2003-03-01 | 2003-03-31|
++---+
++---+
| @d | days in month |
++---+
| 2003-03-01 |31 |
++---+
Easy! :-)

There are other solutions.



Steffan



MySQL
---
T E L  6 0 2 . 5 7 9 . 4 2 3 0 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline
[EMAIL PROTECTED] Phoenix, Az
http://www.ExecuChoice.net  USA
AIM : SteffanC  ICQ : 57234309
The Executive's Choice in Lasso driven Internet Applications
---


-
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: Days in a month

2003-03-01 Thread Don Read

On 02-Mar-2003 Steffan A. Cline wrote:
 Is there a function that I missed for calculating the number of days in a
 month?
 

TO_DAYS()

mysql set @b:='2003-02-01';
Query OK, 0 rows affected (0.00 sec)

mysql set @e:='2003-03-01';
Query OK, 0 rows affected (0.00 sec)

mysql SELECT TO_DAYS(@e) - TO_DAYS(@b) as FebDays;
+-+
| FebDays |
+-+
|  28 |
+-+
1 row in set (0.00 sec)

Regards,
-- 
Don Read   [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
(53kr33t w0rdz: sql table query)

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

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



Mac OS X and database path

2003-03-01 Thread Bernardo Zuniga
Hello,

I'm a bit confused about where the database is located in Mac OS X. I 
was following the instructions in O'Reilly's boot using and Managing 
MySQL ad got to the point where I tried to do a select and output to a 
file. The command I ran was as follows:

SELECT * INTO OUTFILE 'books.dat'
FIELDS TERMINATED BY ','
FROM BOOK;
The book states that a test.dat file will exist n my drive at 
/usr/local/var/test/test.dat , yet no such file can be found. I don't 
even have that directory. My directory structure goes as far as 
/usr/local/ - then there is mysql-2.23.55 and an alias (mysql) that 
points to that directory. Inside mysql-2.23.55, i have a tests 
directory and a data directory which i cannot get into at the moment. 
So is the book wrong, or is it different for OS X now.

Any help is appreciated,
Thanks,
Bernardo Zuniga
-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Re: Mac OS X and database path

2003-03-01 Thread Paul DuBois
At 19:46 -0500 3/1/03, Bernardo Zuniga wrote:
Hello,

I'm a bit confused about where the database is located in Mac OS X. 
I was following the instructions in O'Reilly's boot using and 
Managing MySQL ad got to the point where I tried to do a select and 
output to a file. The command I ran was as follows:

SELECT * INTO OUTFILE 'books.dat'
FIELDS TERMINATED BY ','
FROM BOOK;
The book states that a test.dat file will exist n my drive at 
/usr/local/var/test/test.dat , yet no such file can be found. I 
don't even have that directory. My directory structure goes as far 
as /usr/local/ - then there is mysql-2.23.55 and an alias (mysql) 
that points to that directory. Inside mysql-2.23.55, i have a tests 
directory and a data directory which i cannot get into at the 
moment. So is the book wrong, or is it different for OS X now.
The file will be written in the database directory for the default database,
given a statement as you've written it.  That will be the file
/usr/local/var/test/books.dat (not test.dat) if the current database
is test and if the server's data directory is /usr/local/var/.  On
Mac OS X, it's probably not.  To find out where the database directory
actually is, go into mysql and issue this query:
SHOW VARIABLES LIKE 'datadir';

That will show you a pathname.  Your file will be in test/books.dat
under that.
Any help is appreciated,
Thanks,
Bernardo Zuniga


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


Re: Mac OS X and database path

2003-03-01 Thread Bernardo Zuniga
Thank you Paul,

That helped to clear things up. My guess was that the book was wrong 
and the path was different for OS X. The command worked fine, but 
apparently the files were never created for some reason. I will try 
this again.

thanks for your help,
Bernardo
On Saturday, March 1, 2003, at 08:37  PM, Paul DuBois wrote:
At 19:46 -0500 3/1/03, Bernardo Zuniga wrote:
Hello,

I'm a bit confused about where the database is located in Mac OS X. I 
was following the instructions in O'Reilly's boot using and Managing 
MySQL ad got to the point where I tried to do a select and output to 
a file. The command I ran was as follows:

SELECT * INTO OUTFILE 'books.dat'
FIELDS TERMINATED BY ','
FROM BOOK;
The book states that a test.dat file will exist n my drive at 
/usr/local/var/test/test.dat , yet no such file can be found. I don't 
even have that directory. My directory structure goes as far as 
/usr/local/ - then there is mysql-2.23.55 and an alias (mysql) that 
points to that directory. Inside mysql-2.23.55, i have a tests 
directory and a data directory which i cannot get into at the moment. 
So is the book wrong, or is it different for OS X now.
The file will be written in the database directory for the default 
database,
given a statement as you've written it.  That will be the file
/usr/local/var/test/books.dat (not test.dat) if the current database
is test and if the server's data directory is /usr/local/var/.  On
Mac OS X, it's probably not.  To find out where the database directory
actually is, go into mysql and issue this query:

SHOW VARIABLES LIKE 'datadir';

That will show you a pathname.  Your file will be in test/books.dat
under that.
Any help is appreciated,
Thanks,
Bernardo Zuniga


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




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


Re: Mac OS X and database path

2003-03-01 Thread Paul DuBois
At 21:38 -0500 3/1/03, Bernardo Zuniga wrote:
Thank you Paul,

That helped to clear things up. My guess was that the book was wrong 
and the path was different for OS X. The command worked fine, but 
apparently the files were never created for some reason. I will try 
this again.
Well, the book can't give a specific path that will be correct for
all systems.  I'd guess the authors were showing what the path
would be under certain conditions.
If the statement didn't produce an error message, then the file should
have been created.  Was there an error, or did the statement produce
a message indicating that it wrote a certain number of rows?
thanks for your help,
Bernardo
On Saturday, March 1, 2003, at 08:37  PM, Paul DuBois wrote:
At 19:46 -0500 3/1/03, Bernardo Zuniga wrote:
Hello,

I'm a bit confused about where the database is located in Mac OS 
X. I was following the instructions in O'Reilly's boot using and 
Managing MySQL ad got to the point where I tried to do a select 
and output to a file. The command I ran was as follows:

SELECT * INTO OUTFILE 'books.dat'
FIELDS TERMINATED BY ','
FROM BOOK;
The book states that a test.dat file will exist n my drive at 
/usr/local/var/test/test.dat , yet no such file can be found. I 
don't even have that directory. My directory structure goes as far 
as /usr/local/ - then there is mysql-2.23.55 and an alias (mysql) 
that points to that directory. Inside mysql-2.23.55, i have a 
tests directory and a data directory which i cannot get into at 
the moment. So is the book wrong, or is it different for OS X now.
The file will be written in the database directory for the default database,
given a statement as you've written it.  That will be the file
/usr/local/var/test/books.dat (not test.dat) if the current database
is test and if the server's data directory is /usr/local/var/.  On
Mac OS X, it's probably not.  To find out where the database directory
actually is, go into mysql and issue this query:
SHOW VARIABLES LIKE 'datadir';

That will show you a pathname.  Your file will be in test/books.dat
under that.
Any help is appreciated,
Thanks,
Bernardo Zuniga


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



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


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


Missing mysql.sock file

2003-03-01 Thread Graham Neal
Hello,

I must have installed mysql incorrectly because
my suse 8.0 server does not have a mysql.sock
file at all.
I installed mysql 3.23.48 from rpm packages
I installed
server
bench
client
Max
navigator
shared
and the required perl bench
What happened.

Can anyone email me a socket file?
Thx
--

Best Rgds

Graham Neal
Cozy MK-IV S/N: 874
http://www.cozybuilders.org/
http://www.cozyaircraft.com/


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


Anyone Used Visio With MySQL?

2003-03-01 Thread Chris Montgomery
Howdy,

I'm curious if anyone has used Visio with MySQL. I have Visio 2000
Developer edition and MySQL 3.23.54 on Win2k. Have successfully imported
two tables from my MySQL database into Visio to create a Database Model
Diagram. I then added several more tables and tried to run the Update
tool but it threw a slew of errors. Rather than post the list of errors
here, I thought I would first ask if anyone else has gotten the Database
Update tool to work from Visio or if you had problems. I'm relatively
new to using both Visio and MySQL.

Thanks.

-- 
Chris Montgomery
Airtight Web Services   http://www.airtightweb.com
Web Development, Web Project Management, Software Sales
210-490-2415


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

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



Re: Mac OS X and database path

2003-03-01 Thread Bernardo Zuniga
There were no errors and it listed a number of rows affected and a 
time. tried the command again and it said that the file already 
existed. The problem was the directory path that I was looking in. I 
couldn't see it in the GUI but in the terminal a find pointed me to the 
file. I wasn't able to figure out the directory right away but it is 
now clear. the path is /usr/local/mysql-2.23.55/data/[databasename]

thanks for the help.
Bernardo
On Saturday, March 1, 2003, at 09:47  PM, Paul DuBois wrote:
At 21:38 -0500 3/1/03, Bernardo Zuniga wrote:
Thank you Paul,

That helped to clear things up. My guess was that the book was wrong 
and the path was different for OS X. The command worked fine, but 
apparently the files were never created for some reason. I will try 
this again.
Well, the book can't give a specific path that will be correct for
all systems.  I'd guess the authors were showing what the path
would be under certain conditions.
If the statement didn't produce an error message, then the file should
have been created.  Was there an error, or did the statement produce
a message indicating that it wrote a certain number of rows?
thanks for your help,
Bernardo
On Saturday, March 1, 2003, at 08:37  PM, Paul DuBois wrote:
At 19:46 -0500 3/1/03, Bernardo Zuniga wrote:
Hello,

I'm a bit confused about where the database is located in Mac OS X. 
I was following the instructions in O'Reilly's boot using and 
Managing MySQL ad got to the point where I tried to do a select and 
output to a file. The command I ran was as follows:

SELECT * INTO OUTFILE 'books.dat'
FIELDS TERMINATED BY ','
FROM BOOK;
The book states that a test.dat file will exist n my drive at 
/usr/local/var/test/test.dat , yet no such file can be found. I 
don't even have that directory. My directory structure goes as far 
as /usr/local/ - then there is mysql-2.23.55 and an alias (mysql) 
that points to that directory. Inside mysql-2.23.55, i have a tests 
directory and a data directory which i cannot get into at the 
moment. So is the book wrong, or is it different for OS X now.
The file will be written in the database directory for the default 
database,
given a statement as you've written it.  That will be the file
/usr/local/var/test/books.dat (not test.dat) if the current database
is test and if the server's data directory is /usr/local/var/.  On
Mac OS X, it's probably not.  To find out where the database 
directory
actually is, go into mysql and issue this query:

SHOW VARIABLES LIKE 'datadir';

That will show you a pathname.  Your file will be in test/books.dat
under that.
Any help is appreciated,
Thanks,
Bernardo Zuniga


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



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


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




-
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


update question

2003-03-01 Thread chip wiegand
I need to make a change to a field in a table and don't know how to
write the correct sql statement. I made an error and now have a date
field with the year repeated twice - 01-01-03-03 - there are
aproximately 100 rows like this, and maybe 20 or so that are formatted
properly. How can I remove the last 3 characters while leaving other
rows that do not have this problem alone? (other than manaully editing
each row of course)
Thanks,
Chip W.
www.wiegand.org

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

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



How to connect to mysql server without myODBC

2003-03-01 Thread Liu Qianghua-qch1942
All,

I want to develop application with Delphi which can connect to remote mysql server. 
Whether I must install myODBC? If are there another way, please tell me? Thanks.

Best Regards,

Q.H. Liu 

-
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: update question

2003-03-01 Thread Tore Bostrup
I assume you are storing your dates in a char/varchar column - not a good
choice to start with... :-

Assuming all the values are supposed to be stored as MM-DD-YY (anothoer
marginal choice, but the problem may not rear its head again for another 96+
years), you can do the following:

UPDATE mytable
SET mydatestr = LEFT(mydatestr, LENGTH(mydatestr) - 3)
WHERE mydatestr LIKE '__-__-__-__'

HTH,
Tore.

- Original Message -
From: chip wiegand [EMAIL PROTECTED]
To: mysql [EMAIL PROTECTED]
Sent: Sunday, March 02, 2003 1:46 AM
Subject: update question


 I need to make a change to a field in a table and don't know how to
 write the correct sql statement. I made an error and now have a date
 field with the year repeated twice - 01-01-03-03 - there are
 aproximately 100 rows like this, and maybe 20 or so that are formatted
 properly. How can I remove the last 3 characters while leaving other
 rows that do not have this problem alone? (other than manaully editing
 each row of course)
 Thanks,
 Chip W.
 www.wiegand.org

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

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



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

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



Crazy SELECT SUM ... JOIN ... GROUP problem

2003-03-01 Thread Dan Tappin
Oops... forgot the subject line...

I have a complex JOIN statement that I can't seem to get to work.

Here is my schema...

I have a 'forsale' table with various colunms. Here is the query for  
the data I am interested in:

SELECT
id,
clientid,
price
FROM
forsale
WHERE user_id = 152
+--+-++
|id|clientid |price   |
+--+-++
| 2863 | 317 |  27500 |
| 2864 | 317 |  5 |
| 2865 | 317 |  24000 |
| 2866 | 317 |   2315 |
| 2867 | 317 |   7968 |
| 2868 | 317 |  0 |
| 2869 | 317 |  0 |
| 2872 |  51 |  0 |
+--+-++
8 rows selected.

Each 'forsale' row has an associated clientid which I want to GROUP BY  
to make a summary like this:

SELECT
clientid,
SUM(price)
FROM
forsale
WHERE user_id = 152
GROUP BY clientid
+-+---+
|clientid |SUM(price) |
+-+---+
|  51 |   |
| 317 | 111783|
+-+---+
2 rows selected.

Now I also have a 'forsale_log' table that tracks the number of hits a  
particular 'forsale' row gets on the web side of things:

SELECT
forsale.id,
forsale.clientid,
forsale.price,
COUNT(forsale_log.id) as hits
FROM
forsale
LEFT JOIN forsale_log
ON forsale_log.forsaleid = forsale.id
WHERE user_id = 152
GROUP BY forsale.id
+--+-+ 
+---+
|id|clientid |price   |hits  
  |
+--+-+ 
+---+
| 2863 | 317 |  27500 |  
2 |
| 2864 | 317 |  5 |  
1 |
| 2865 | 317 |  24000 |  
1 |
| 2866 | 317 |   2315 |  
2 |
| 2867 | 317 |   7968 |  
2 |
| 2868 | 317 |  0 |  
4 |
| 2869 | 317 |  0 |  
5 |
| 2872 |  51 |  0 |  
0 |
+--+-+ 
+---+

8 rows selected.

Now if I go and try to GROUP BY the clientid again to get a summary of  
both the hits AND total price I get crazy results:

SELECT
forsale.clientid,
SUM(forsale.price),
COUNT(forsale_log.id) as hits
FROM
forsale
LEFT JOIN forsale_log
ON forsale_log.forsaleid = forsale.id
WHERE user_id = 152
GROUP BY forsale.clientid
+-++---+
|clientid |SUM(forsale.price)  |hits   |
+-++---+
|  51 || 0 |
| 317 | 149566 |17 |
+-++---+
2 rows selected.

The hits are correct but the price total is wrong and it is out by  
factors of the individual 'forsale' items individual 'hits'.

I am sure I just have the wrong JOIN structure but I can't figure it  
out.  Any help would be appreciated.

Thanks,

Dan

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


RE: SELECT DISTINCT question

2003-03-01 Thread Uttam

*DISTINCT omits data bases on selected fields only.  i.e. if you have
thousand rows having different dates in 'mydate' but all having year 2002,
then SELECT DISITNCT YEAR(mydate) will return only 1 row i.e. 2002.

* DISTINCTROW omits data based on entire duplicate records, not just
duplicate fields.

regds,
-Original Message-
From: Sheryl Canter [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 01:56
To: Juan Nin; [EMAIL PROTECTED]
Subject: Re: SELECT DISTINCT question


So depending on which columns you were looking at, two rows might seem
like
duplicates or not? If your SELECT statement only requested certain
fields,
your result set might have duplicates that wouldn't be duplicates if you
were looking at other columns as well? Is this correct?

So if I had this in a table:

pet name age

dogSpot  5
dogFluffy5
cat Clara 3

and I did

SELECT DISTINCT pet, age

I'd get back just two rows.

If I did this:

SELECT DISTINCT *

I'd get back all three rows.

Am I understanding this correctly?

- Sheryl


mysql

- Original Message -
From: Juan Nin [EMAIL PROTECTED]
To: Sheryl Canter [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, February 28, 2003 2:42 PM
Subject: Re: SELECT DISTINCT question


From: Sheryl Canter [EMAIL PROTECTED]

  DISTINCT removes duplicates: rows that are the same in *all*
columns.

 Would this be all columns in the table, or all columns retrieved by
the
 SELECT statement?

in the SELECT statement  :)

SELECTs do not alter your rows, you can only do that with update or
delete

regards,

Juan






-
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: A Simple Query!

2003-03-01 Thread Uttam
here's my version of the answer:

SELECT
F.idFilm, F.title
FROM
Films F LEFT JOIN Loans L ON F.idFilm = L.idFilm
WHERE
(L.idFilm IS NULL) OR (L.dateReutrn IS NULL)
;

regds,

-Original Message-
From: Bruce Feist [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 08:13
To: [EMAIL PROTECTED]
Subject: Re: A Simple Query!


Hello, Remi;

Try this; I *think* it'll work (but I'm also new to MySQL):

select F.idFilm, F.title
from Films F left join Loans L on F.idFilm = L.idFilm and L.dateReturn
IS NULL
where L.idFilm IS NULL;

This provides an interesting example of the difference between on and
where, by the way; it looks self-contradictory, but shouldn't be.
Because of the left join, the on should pick up Films without
matching Loans, and set the Loans.idFilm to NULL to show that it did.

Bruce Feist

Remi Mikalsen wrote:

I believe, and hope, I have a very simple question, but as I am
relatively new to 
MySQL I might be missing out on the obvious solution.

Is it possible to use a single MySQL query (with the simple scheme
presented) to 
ask the following question?

Scheme:
   Films (idFilm, title)
   Loans (idFilm, dateLoan, dateReturn, idContact, idLoan)
   Contacts (idContact, name)

Question:
   What films aren't on loan right now? 

Using the SQL standards it should be possible to write the following
query.

SELECT F.idFilm, F.title
FROM Films F
WHERE F.idFilm NOT IN (SELECT L.idFilm
   FROM Loans L
   WHERE L.dateReturn IS NULL)
  








-
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: permissions error for the slave server

2003-03-01 Thread Dan Rossi
hi there my sql slave server cannot replicate as its getting permissions
errors dont know what happened but its not happy now

030302  7:09:24  Slave I/O thread killed while connecting to master
030302  7:09:24  Slave I/O thread exiting, read up to log 'FIRST', position
4
030302  7:09:29  Slave I/O thread: error connecting to master
'[EMAIL PROTECTED]:3306': Error: 'Access denied for
user: '[EMAIL PROTECTED]' (Using password: YES)'  errno: 1045
retry-time: 60  retries: 86400

i did this on the master

GRANT REPLICATION SLAVE, RELOAD, SUPER ON *.* TO [EMAIL PROTECTED]
IDENTIFIED BY '*';



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

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



Query selected with php

2003-03-01 Thread Andrew
Dear Mysql guru's

I have a sneaky suspision that the my current problem is related!

I want to display

There are '$number of records' in '$the city you have selected'

However this is proving to be beyond my brains capacity to deal with :p

So,if any of you can spot what the obvious mistakes I am making I would
appreciate it very much.  This is the situation and schema.

form selects city and category:

!-- Include Left Menu Options Here --
table width=146 border=0 cellpadding =0 cellspacing=0
 tr class=navTabletd class=bgColorDark height=18
  span class=HeaderSelect City and Business/span

 /td
/tr

tr
 td

form action='./companies.php' method='POST' name='CompanySearch'
  input type='hidden' name='CompanySearch' value='YES' /
  input type='hidden' name='CompanySearch' value='Simple' /

?
require(connection.php);

mysql_connect($DBHost, $DBUser, $DBPass) or
die(could not connect);
mysql_select_db($DBName);

echo select name=\CityID\ size=\1\ class='menuForm';

$result=mysql_query(SELECT City, CityID FROM city ORDER BY City);
while ($row = mysql_fetch_array($result))
{
$city_id=$row['CityID'];
$city=$row['City'];
echo option value=\$city_id\ $city /option;
}
echo /select;
?
br
?

mysql_connect($DBHost, $DBUser, $DBPass) or
die(could not connect);
mysql_select_db($DBName);

echo select name=\Category\ size=\1\ class='menuForm';

$result=mysql_query(SELECT Category, CategoryID FROM category ORDER BY
Category);
while ($row = mysql_fetch_array($result)) {
echo option value=\$row[CategoryID]\ $row[Category] /option;
}
echo /select;
?

 /td
/tr

tr class=navTable
 td class=bgColorMid
  table cellpadding=0 cellspacing=0 border=0 width=100%
   tr
td align=right

input class=inputsubmit type=submit value=Find Company

INPUT TYPE=image SRC=search.gif VALUE=find a company in your city
Name=companysearch



/a

 /tr
/table
   /td
  /tr
 /form
/table


resluts appear here:

!--BEGINNING OF MIDDLE COLUMN --
TD align=left valign=top class=grayfill

div class=subheadernbsp;
/div !-- BEGINNING MIDDLE TABLE --

?
$result=mysql_query(SELECT
items.*, city.City
FROM
items, city
WHERE
items.Category='$Category'
AND items.CityID='$CityName'
AND items.CityID=21
ORDER BY
City
);

while ($row=mysql_query($result)) {

$CityName=$row['0'];
$CityID=$row['1'];
}


?TABLE cellpadding=5 cellspacing=3 width=\100%\ border=0
   TD valign=\top\ align=\left\ class=\city\

? echo There were ??? companies found in $CityID are:;
?/TD
TD valign=\top\ align=\left\ class=\companydesc\

?
$result=mysql_query(SELECT items.ItemSKU, items.ItemName,
items.ItemDescription, items.PostCode, items.Category, items.CityID,
items.CTelephone, items.ItemID, items.Cfax, items.Cemail, items.Caddress,
items.CTown, items.Cwww FROM items WHERE CityID='$CityID' ORDER BY CityID);

while ($row  =  mysql_fetch_row($result)) {

$City=$row['5'];
}
/* Image here */
echo img src=\$Relative/images/city/city.$City.\;

/* Image will END here */
?
/TD
/TR
/TABLE



?
$result=mysql_query(SELECT items.ItemSKU, items.ItemName,
items.ItemDescription, items.PostCode, items.Category, items.CityID,
items.CTelephone, items.ItemID, items.Cfax, items.Cemail, items.Caddress,
items.CTown, items.Cwww FROM items WHERE Category='$Category' and
CityID='$CityID' ORDER BY CityID);
if (!$result) echo mysql_error();
else {
}
while ($row=mysql_fetch_row($result)) {
$IS=$row['0'];
$IN=$row['1'];
$ID=$row['2'];
$CpostC=$row['3'];
$Ca=$row['4'];
$City=$row['5'];
$Ctele=$row['6'];
$II=$row['7'];
$Cf=$row['8'];
$Ce=$row['9'];
$Caddress=$row['10'];
$Ctown=$row['11'];
$Cw=$row['12'];

echo div class='subheader'nbsp;$IN ;
echo /div;

echo div class='frontPageContentBox';

echo TABLE cellpadding=5 cellspacing=3 width=\100%\ border=2;
echo TR;
echo TD valign=\top\ align=\left\ class=\company\ width=\70%\;
echo B$IN/BBR;

echo a: $CaddressBR;
echo a: $CtownBR;

echo p: $CpostCBR;
echo t:b $Ctele /bBR;

echo /TD;

echo TD valign=\top\ align=\left\ class=\companydesc\ width=\30%\;
echo /TD;
echo /TR;
echo /TABLE;
echo BR\n\n;



echo /div;

}

?

!-- Middle TD ends here --


It ius this thats casuiing the headache:  and I think it is related to not
having a selected clause in the resulte

?
$result=mysql_query(SELECT
items.*, city.City
FROM
items, city
WHERE
items.Category='$Category'
AND items.CityID='$CityName'
AND items.CityID=21
ORDER BY
City
);

while ($row=mysql_query($result)) {

$CityName=$row['0'];
$CityID=$row['1'];
}


?TABLE cellpadding=5 cellspacing=3 width=\100%\ border=0
   TD valign=\top\ align=\left\ class=\city\

? echo There were ??? companies found in $CityID are:;
?/TD

???
Andrew



-
Before posting, please check:
   

RE: Query selected with php

2003-03-01 Thread Peter Lovatt

$result=mysql_query(SELECT
items.*, city.City
FROM
items, city
WHERE
items.Category='$Category'
AND items.CityID='$CityName'
AND items.CityID=21
ORDER BY
City
);

while ($row=mysql_query($result)) {   ==this is a/the problem, I think,
wrong function :)

$CityName=$row['0'];
$CityID=$row['1'];
}


should be

$result=mysql_query(SELECT
items.*, city.City
FROM
items, city
WHERE
items.Category='$Category'
AND items.CityID='$CityName'
AND items.CityID=21
ORDER BY
City
);

while ($row=mysql_fetch_row($result)) {   == should be

$CityName=$row['0'];
$CityID=$row['1'];
}



-Original Message-
From: Andrew [mailto:[EMAIL PROTECTED]
Sent: 01 March 2003 11:55
To: MySQL-Lista
Subject: Query selected with php


Dear Mysql guru's

I have a sneaky suspision that the my current problem is related!

I want to display

There are '$number of records' in '$the city you have selected'

However this is proving to be beyond my brains capacity to deal with :p

So,if any of you can spot what the obvious mistakes I am making I would
appreciate it very much.  This is the situation and schema.

form selects city and category:

!-- Include Left Menu Options Here --
table width=146 border=0 cellpadding =0 cellspacing=0
 tr class=navTabletd class=bgColorDark height=18
  span class=HeaderSelect City and Business/span

 /td
/tr

tr
 td

form action='./companies.php' method='POST' name='CompanySearch'
  input type='hidden' name='CompanySearch' value='YES' /
  input type='hidden' name='CompanySearch' value='Simple' /

?
require(connection.php);

mysql_connect($DBHost, $DBUser, $DBPass) or
die(could not connect);
mysql_select_db($DBName);

echo select name=\CityID\ size=\1\ class='menuForm';

$result=mysql_query(SELECT City, CityID FROM city ORDER BY City);
while ($row = mysql_fetch_array($result))
{
$city_id=$row['CityID'];
$city=$row['City'];
echo option value=\$city_id\ $city /option;
}
echo /select;
?
br
?

mysql_connect($DBHost, $DBUser, $DBPass) or
die(could not connect);
mysql_select_db($DBName);

echo select name=\Category\ size=\1\ class='menuForm';

$result=mysql_query(SELECT Category, CategoryID FROM category ORDER BY
Category);
while ($row = mysql_fetch_array($result)) {
echo option value=\$row[CategoryID]\ $row[Category] /option;
}
echo /select;
?

 /td
/tr

tr class=navTable
 td class=bgColorMid
  table cellpadding=0 cellspacing=0 border=0 width=100%
   tr
td align=right

input class=inputsubmit type=submit value=Find Company

INPUT TYPE=image SRC=search.gif VALUE=find a company in your city
Name=companysearch



/a

 /tr
/table
   /td
  /tr
 /form
/table


resluts appear here:

!--BEGINNING OF MIDDLE COLUMN --
TD align=left valign=top class=grayfill

div class=subheadernbsp;
/div !-- BEGINNING MIDDLE TABLE --

?
$result=mysql_query(SELECT
items.*, city.City
FROM
items, city
WHERE
items.Category='$Category'
AND items.CityID='$CityName'
AND items.CityID=21
ORDER BY
City
);

while ($row=mysql_query($result)) {

$CityName=$row['0'];
$CityID=$row['1'];
}


?TABLE cellpadding=5 cellspacing=3 width=\100%\ border=0
   TD valign=\top\ align=\left\ class=\city\

? echo There were ??? companies found in $CityID are:;
?/TD
TD valign=\top\ align=\left\ class=\companydesc\

?
$result=mysql_query(SELECT items.ItemSKU, items.ItemName,
items.ItemDescription, items.PostCode, items.Category, items.CityID,
items.CTelephone, items.ItemID, items.Cfax, items.Cemail, items.Caddress,
items.CTown, items.Cwww FROM items WHERE CityID='$CityID' ORDER BY CityID);

while ($row  =  mysql_fetch_row($result)) {

$City=$row['5'];
}
/* Image here */
echo img src=\$Relative/images/city/city.$City.\;

/* Image will END here */
?
/TD
/TR
/TABLE



?
$result=mysql_query(SELECT items.ItemSKU, items.ItemName,
items.ItemDescription, items.PostCode, items.Category, items.CityID,
items.CTelephone, items.ItemID, items.Cfax, items.Cemail, items.Caddress,
items.CTown, items.Cwww FROM items WHERE Category='$Category' and
CityID='$CityID' ORDER BY CityID);
if (!$result) echo mysql_error();
else {
}
while ($row=mysql_fetch_row($result)) {
$IS=$row['0'];
$IN=$row['1'];
$ID=$row['2'];
$CpostC=$row['3'];
$Ca=$row['4'];
$City=$row['5'];
$Ctele=$row['6'];
$II=$row['7'];
$Cf=$row['8'];
$Ce=$row['9'];
$Caddress=$row['10'];
$Ctown=$row['11'];
$Cw=$row['12'];

echo div class='subheader'nbsp;$IN ;
echo /div;

echo div class='frontPageContentBox';

echo TABLE cellpadding=5 cellspacing=3 width=\100%\ border=2;
echo TR;
echo TD valign=\top\ align=\left\ class=\company\ width=\70%\;
echo B$IN/BBR;

echo a: $CaddressBR;
echo a: $CtownBR;

echo p: $CpostCBR;
echo t:b $Ctele /bBR;

echo /TD;

echo TD 

Re: Connector J (3.1.0) - invalid return upon select last_insert_id()

2003-03-01 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Tea Yu wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Tea Yu wrote:

Hi there!

Sorry, cause I didn't copy-n-paste those so there were typos, actually I
created the table in console:
1) create table test (id INTEGER NOT NULL AUTO_INCREMENT, name
VARCHAR(255),

primary key (id));

2) here is the code segment

 String insertStmt = insert into test (name) values ('hi');
 String queryStmt = select last_insert_id();
 try {
  stmt.executeUpdate(insertStmt);
  ResultSet rs = stmt.executeQuery(queryStmt);
  if(rs.next())
   System.out.println(last insert id:  + rs.getInt(1));
 } catch (SQLException e) {
  System.out.println(e);
 }
if
a) I comment out the rs.getInt(1) line, no exception throws... else it
throws something like
   java.sql.SQLException: Invalid value for getInt() - 't'
b) if I use getString(1) instead, no exception throws...
   but it returns t, u or something
3) I tried to insert records thru MySQLCC without errors.

More thoughts?

Regards
Tea
The only thing I can guess (because my testsuite is really the same
code, I just don't store the queries in variables), is that 'queryStmt'
does not hold the query you think it does. Try inspecting it in a
debugger or printing it out before you execute the query, to see what
query you are really executing.
-mark


Not really, I substituted the queryStmt with the actual one but it gave the
same result.
After some work:

select last_insert_id();//getInt() should return 14
//but now it gives
java.sql.SQLException: Invalid value for getInt() - 'qt'
 at com.mysql.jdbc.ResultSet.getInt(ResultSet.java:1348)
where thisRow([0]) that ResultSet holds was = (49, 52)

I haven't looked deeper into ResultSet and StringUtils... Is this as
expected?
My platform is WinME and my JRE is 1.4.1_01

thanks
tea
The only way I can debug this is if you give me a repeatable test case. 
Since the test case I showed you does not repeat the bug, you will need 
to generate a standalone test case, with schema, data, and the java code 
that demonstrates the issue.

	-Mark

- -- 
MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /  Mark Matthews [EMAIL PROTECTED]
  / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
 /_/  /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
___/ www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE+YKwMtvXNTca6JD8RAgyPAKCFkk9RmrJ0y/P3qm/e7uXdYs1OhwCfZdHN
V3Nhbe7Nv/YveuN84OEsZHQ=
=EMfY
-END PGP SIGNATURE-
-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


NullPointerException in Connector/J 2.0.14

2003-03-01 Thread Holger Wiechert
This is a reposting since I haven't got any answer yet.
It is about the NullPointerException in class Connection
of MySQL Connector/J 2.0.14.

I just changed the driver to MySQL Connector/J 2.0.14.
But I'm still getting this NullPointerException once in
a while. The new StackTrace is:

java.lang.NullPointerException
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.Connection.setAutoCommit(Unknown Source)
at
org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnect
ion.java:237)
at
org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableCon
nectionFactory.java:273)
at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown
Source)
at
org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool
.java:117)
at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.ja
va:110)
at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:3
12)
at
org.apache.struts.util.GenericDataSource.getConnection(GenericDataSource.jav
a:276)
at de.mytest.fe.BaseAction.getConnection(BaseAction.java:36)


The application works for a long time and the exception occurs just
once in a while. I still don't know where to look for the cause.
The application gets its connections through a DataSource defined in
Struts' config file (struts-config.xml), which in turn uses Jakarta's
DBCP 1.0 (Database Connection Pool). I'm using Struts 1.1b2.

The parameters for the DataSource are as follows:
data-source
  set-property property=autoCommit
   value=true/
  set-property property=description
   value=Data Source for MySQL/
  set-property property=driverClass
   value=org.gjt.mm.mysql.Driver/
  set-property property=maxCount
   value=10/
  set-property property=minCount
   value=2/
  set-property property=password
   value=***/
  set-property property=url

value=jdbc:mysql://localhost:3306/somedb?autoReconnect=true/
  set-property property=user
   value=**/
  set-property property=autoReconnect
   value=true/
/data-source

(The double autoReconnect was used to make sure, DBCP auto reconnects.
Since we have no access to the Servers, we couldn't figure out, which one
does the job -- the one in the url, or the extra paramter. However, this
is not the problem. AutoReconnect works).

Help greatly appreciated!
Thanks in advance,
Holger


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Holger Wiechert wrote:
 Hi,

 I'm having a quite serious problem. I wrote a web application that uses
 MySQL via ConnectorJ V2.0.6 in combination with Apache's DBCP 1.0
 (Jakarta Commons Database Connection Pool).
 The web application is installed on a server, I don't have access to.
 The same for the MySQL server.
 Once in a while, I get a NullPointerException and have no clue about
 the reason: DBCP, the JDBC driver, or MySQL.
 Once the exception occurred, it comes up with every new connection
 retrieval.
 I really wonder about the NullPointerexception, which seems to me like
 a ConnectorJ-Bug, but I'm not sure at all.

 java.lang.NullPointerException
   at org.gjt.mm.mysql.Connection.execSQL(Connection.java:863)
   at org.gjt.mm.mysql.Connection.execSQL(Connection.java:857)
   at org.gjt.mm.mysql.Connection.setAutoCommit(Connection.java:474)

Connector/J Package Names start with com.mysql.jdbc

This is not MySQL Connector/J, it is MM.MySQL, which is what MySQL
Connector/J used to be called (and a rather old version at that).

Please try upgrading to MySQL Connector/J 2.0.14 or 3.0.5 from
http://www.mysql.com/products/connector-j/ and see if your problem goes
away.

-Mark




Virus checked by G DATA AntiVirusKit
Virus news: www.antiviruslab.com


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

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



update/delete bug, please fix, thank you!

2003-03-01 Thread root
Description:
Dear sir,
   When I execute the command select * from user_info where regdate  now()- interval 
9 day and phone_confirmed is null and email is null and last_onlinenow()-interval 10 
day got 770 rows result.
But when I execute update user_info set email=1 where regdate  now()- interval 9 
day and phone_confirmed is null and email is null and last_onlinenow()-interval 10 
day got 0 rows is updated.
 
Also delete from user_info where regdate  now()- interval 9 day and phone_confirmed 
is null and email is null and last_onlinenow()-interval 10 day got nothing is 
deleted.
 
Is there anything wrong on the update and delete command? Or it just a bug of MySQL 
server?
Thank you!
 
PS : I have tested it on MySQL Server 4.010, and 4.011.
-
| user_info |CREATE TABLE `user_info` (
  `uid` mediumint(8) unsigned NOT NULL auto_increment,
  `gid` mediumint(8) unsigned NOT NULL default '0',
  `phone_confirmed` char(0) default NULL,
  `username` varchar(20) binary NOT NULL default '',
  `nickname` varchar(20) binary NOT NULL default '',
  `title` varchar(12) NOT NULL default '´¶³q·|­û',
  `passwd` varchar(20) binary NOT NULL default '',
  `email` varchar(50) default NULL,
  `icq` int(10) unsigned NOT NULL default '0',
  `country` char(2) NOT NULL default 'HK',
  `district` varchar(20) NOT NULL default '',
  `sex` enum('M','F') NOT NULL default 'M',
  `occupation` varchar(20) NOT NULL default '',
  `interest` varchar(20) NOT NULL default '',
  `homepage` varchar(60) NOT NULL default '',
  `homepage_name` varchar(60) NOT NULL default '',
  `regdate` date NOT NULL default '-00-00',
  `plogo` varchar(132) NOT NULL default '',
  `signature` text NOT NULL,
  `ip` varchar(15) NOT NULL default '',
  `last_online` datetime NOT NULL default '-00-00 00:00:00',
  `last_topic` varchar(80) NOT NULL default '',
  `post_total` mediumint(8) unsigned NOT NULL default '0',
  `aver_on_time` smallint(5) unsigned NOT NULL default '0',
  `today_on_time` smallint(5) unsigned NOT NULL default '0',
  `last_31d_on_time` varchar(156) NOT NULL default '',
  `last_12m_on_time` varchar(60) NOT NULL default '',
  `about` text NOT NULL,
  PRIMARY KEY  (`username`),
  UNIQUE KEY `nickname` (`nickname`),
  UNIQUE KEY `uid` (`uid`),
  UNIQUE KEY `email` (`email`)
) TYPE=MyISAM
 
How-To-Repeat:

Fix:


Submitter-Id:  submitter ID
Originator:root
Organization:
 
MySQL support: [none | licence | email support | extended email support ]
Synopsis:  update/delete does not work
Severity:  
Priority:  
Category:  mysql
Class: 
Release:   mysql-4.0.11-gamma (Official MySQL RPM)

C compiler:2.95.3
C++ compiler:  2.95.3
Environment:

System: Linux ip-83-99-134-202.rev.dyxnet.com 2.4.18-14smp #1 SMP Wed Sep 4 12:34:47 
EDT 2002 i686 i686 i386 GNU/Linux
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/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking 
--host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
Compilation info: CC='gcc'  CFLAGS='-O6 -fno-omit-frame-pointer -mpentium'  CXX='g++'  
CXXFLAGS='-O6 -fno-omit-frame-pointer  -felide-constructors 
-fno-exceptions -fno-rtti -mpentium'  LDFLAGS=''  ASFLAGS=''
LIBC: 
lrwxrwxrwx1 root root   14 Jan 23 11:25 /lib/libc.so.6 - 
libc-2.2.93.so
-rwxr-xr-x1 root root  1235468 Sep  6 07:12 /lib/libc-2.2.93.so
-rw-r--r--1 root root  2233342 Sep  6 06:59 /usr/lib/libc.a
-rw-r--r--1 root root  178 Sep  6 06:50 /usr/lib/libc.so
Configure command: ./configure '--disable-shared' '--with-mysqld-ldflags=-all-static' 
'--with-client-ldflags=-all-static' '--without-berkeley-db' '--with-innodb' 
'--without-vio' '--without-openssl' '--enable-assembler' '--enable-local-infile' 
'--with-mysqld-user=mysql' '--with-unix-socket-path=/var/lib/mysql/mysql.sock' 
'--prefix=/' '--with-extra-charsets=complex' '--exec-prefix=/usr' 
'--libexecdir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 
'--localstatedir=/var/lib/mysql' '--infodir=/usr/share/info' 
'--includedir=/usr/include' '--mandir=/usr/share/man' '--with-embedded-server' 
'--enable-thread-safe-client' '--with-comment=Official MySQL RPM' 'CFLAGS=-O6 
-fno-omit-frame-pointer -mpentium' 'CXXFLAGS=-O6 -fno-omit-frame-pointer   
 -felide-constructors -fno-exceptions -fno-rtti -mpentium'


-
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 

update/delete bug, please fix, thank you!

2003-03-01 Thread miniwar
Description:
Dear sir,
   When I execute the command select * from user_info where regdate  now()- interval 
9 day and phone_confirmed is null and email is null and last_onlinenow()-interval 10 
day got 770 rows result.
But when I execute update user_info set email=1 where regdate  now()- interval 9 
day and phone_confirmed is null and email is null and last_onlinenow()-interval 10 
day got 0 rows is updated.
 
Also delete from user_info where regdate  now()- interval 9 day and phone_confirmed 
is null and email is null and last_onlinenow()-interval 10 day got nothing is 
deleted.
 
Is there anything wrong on the update and delete command? Or it just a bug of MySQL 
server?
Thank you!
 
PS : I have tested it on MySQL Server 4.010, and 4.011.
-
| user_info |CREATE TABLE `user_info` (
  `uid` mediumint(8) unsigned NOT NULL auto_increment,
  `gid` mediumint(8) unsigned NOT NULL default '0',
  `phone_confirmed` char(0) default NULL,
  `username` varchar(20) binary NOT NULL default '',
  `nickname` varchar(20) binary NOT NULL default '',
  `title` varchar(12) NOT NULL default '´¶³q·|­û',
  `passwd` varchar(20) binary NOT NULL default '',
  `email` varchar(50) default NULL,
  `icq` int(10) unsigned NOT NULL default '0',
  `country` char(2) NOT NULL default 'HK',
  `district` varchar(20) NOT NULL default '',
  `sex` enum('M','F') NOT NULL default 'M',
  `occupation` varchar(20) NOT NULL default '',
  `interest` varchar(20) NOT NULL default '',
  `homepage` varchar(60) NOT NULL default '',
  `homepage_name` varchar(60) NOT NULL default '',
  `regdate` date NOT NULL default '-00-00',
  `plogo` varchar(132) NOT NULL default '',
  `signature` text NOT NULL,
  `ip` varchar(15) NOT NULL default '',
  `last_online` datetime NOT NULL default '-00-00 00:00:00',
  `last_topic` varchar(80) NOT NULL default '',
  `post_total` mediumint(8) unsigned NOT NULL default '0',
  `aver_on_time` smallint(5) unsigned NOT NULL default '0',
  `today_on_time` smallint(5) unsigned NOT NULL default '0',
  `last_31d_on_time` varchar(156) NOT NULL default '',
  `last_12m_on_time` varchar(60) NOT NULL default '',
  `about` text NOT NULL,
  PRIMARY KEY  (`username`),
  UNIQUE KEY `nickname` (`nickname`),
  UNIQUE KEY `uid` (`uid`),
  UNIQUE KEY `email` (`email`)
) TYPE=MyISAM

How-To-Repeat:

Fix:


Submitter-Id:  submitter ID
Originator:root
Organization:
 
MySQL support: [none | licence | email support | extended email support ]
Synopsis:  update/delete bug
Severity:  
Priority:  
Category:  mysql
Class: 
Release:   mysql-4.0.11-gamma (Official MySQL RPM)

C compiler:2.95.3
C++ compiler:  2.95.3
Environment:

System: Linux ip-83-99-134-202.rev.dyxnet.com 2.4.18-14smp #1 SMP Wed Sep 4 12:34:47 
EDT 2002 i686 i686 i386 GNU/Linux
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/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man 
--infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking 
--host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
Compilation info: CC='gcc'  CFLAGS='-O6 -fno-omit-frame-pointer -mpentium'  CXX='g++'  
CXXFLAGS='-O6 -fno-omit-frame-pointer  -felide-constructors 
-fno-exceptions -fno-rtti -mpentium'  LDFLAGS=''  ASFLAGS=''
LIBC: 
lrwxrwxrwx1 root root   14 Jan 23 11:25 /lib/libc.so.6 - 
libc-2.2.93.so
-rwxr-xr-x1 root root  1235468 Sep  6 07:12 /lib/libc-2.2.93.so
-rw-r--r--1 root root  2233342 Sep  6 06:59 /usr/lib/libc.a
-rw-r--r--1 root root  178 Sep  6 06:50 /usr/lib/libc.so
Configure command: ./configure '--disable-shared' '--with-mysqld-ldflags=-all-static' 
'--with-client-ldflags=-all-static' '--without-berkeley-db' '--with-innodb' 
'--without-vio' '--without-openssl' '--enable-assembler' '--enable-local-infile' 
'--with-mysqld-user=mysql' '--with-unix-socket-path=/var/lib/mysql/mysql.sock' 
'--prefix=/' '--with-extra-charsets=complex' '--exec-prefix=/usr' 
'--libexecdir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 
'--localstatedir=/var/lib/mysql' '--infodir=/usr/share/info' 
'--includedir=/usr/include' '--mandir=/usr/share/man' '--with-embedded-server' 
'--enable-thread-safe-client' '--with-comment=Official MySQL RPM' 'CFLAGS=-O6 
-fno-omit-frame-pointer -mpentium' 'CXXFLAGS=-O6 -fno-omit-frame-pointer   
 -felide-constructors -fno-exceptions -fno-rtti -mpentium'


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

MySQL and data mining

2003-03-01 Thread pavel
Hello,

Please do you know about any good solution for data mininig (clustering, 
  decision trees ..) that works fine with MySQL.

Thank you

With regards,

Pavel Kusch

-
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: NullPointerException in Connector/J 2.0.14

2003-03-01 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Holger Wiechert wrote:
This is a reposting since I haven't got any answer yet.
It is about the NullPointerException in class Connection
of MySQL Connector/J 2.0.14.
I just changed the driver to MySQL Connector/J 2.0.14.
But I'm still getting this NullPointerException once in
a while. The new StackTrace is:
java.lang.NullPointerException
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.Connection.execSQL(Unknown Source)
at com.mysql.jdbc.Connection.setAutoCommit(Unknown Source)
at


Version 2.0.14 did throw NullPointerExceptions when the connection was 
closed, but then something attempted to re-use it (which is an illegal 
operation, but the driver should throw a SQLException in this case).

This was fixed in Connector/J 3.0 and later. You might look into trying 
Connector/J 3.0.6, as it is now the 'stable' version.

	-Mark

- -- 
MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /  Mark Matthews [EMAIL PROTECTED]
  / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
 /_/  /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
___/ www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQE+YNr4tvXNTca6JD8RAotmAJ4zVOHQCA7qaXgRffvuZhxjTCrA7gCgnYMQ
DRvBTckdLyCcBUo0XCJW2YQ=
=TcC7
-END PGP SIGNATURE-
-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)
To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Re: SELECT DISTINCT question

2003-03-01 Thread Sheryl Canter
Thanks for the clarification.

Is the MySQL list down? I was getting constant email before, and now I've
received nothing for almost 12 hours.

- Sheryl


- Original Message -
From: Uttam [EMAIL PROTECTED]
To: 'Sheryl Canter' [EMAIL PROTECTED]; 'Juan Nin'
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 3:46 AM
Subject: RE: SELECT DISTINCT question



*DISTINCT omits data bases on selected fields only.  i.e. if you have
thousand rows having different dates in 'mydate' but all having year 2002,
then SELECT DISITNCT YEAR(mydate) will return only 1 row i.e. 2002.

* DISTINCTROW omits data based on entire duplicate records, not just
duplicate fields.

regds,
-Original Message-
From: Sheryl Canter [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 01, 2003 01:56
To: Juan Nin; [EMAIL PROTECTED]
Subject: Re: SELECT DISTINCT question


So depending on which columns you were looking at, two rows might seem
like
duplicates or not? If your SELECT statement only requested certain
fields,
your result set might have duplicates that wouldn't be duplicates if you
were looking at other columns as well? Is this correct?

So if I had this in a table:

pet name age

dogSpot  5
dogFluffy5
cat Clara 3

and I did

SELECT DISTINCT pet, age

I'd get back just two rows.

If I did this:

SELECT DISTINCT *

I'd get back all three rows.

Am I understanding this correctly?

- Sheryl


mysql

- Original Message -
From: Juan Nin [EMAIL PROTECTED]
To: Sheryl Canter [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, February 28, 2003 2:42 PM
Subject: Re: SELECT DISTINCT question


From: Sheryl Canter [EMAIL PROTECTED]

  DISTINCT removes duplicates: rows that are the same in *all*
columns.

 Would this be all columns in the table, or all columns retrieved by
the
 SELECT statement?

in the SELECT statement  :)

SELECTs do not alter your rows, you can only do that with update or
delete

regards,

Juan








-
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



Can't start mysql

2003-03-01 Thread John Almberg
I'm trying to install MySQL 3.23 on a RedHat Linux Version 8.0 box using RPMs. The install seems to go well, but the log file contains:

mysqld: Can't find file: './mysql/host.frm'

From the docs, I understand this happens because I haven't set up the grant tables, but how can I do that if I can't start the database? Seems like a Catch-22 situation! 
When I try to start MySql manually, using safe_mysqld, I get the same error in the error log. I'm sure I'm missing something simple, but I've been banging my head against this for awhile and can't figure it out. Any help much appreciated.

Brgds: John

--
Identry, LLC
Northport, NY 11768
Ph: 631.754.8440
Fx: 631.980.4262
Em: [EMAIL PROTECTED]
Member: Long Island Web Developers Guild


   Visit us at: www.identry.com
   Take control of your Web site



-
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't start mysql

2003-03-01 Thread Peter Lovatt
hi

have you run mysql_install_db ?

this sets up the mysql database initially

Peter

-Original Message-
From: John Almberg [mailto:[EMAIL PROTECTED]
Sent: 01 March 2003 20:44
To: [EMAIL PROTECTED]
Subject: Can't start mysql


I'm trying to install MySQL 3.23 on a RedHat Linux Version 8.0 box using
RPMs. The install seems to go well, but the log file contains:

mysqld: Can't find file: './mysql/host.frm'

From the docs, I understand this happens because I haven't set up the grant
tables, but how can I do that if I can't start the database? Seems like a
Catch-22 situation!

When I try to start MySql manually, using safe_mysqld, I get the same error
in the error log. I'm sure I'm missing something simple, but I've been
banging my head against this for awhile and can't figure it out. Any help
much appreciated.

Brgds: John

--
Identry, LLC
Northport, NY 11768

Ph: 631.754.8440
Fx: 631.980.4262
Em: [EMAIL PROTECTED]

Member: Long Island Web Developers Guild


Visit us at: www.identry.com
Take control of your Web site





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

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



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

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



Restoring from a mysqldump file

2003-03-01 Thread Jeff Mao
Greetings all,

May be a dumb question,...if I have a text file generated from 
mysqldump, how do I reload that file into mysql? In the past I've 
always copied and pasted it into mysql, but that takes a lot of 
time,...especially as the databases grow! I do not have local access 
to the server, but I can connect to it remotely using the normal 
tools,...

Thanks,
Jeff
--

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


Re: Restoring from a mysqldump file

2003-03-01 Thread Zak Greant
On Sat, Mar 01, 2003 at 05:11:29PM -0500, Jeff Mao wrote:
 Greetings all,
 
 May be a dumb question,...if I have a text file generated from 
 mysqldump, how do I reload that file into mysql? In the past I've 
 always copied and pasted it into mysql, but that takes a lot of 
 time,...especially as the databases grow! I do not have local access 
 to the server, but I can connect to it remotely using the normal 
 tools,...

  mysql -h host.name.tld -u user -p  dump.file

-- 
Zak Greant [EMAIL PROTECTED]
  MySQL AB Community Advocate
  Personal Blog: http://zak.fooassociates.com

EFF: Protecting Freedoms on the New Frontier (http://eff.org)

Support Global Human Rights - Amnesty International (http://amnesty.org)

-
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