Re: GETTING STARTED !!

2002-03-15 Thread Sammy Lau

Suresh R. Soni wrote:
 
 Hi All,
 I have good Sybase experience and I have installed
 MySQL in a Linux box. Can u please answer my following
 queries:
[Sammy] I like Sybase very much as well. =)

 1. When I run safe_mysqld I get Starting mysqld
 daemon with database from /var/lib/mysql 020314
 17:00:01 mysqld ended do this   mean   a successfull
 start or failure ?
[Sammy] it is a failed startup. for a succesful startup, you should see:
020117 08:05:22  mysqld started
/libexec/mysqld: ready for connections

 2. How to check if mysql server is up ?
[Sammy] trying to connect the mysqlserver is the best way to do the job.

 3. Is there any startup log-file generated (Sybase
 generates one ).
[Sammy] yes. the path is specified in /etc/my.cnf

  [safe_mysqld]
  err-log=/var/lib/mysql/mysqld.log

 4. Is there any default user created when the mysql is
 installed ( in saybase it sa with null password)
[Sammy] AFAIK, only 'root' is there.

I hope this will help.

-- 
Sammy Lau
mailto: [EMAIL PROTECTED]
- Tell me what you want and I'll tell you how you can live without it.

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

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




Re: GETTING STARTED !!

2002-03-15 Thread Georg Richter

On Friday, 15. March 2002 09:32, Sammy Lau wrote:

  2. How to check if mysql server is up ?

 [Sammy] trying to connect the mysqlserver is the best way to do the job.

Try: ps -ax | grep mysqld
or mysqladmin ping

Regards

Georg

-
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




processes stuck in Opening table state

2002-03-15 Thread Sammy Lau

hi all,

i've got a mysql server running around 100 queries per sec for most of
the time. 
i got only 1 table in MyISAM format. 
i got only around 6000 updates to this table per day.
max_connection is set to 600
thread_cache is set to 600
table_cache is set to 600 (there is NO join operation)

everything seems fine, right.
my problem is, sometimes, i see a lot of processes (200+) got stuck in
Opening table state. at the same time mysqladmin status tells me the #
of open table is 583. this number never reaches the max setting.

anyone got an idea why i'm seeing this behavior. please let me know if
i'm missing any information here.

thanks a lot.

-- 
Sammy Lau
mailto: [EMAIL PROTECTED]
- Tell me what you want and I'll tell you how you can live without it.

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

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




remote connect

2002-03-15 Thread Mike Estes

I can't connect to mysql remotely. I have added my hostname to the host
table, i have the correct entries in user table,for localhost, my hostname,
my ip, and even %. i can login locally through the shell, and the uname and
pass is same for all entries. What else could be wrong. I'm using a php
script to connect, the error code i get is not in the docs.
Can't connect to MySQL server on 'chandra056.besthost.net' (10060)
help please


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

2002-03-15 Thread Georg Richter

On Friday, 15. March 2002 09:41, Mike Estes wrote:
 I can't connect to mysql remotely. I have added my hostname to the host
 table, i have the correct entries in user table,for localhost, my hostname,
 my ip, and even %. i can login locally through the shell, and the uname and
 pass is same for all entries. What else could be wrong. I'm using a php
 script to connect, the error code i get is not in the docs.
 Can't connect to MySQL server on 'chandra056.besthost.net' (10060)
 help please

Did you execute FLUSH PRIVILEGES statement or run mysqladmin flush-privileges 
to tell the server to reload the grant tables?!

Regards 

Georg 

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

2002-03-15 Thread Remco Oosten

Please endulge me,

On wich machine is PHP running.

- Original Message -
From: Mike Estes [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 9:41 AM
Subject: remote connect


 I can't connect to mysql remotely. I have added my hostname to the host
 table, i have the correct entries in user table,for localhost, my
hostname,
 my ip, and even %. i can login locally through the shell, and the uname
and
 pass is same for all entries. What else could be wrong. I'm using a php
 script to connect, the error code i get is not in the docs.
 Can't connect to MySQL server on 'chandra056.besthost.net' (10060)
 help please


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

2002-03-15 Thread Thomas Spahni

Sergei,

thank you for clarifying this. I was misinterpreting the manual where it
says:

`FULLTEXT' indexes can be created from `VARCHAR' and
`TEXT' columns at `CREATE TABLE' time ...

Regards, Thomas Spahni


On Wed, 13 Mar 2002, Sergei Golubchik wrote:

 Hi!
 
 On Mar 13, Thomas Spahni wrote:
  On Tue, 12 Mar 2002, shaj  wrote:
  
   Can any one tell me what is the text limitation for mySQL??
  
  TEXT datatype is limited to a maximum length of 65535 (2^16 - 1) 
  characters.
  
  LONGTEXT allows up to 4'294'967'295 (2^32 - 1) characters, which is enuf
  for most applications. The real limitation is that fulltext indexing only
  works for VARCHAR and TEXT.
  
  Thomas
 
 What do you mean ?
 It works for all *TEXT types, from TINYTEXT and up to LONGTEXT.
 And for VARCHAR, yes.
 
 Regards,
 Sergei


-
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




Slow query

2002-03-15 Thread Massimo Colurcio

Hi all.

I'm using MySQL server 3.23.47 (client 3.23.44) on Windows 98 (...sorry)
accessing to database via ODBC (MySQL ODBC release 3.5.01.01) and VC++6.0  MFC
(CRecordset).
I have noticed that queries are really slow... with a simple SELECT like this:

SELECT 
ID_Field, Text_Field, Date_Field, Num_Field 
FROM 
mytable 
ORDER BY 
Num_Field

the server takes about 31 seconds to show all the 2872 records.

I tried to modify some parameters in the DSN and I noticed that checking 'Use
compressed protocol' the same query takes only about 6 seconds to complete and I
said That's great :
I have used  for the tests WinSQL (www.indus-soft.com/winsql) and -of course-
the program I'm developing.

Now I would like to know:
Am I doing something wrong?
Is that a bug?
Is that a normal server behaviour?
Why is that?

TIA,
Massimo.



-
This mail sent through IMP: http://web.horde.org/imp/

-
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




Bug

2002-03-15 Thread David Antonio Jaramillo Mejia


1.
I' am using mysql-max-3.23.49 for Windows and y have a problem to insert a
tuple with the char ñ. Anyone can tell me how solve this problem ?

2.
I'm developing an aplication with Power Builder 7.0. What is the compatibily
of MySQL with Power Builder 7.0 ?

Thanks.


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

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




Innodb replication and Database renaming question

2002-03-15 Thread Nico Sabbi

Hi, 

 I'm still using Mysql 3.23.46 because, as far as I remember, in .47 was reintroduced 
the limit of 500 chars max in Innodb primary keys (limit that would break my 
application). Is it still present ?
 Is it present in Mysql 4 ?

 I also need to know if Innodb is reliable in replication mode. I remember that with 
past versions, if the master broke the slave would lose synchrony, or something of 
this kind that would make a self-recovery impractical.

 I need to implement a read-only fall-back DB, and I'm planning to use a combination 
of cron script to dump the live db to the slave after having renamed the good (old) 
versions, and after having verified that all the data in 
 the new dump is fine, renaming the new db to the right  name.

The problem is that I can't find in the manual a  command to rename a database.

I will appreciate any suggestion,

Thanks,
Nico



 







-
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




AIX binary distribution problem

2002-03-15 Thread Mike Gahan

I downloaded the AIX binary distribution of mysql  3.23.49.

Unpacks OK, apart from camplaints about @LongLink:

402 % tar -xf mysql-3.23.49-ibm-aix4.3.3.0-rs6000.tar
tar: can't create ././@LongLink: Permission denied
tar: can't create ././@LongLink: Permission denied
... (repeated many times)

When I try to run mysql (just to test) I get:

./mysql 
Could not load program ./mysql:
Dependent module /usr/lib/libz.a(shr.o) could not be loaded.
Member shr.o is not found in archive 

So, I build a new version of zlib with a shr.o, and put it at the start of
LIBPATH. Now I get:

446 % ./mysql
Could not load program ./mysql:
Symbol resolution failed for mysql because:
Symbol strcpy (number 131) is not exported from dependent
  module /home/ccaamrg/zlib-1.1.4/libz.a(shr.o).
Symbol strcat (number 132) is not exported from dependent
  module /home/ccaamrg/zlib-1.1.4/libz.a(shr.o).
Symbol memmove (number 134) is not exported from dependent
  module /home/ccaamrg/zlib-1.1.4/libz.a(shr.o).
Symbol bcopy (number 135) is not exported from dependent
  module /home/ccaamrg/zlib-1.1.4/libz.a(shr.o).
Examine .loader section symbols with the 'dump -Tv' command.

But all the above (strcpy etc) are in libc.a

Any clues, anybody?

-- 
Mike Gahan 
Education and Information Support Division
University College London
http://www.ucl.ac.uk/~ccaamrg/

-
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




Lost primary key from table

2002-03-15 Thread Martin MOKREJ

Hi, I've really interresting topic this time:

  our application stopped getting data. It turned out these queries were
unexpectedly slow while operating on MyISAM tables:

++---+---+--+-+--+++
| Id | User  | Host  | db   | Command | Time | State   
|   | Info 
|  |
++---+---+--+-+--+++
| 16 | wwwpedant | localhost | Saccharomyces_cerevisiae | Query   | 0| Sorting 
|result | select descr,hitcode,pval,score from blast where prot_data_id=180 and 
|pval0.5 order by 4 desc |

In case of other databases same applications and same mysqld operated normally.
I think I see the problem why it's so slow:


Instead of having:

+--+--+--+-+-+---+
| Field| Type | Null | Key | Default | Extra |
+--+--+--+-+-+---+
| id   | int(11)  |  | PRI | 0   |   |
| prot_data_id | int(11)  |  | MUL | 0   |   |
| contig_data_id   | int(11)  |  | MUL | 0   |   |
| contig_data_code | varchar(100) |  | | |   |
| code | varchar(100) |  | MUL | |   |
| hitcode  | varchar(255) |  | MUL | |   |
| score| int(11)  |  | | 0   |   |
| pval | varchar(255) |  | | |   |
| ident| int(11)  |  | | 0   |   |
| posit| int(11)  |  | | 0   |   |
| begin| int(11)  |  | | 0   |   |
| end  | int(11)  |  | | 0   |   |
| length   | int(11)  |  | | 0   |   |
| hitlength| int(11)  |  | | 0   |   |
| hitstart | int(11)  |  | | 0   |   |
| hitstop  | int(11)  |  | | 0   |   |
| descr| varchar(255) | YES  | MUL | NULL|   |
| aln  | longtext | YES  | | NULL|   |
| conf | varchar(6)   | YES  | | NULL|   |
| manual   | char(3)  | YES  | | NULL|   |
+--+--+--+-+-+---+

we have in one case:

+--+--+--+-+-+---+
| Field| Type | Null | Key | Default | Extra |
+--+--+--+-+-+---+
| id   | int(11)  |  | | 0   |   |
| prot_data_id | int(11)  |  | | 0   |   |
| contig_data_id   | int(11)  |  | | 0   |   |
| contig_data_code | varchar(100) |  | | |   |
| code | varchar(100) |  | | |   |
| hitcode  | varchar(255) |  | | |   |
| score| int(11)  |  | | 0   |   |
| pval | varchar(255) |  | | |   |
| ident| int(11)  |  | | 0   |   |
| posit| int(11)  |  | | 0   |   |
| begin| int(11)  |  | | 0   |   |
| end  | int(11)  |  | | 0   |   |
| length   | int(11)  |  | | 0   |   |
| hitlength| int(11)  |  | | 0   |   |
| hitstart | int(11)  |  | | 0   |   |
| hitstop  | int(11)  |  | | 0   |   |
| descr| varchar(255) | YES  | | NULL|   |
| aln  | longtext | YES  | | NULL|   |
| conf | varchar(6)   | YES  | | NULL|   |
| manual   | char(3)  | YES  | | NULL|   |
+--+--+--+-+-+---+


Actually, here's the diff:

4,6c4,6
 | id   | int(11)  |  | | 0   |   |
 | prot_data_id | int(11)  |  | | 0   |   |
 | contig_data_id   | int(11)  |  | | 0   |   |
---
 | id   | int(11)  |  | PRI | 0   |   |
 | prot_data_id | int(11)  |  | MUL | 0   |   |
 | contig_data_id   | int(11)  |  | MUL | 0   |   |
8,9c8,9
 | code | varchar(100) |  | | |   |
 | hitcode  | varchar(255) |  | | |   |
---
 | code | varchar(100) |  | MUL | |   |
 | 

typical: need help

2002-03-15 Thread Wolf-Dietrich von Loeffelholz

I m running a mysql-server 3.23.49 under suse 6.4 (kernel 2.2.14) and
myodbc 3,51 .. I have an mdb file and want to export the tables from
access 2002 to the mysqldb .. I can connect to the db and read the
tables .. but when I want to export them .. I get a syntax error ???

 

What is wrong


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

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




SELECT is using wrong key AND getting wrong results

2002-03-15 Thread Michael Widenius


Hi!

 Mike == Mike Wexler [EMAIL PROTECTED] writes:

 Description:
Mike SELECT fullTextMatches.realname, fullTextMatches.address,
MikefullTextMatches.address2, fullTextMatches.city,
Mike fullTextMatches.state,
MikefullTextMatches.zip, fullTextMatches.country,
Mike fullTextMatches.email,
MikefullTextMatches.homephone, fullTextMatches.workphone,
MikefullTextMatches.userid
Mike FROM   tums.fullTextMatches, orders.header USE INDEX (userId)
Mike WHERE  header.storeId=/stores/eyarn AND
Mike header.userId=fullTextMatches.userId
Mike ORDER BY realname

Mike generates different results and is much faster than the same query
Mike without USE INDEX(userId):

cut

Mike Without the USE INDEX zero records match. With the USE INDEX I get 13
Mike matches.

cut
Release:   mysql-3.23.44 (Source distribution)
cut

Could you please upgrade to 3.23.49 and see if this solves your
problem.
If not, could you then ftp the table + a README file with contains the
problem to: ftp://support.mysql.com:/pub/mysql/secret
and we will take a look at this.

Regards,
Monty

-
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: Creating tables in mysql

2002-03-15 Thread Uma Shankari T.


Hello,

   Now i am struck up with one problem...When i am trying to create a
table in the mysql database it is giving this error...Can anyone plese
help me how to rectify this problem..

ERROR 1: Can't create/write to file './dbase/rr.frm' (Errcode: 13)

My mysql database name is dbase and my table name is rr


-Uma



-
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




Creating tables in mysql

2002-03-15 Thread Uma Shankari T.



Hello,

   Now i am struck up with one problem...When i am trying to create a
table in the mysql database it is giving this error...Can anyone plese
help me how to rectify this problem..

ERROR 1: Can't create/write to file './dbase/rr.frm' (Errcode: 13)

My mysql database name is dbase and my table name is rr


-Uma




-
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: manip.cc

2002-03-15 Thread Sinisa Milivojevic

:::... pjs ... writes:
 is anyone getting errors when trying to install mysql++, after
 installing the patch for gcc3?
 i've gotten a flood of errors which i've fixed, step by step, by adding
 std:: to various
 variables. manip.cc is spitting out error messages like this one:
 
 manip.cc:141:choosing
 
'std::basic_ostreamchar,_Traitsstd:operator(std::basic_ostreamchar,_Traits,const
 char').
 
 i suspect this has something to do with namespace, but i haven't been
 able to figure it out...
 thanks a lot.
 p
 

Hi!

I will be soon uploading a new patch for GNU 3, which will fix the
remaining errors.

They are all, BTW, related to std:: ...

-- 
Regards,
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
   ___/   www.mysql.com


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

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




printing/Displaying Mysql Database layout

2002-03-15 Thread MySql Dba

Hello all. 

I am running mysql 3.x on Redhat Linux, and Solaris 2.6 and 8
Most of the development work is done on these servers.
I do have a couple of windows developers using tools like mysqlfront 

Is there way with mysql to print out table structure in a useable text format or maybe 
even a graphical tool (or save to a file)

I would be willing to use and windows or unix based software to get a good database 
diagram.

thanks, 

Matt.


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

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




Upgrading to InnoDB tables

2002-03-15 Thread Victoria Reznichenko

Sanjay,
Thursday, March 14, 2002, 11:23:27 PM, you wrote:

SC We have Mysql standard distribution (ver 3.23.32) for
SC Solaris and we just realised that we needed InnoDB
SC support. What would be the easiest way to add InnoDB
SC table type? Is it possible to do it without  affecting
SC the tables and databases that are already present.

Standart distributibe doesn't support InnoDB table type. You should
install MySQL-max.

You must also specify InnoDB options in my.cnf file in order to 
use that table handler. 

You can read about InnoDB configuration parameters in the manual:
   http://www.mysql.com/doc/I/n/InnoDB_start.html

SHOW VARIABLES LIKE 'have%' helps you to check if InnoDB is
supported.

You can use different table types at the same time in one database.

You may not to convert MYISAM tables to InnoDB, but if you want to
convert you can read notes about it at:
   http://www.mysql.com/doc/S/E/SEC444.html

SC thanks,
SC Sanjay Chigurupati







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




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

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




Re: remote connect

2002-03-15 Thread Victoria Reznichenko

Georg,
Friday, March 15, 2002, 11:05:19 AM, you wrote:

 I can't connect to mysql remotely. I have added my hostname to the host
 table, i have the correct entries in user table,for localhost, my hostname,
 my ip, and even %. i can login locally through the shell, and the uname and
 pass is same for all entries. What else could be wrong. I'm using a php
 script to connect, the error code i get is not in the docs.
 Can't connect to MySQL server on 'chandra056.besthost.net' (10060)
 help please

Mike, it looks like that your MySQL server is not running. Try to check if
your MySQL server is running by using telnet:

   telnet chandra056.besthost.net 3306 

This error also covered in the manual, look at:
   http://www.mysql.com/doc/C/a/Can_not_connect_to_server.html

GR Did you execute FLUSH PRIVILEGES statement or run mysqladmin flush-privileges 
GR to tell the server to reload the grant tables?!

Georg, it is not necessary to do 'FLUSH PRIVILEGES' or 
'mysqladmin reload' if you use GRANT statement for setting 
privileges to users.

GR Georg





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




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

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




innodb or Berkeley DB default for mysql max

2002-03-15 Thread Victoria Reznichenko

Kemp,
Thursday, March 14, 2002, 8:37:00 PM, you wrote:

KRW What is the default table engine used in the binary version of mysql-max -- 
KRW innodb or Berkeley?  If not innodb, how do I get the innodb to be the default?  
KRW Can someone point me to the manual section?

The default table type of MySQL server is MyISAM. To set up another
table type by default use '--default-table-type' option.





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




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

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




Re: New MySQL user question: record security

2002-03-15 Thread Egor Egorov

Mike,
Thursday, March 14, 2002, 7:27:32 PM, you wrote:

MH I have just recieved a request to build a database using mySQL and I have a
MH bit of a dilemma.


MH The database is to be used for relations between 
MH politicians and their constituents,

MH and I have to have tables for constituents and their information. I would like
MH to have one main database and not seperate databases for each politician, but
MH I would like to make sure that they can only see 
MH information on THEIR OWN constituants

MH and not the constituants of their competitors. 
MH Is there any way to grant permissions
MH only where the constituency matches theirs? I can do 
MH this easily enough through
MH the application, but I would like to extend 
MH such security to the database itself.

MySQL privilege system provides privileges on database, table and
column levels. You can specify privileges for your politician on
corresponding databases. For example:
If you have politician John Johnson you can set grants for him
  GRANT priv_type ON John_database.* TO 'john'@'%' IDENTIFIED BY 'password';

You can read more about privilege system in MySQL at:
http://www.mysql.com/doc/P/r/Privileges.html
http://ww.mysql.com/doc/G/R/GRANT.html

MH Mike Hillyer





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



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

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




Re: root user Access Denied

2002-03-15 Thread Egor Egorov

Rob,
Thursday, March 14, 2002, 10:15:54 PM, you wrote:

Show me the output of the following:
 SHOW GRANTS FOR 'username'@'hostname';

RQ output:
RQ mysql show grants for 'root@localhost';
RQ ERROR 1064: You have an error in your SQL syntax near 
RQ 'grants for 'root@localhost'' at line 1

RQ I noticed that my user table doesn't seem to have all the fields 
RQ it should.  I upgraded from an older version of mysql back in November.  
RQ There are 4 fields missing (Grant_priv, References_priv,
RQ Index_priv, Alter_priv).  I just read on www.mysql.com that I 
RQ need to run mysql_install_db.  I assume this will alter the table 
RQ structure to include the new fields, but will it also mess up my
RQ previously defined users?

It'a a very strange situation. You can run install mysql_install_db
but you should first move old privileges tables from mysql data dir.
You can read about running mysql_install_db at:
http://www.mysql.com/doc/m/y/mysql_install_db.html

After running mysql_install_db you will get new privileges table with
user 'root' without a password and default anonymous user.

You can also start mysqld with '--skip-grant-tables' option and re-create missing 
columns using ALTER TABLE statement to add those missing columns: 

  `Grant_priv` enum('N','Y') NOT NULL default 'N',
  `References_priv` enum('N','Y') NOT NULL default 'N',
  `Index_priv` enum('N','Y') NOT NULL default 'N',
  `Alter_priv` enum('N','Y') NOT NULL default 'N'

RQ Rob






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



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

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




Re: Changing Default for Not Null to NOTHING

2002-03-15 Thread Egor Egorov

David,
Thursday, March 14, 2002, 9:30:24 PM, you wrote:

DMP ok, more specific:
DMP here is a table:
DMP CREATE TABLE FOO (foo1 int NOT NULL, foo2 int NOT NULL Default 1)

DMP If I do an insert into the FOO table with the following:
DMP INSERT INTO FOO (foo1,foo2) VALUES (1,1)
DMP Everything works as planned.

DMP If I do an insert into the FOO table with the following:
DMP INSERT INTO FOO (foo1) VALUES (1)
DMP Everything works as planned

DMP If I do an insert into the FOO table with the following:
DMP INSERT INTO FOO (foo2) VALUES (1)

DMP I want an error.  But what happens is that the db engine explicitly defines
DMP a default of 0 to the foo1 column even though I defined it as int NOT NULL
DMP and did not give it a default.

DMP After I change the configuration with the following:
DMP CXXFLAGS=-DDONT_USE_DEFAULT_FIELDS ./configure
DMP and re-create my table in a new database, I do get an error on
DMP INSERT INTO FOO (foo2) VALUES (1)
DMP because I didn't give a value for foo1, but I also get an error on this:
DMP INSERT INTO FOO (foo1) VALUES (1)
DMP even though I have explicitly defined a default for foo2.

DMP So.  What I want:
DMP No default unless I define one
DMP Error on NOT NULL if I don't define a default
DMP Default inserted if NOT NULL and I define a default and I don't specify a
DMP value in an insert statement

DMP Does this make more sense?

Unfortunatly, MySQL doesn't support it now, but this feature is in our
future plans. Look at:
   http://www.mysql.com/doc/T/O/TODO_future.html

DMP David





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



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

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




Creating tables in mysql

2002-03-15 Thread Victoria Reznichenko

Uma,
Friday, March 15, 2002, 2:10:50 PM, you wrote:

USTNow i am struck up with one problem...When i am trying to create a
UST table in the mysql database it is giving this error...Can anyone plese
UST help me how to rectify this problem..
UST ERROR 1: Can't create/write to file './dbase/rr.frm' (Errcode: 13)
UST My mysql database name is dbase and my table name is rr

$ perror 13
Permission denied

Check your permissions on mysql data dir.

UST -Uma




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




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

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




Re: innodb or Berkeley DB default for mysql max

2002-03-15 Thread terete

We have the same problem as Victoria, and the --default-table-type option
does not work.

- Original Message -
From: Victoria Reznichenko [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 1:38 PM
Subject: innodb or Berkeley DB default for mysql max


 Kemp,
 Thursday, March 14, 2002, 8:37:00 PM, you wrote:

 KRW What is the default table engine used in the binary version of
mysql-max --
 KRW innodb or Berkeley?  If not innodb, how do I get the innodb to be the
default?
 KRW Can someone point me to the manual section?

 The default table type of MySQL server is MyISAM. To set up another
 table type by default use '--default-table-type' option.





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




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

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



-
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




Getting a text field in a table....

2002-03-15 Thread MadProfessor

Stupid newbie question, but why in the hell can't I get this damned TEXT
column added? I've specified it as size 254 and cannot get it to
work Someone please give me an example of a working create table
statement with a TEXT or LONGTEXT column? I've read through my book
(MySQL) and checked the documentation, but no working examples, just the
standard stuff..
Cheers,
MadProfessor ZERO


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

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




MYSQL,Linux large threads number

2002-03-15 Thread Peter Zaitsev

Hello mysql,

  Some time ago I wrote about slow down of mysql with large number of
  threads, which is quite common in Linux-Apache-Mysql-PHP enviroment.

  The test was simulating the worst case of concurrency - all the
  threads are modified global variable in a loop 500 times in
  total, using standard mutex for synchronization. The yeild is used
  in a loop to force even more fair distribution of lock usage by
  threads and increase context switches, therefore it did not change
  much with large number of threads. I.e with 64 threads time without
  yeild is 1:33.5

  Test was run on PIII-500 1G RAM Kernel 2.4.18. 3 runs were made for
  each number of threads and best results were taken:

 Num threads.   Time  Peak cs rate.
2   53.4  179518
4   53.8  144828
16  1:06.3 85172
64  1:48.1 48394
256 8:10.6 10235
1000   36:46.2  2602


The surprising thing is the time grows in less then linear way for up
to 64 threads but later it stars to go linear way or even worse. May
be this is because some other process are sleeping in the system which
also is used in scheduling.


For Next test I'll try to use Ingo's scheduler to see if it helps to
solve the problem, also I'll try to test real mysql server to see
which slowdown it will have.




CODE: (Dumb one just for test)

  
#include stdio.h
#include pthread.h
#include time.h
#define NUM_TH 1000

#define TOTAL_VALUE 500

#define LOOP (TOTAL_VALUE/NUM_TH)

pthread_t th[NUM_TH];
int thread_data[NUM_TH];

int rc,rc2;

int global=0;

pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t start = PTHREAD_MUTEX_INITIALIZER;


void f(int *thn)
 {
 int i;  
 pthread_mutex_lock(start);
 pthread_mutex_unlock(start);
 for (i=0;iLOOP;i++)
  { 
   pthread_mutex_lock(mut);
   global++;
   pthread_yield();
   pthread_mutex_unlock(mut);
  }
 } 



main()
 { 
  int i;
  pthread_mutex_lock(start);  
   
  for (i=0;iNUM_TH;i++)
  {
   thread_data[i]=i;
   rc=pthread_create(th[i],NULL,f,thread_data[i]);
   if (rc!=0)
{
  printf(Failed to create thread #%d errorcode:%d\n,i,rc);
} 
  }
  pthread_mutex_unlock(start); 

 for (i=0;iNUM_TH;i++)
  {
   rc2=pthread_join(th[i],NULL);
  }
 printf(Global Value: %d\n,global); 

 }   

-- 
Best regards,
 Peter  mailto:[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: mysql++ patch for GCC 3

2002-03-15 Thread Sinisa Milivojevic

:::... pjs ... writes:
 
 has anyone had trouble applying the patch to mysql++-1.7.9
 tx,
 paul
 

This is simple.

cd to directory immediately above mysql++ and do :

patch -p1  ...

There is a better patch for GNU 3..., but not fully tested yet. I am
sending it to you directly, so that you can try it.

-- 
Regards,
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
   ___/   www.mysql.com


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

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




Getting a text field in a table....

2002-03-15 Thread Victoria Reznichenko

MadProfessor,
Friday, March 15, 2002, 2:51:07 PM, you wrote:

M Stupid newbie question, but why in the hell can't I get this damned TEXT
M column added? I've specified it as size 254 and cannot get it to
M work Someone please give me an example of a working create table
M statement with a TEXT or LONGTEXT column? I've read through my book
M (MySQL) and checked the documentation, but no working examples, just the
M standard stuff..

mysql create table test(
- id int primary key,
- article text);

You shouldn't specify size for text column. Check the following link:
http://www.mysql.com/doc/n/o/node_368.html
You can find storage requirement for text column types there.

M Cheers,
M MadProfessor ZERO




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




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

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




Re: How MySQL handles variables

2002-03-15 Thread DL Neil

Hi GEORGE,
 
 I would like to ask a simple question about the way
 MySQL handles string variabels. Say i have a variable
 whose value is foo and I want to change it to foobar. 
 
 Instead of doing it the 'typical' way, I would like to
 ask whether there is any mysql command that will allow
 me to say read the value of the variable and then
 append bar to it.


What is the typical way that you don't want to use?

Check out CONCAT( foo, bar ) = man ref 6.3.2 String Functions

Please advise,
=dn


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

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




Re: MYSQL,Linux large threads number

2002-03-15 Thread Sinisa Milivojevic

Peter Zaitsev writes:
 Hello mysql,
 
   Some time ago I wrote about slow down of mysql with large number of
   threads, which is quite common in Linux-Apache-Mysql-PHP enviroment.
 
   The test was simulating the worst case of concurrency - all the
   threads are modified global variable in a loop 500 times in
   total, using standard mutex for synchronization. The yeild is used
   in a loop to force even more fair distribution of lock usage by
   threads and increase context switches, therefore it did not change
   much with large number of threads. I.e with 64 threads time without
   yeild is 1:33.5
 
   Test was run on PIII-500 1G RAM Kernel 2.4.18. 3 runs were made for
   each number of threads and best results were taken:
 
  Num threads.   Time  Peak cs rate.
 2   53.4  179518
 4   53.8  144828
 16  1:06.3 85172
 64  1:48.1 48394
 256 8:10.6 10235
 1000   36:46.2  2602
 

I hope you are using latest glibc 2.2 with our patches applied.

Also please try adaptive mutex. How to set it, take a look at
mysys/my_thr_init.c.

-- 
Regards,
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
   ___/   www.mysql.com


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

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




BLOB in MYSQ

2002-03-15 Thread Ibrahim KIvanc Cihan

hii all,

I want to knowledge about blob.

how can write or read  blob to/from MYSQL database by using Visual C++.

Can any body help me.

Ibrahim Kivanc Cihan
Anadolu University - Turkey


-
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: Getting a text field in a table....

2002-03-15 Thread Salada, Duncan

I don't believe you specify a size for a column of type TEXT.  Only types
CHAR and VARCHAR take a size.
http://www.mysql.com/doc/B/L/BLOB.html says:
A BLOB is a binary large object that can hold a variable amount of data.
The four BLOB types TINYBLOB, BLOB, MEDIUMBLOB, and LONGBLOB differ only in
the
maximum length of the values they can hold. See section 6.2.6 Column Type
Storage Requirements. 

The four TEXT types TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT correspond to
the four BLOB types and have the same maximum lengths and storage
requirements.

Whereas, http://www.mysql.com/doc/C/H/CHAR.html says:
The length of a CHAR column is fixed to the length that you declare when
you create the table. The length can be any value between 1 and 255.
and...
Values in VARCHAR columns are variable-length strings. You can declare a
VARCHAR column to be any length between 1 and 255, just as for CHAR
columns.

Duncan
--
Duncan Salada | Titan | www.titan.com/testeval
Email: [EMAIL PROTECTED] | Voice: 301-925-3222x375 | Fax: 301-925-3216

 -Original Message-
 From: MadProfessor [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 15, 2002 7:51 AM
 To: [EMAIL PROTECTED]
 Subject: Getting a text field in a table
 
 
 Stupid newbie question, but why in the hell can't I get this 
 damned TEXT
 column added? I've specified it as size 254 and cannot get it to
 work Someone please give me an example of a working create table
 statement with a TEXT or LONGTEXT column? I've read through my book
 (MySQL) and checked the documentation, but no working 
 examples, just the
 standard stuff..
 Cheers,
 MadProfessor ZERO
 
 
 -
 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: BLOB in MYSQ

2002-03-15 Thread Gurhan Ozen

Hi,
First of all, download MySQL++ for VC++ at:
http://www.mysql.com/downloads/download.php?file=Downloads/mysql++/mysql++-1
.7.1-1-win32-vc++.zip

And there are working examples on how to load and retrieve binary data from
blob columns using MySQL++ at:
http://www.mysql.com/documentation/mysql++/4_Tutorial.html#SECTION031610
00

Gurhan


-Original Message-
From: Ibrahim KIvanc Cihan [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 9:16 AM
To: [EMAIL PROTECTED]
Subject: BLOB in MYSQ


hii all,

I want to knowledge about blob.

how can write or read  blob to/from MYSQL database by using Visual C++.

Can any body help me.

Ibrahim Kivanc Cihan
Anadolu University - Turkey


-
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: root user Access Denied

2002-03-15 Thread Doug Thompson

I've been watching this thread and wonder if not following instructions may be 
contributing to the present confusion.

On Fri, 15 Mar 2002 14:38:02 +0200, Egor Egorov wrote:

Show me the output of the following:
 SHOW GRANTS FOR 'username'@'hostname';

RQ output:
RQ mysql show grants for 'root@localhost';
RQ ERROR 1064: You have an error in your SQL syntax near 
RQ 'grants for 'root@localhost'' at line 1

Note the application of single quotes in the above and following.  Also, note the huge 
difference in the error 
messages.

mysql show grants for 'root@localhost';
ERROR 1141: There is no such grant defined for user 'root@localhost' on host '%'

mysql show grants for 'root'@'localhost';
+---
+
| Grants for root@localhost
|
+---
+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD 'some
password' WITH GRANT OPTION |
+---
+
1 row in set (0.00 sec)

+---+
| version() |
+---+
| 3.23.43   |
+---+  on win9x.


Doug






-
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: Please help - About doing a delete.

2002-03-15 Thread sunny


well i can do the select that way, but i was wondering how the following 
delete command would only pick up the rows in the select. isn't there a way 
of imbedding delete in the select statement?

can anyone else help as well please?

thanks

sunny

At 19:46 14/03/02 -0500, Jim Philips wrote:
To select the rows you are looking for, you can use:

select * from messages
left join topics on topics.topic_id=messages.topic_id
where topics.topic_id is null;

This works fine for selecting. But for some reason the corresponding SQL
for a delete fails:

mysql delete from messages
 - left join topics on topics.topic_id=messages.topic_id
 - where topics.topic_id is null;
ERROR 1064: You have an error in your SQL syntax near 'left join topics
on topics.topic_id=messages.topic_id

Anybody know how to make the delete statement work?




On Thu, 2002-03-14 at 15:57, sunny wrote:
 
  How do i do a select first and then delete those rows? sorry.. im just
  confused. i tried that mysql, but it didn't work... gave me an error :(
 
  Any ideas?
 
  thanks!
 
  /sunny
 
 
 
  At 20:54 13/03/02 -0500, you wrote:
  What you need is a delete with a left join. Something like this:
  
  delete from messages
  left join messages on topics.topic_id=messages.topic_id
  where topics.topic_id is null;
  
  Try it first using a select instead of a delete to be sure it captures
  the right rows. But this ought to work.
  
  On Wed, 2002-03-13 at 17:53, sunny wrote:
Hi everyone,
   
I've got a really annoying problem with mysql, and I was hoping someone
could help.
I've got 2 tables in Mysql:
   
Table 1 - Topics
   
| topic_id | name | subject | comment |
-
|  1 | john   | weather| the weather today blah blah|
   
   
Table 2 - Messages
   
|message_id | topic_id | name | subject | comment |
-
|   12|  1 | billy   | yes it ...| i totally 
 agree|
   
Basically, in the messages table, each row has its own unique id, 
 but also
a topic_id column which relates to the topic_id in the Topics table.
What I want to do is delete all messages in the message table for 
 which
   the
relating topic_id has been already deleted in the Topics table. For
example, if the row with topic_id 5 was deleted in Topics table, I 
 want to
make sure there are no messages in the Messages table which have a
   topic_id
of 5.
   
Please please, any help would be greatly appreciated. I'm running MySQL
3.23.46 on UNIX.
   
TIA!
   
sunny
   
   
-
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




Grants to a database table that doesn't exist yet

2002-03-15 Thread Luc Foisy


Is there someway I can force a Grant to take if the database table doesn't
exist yet?

I have the database created, awaiting the data that is being dropped into
it, but I want to set up privileges to it before it exists so its ready to
go live in an instant

mysql GRANT DELETE,SELECT,UPDATE on qbslive.PRINTJOB to
PrintHandler@'192.168.0.250' identified by 'passwd';
ERROR 1146: Table 'qbslive.PRINTJOB' doesn't exist

there would be several grant statements ( about 20, trying to keep the
database controlled as much as possible)

I suppose I could do this by editing the tables directly, there is just a
bit more work involved ( user and tables_priv inserts ). I would really like
the server to do the work though through the grant though

I could create the table first, then make the grants, then delete the
tables, BUT I have a slave replicating this database ( so when I load the
data, it will be replicated right from the get go) and I would rather not
have that unneccissary stuff in the bin logs. ( now I see I should have
started the replication after I did all the messing around ) 

I don't want to stop anything and reconfigure it, cause I know its working
now and I don't want to make something not work :)

Anyways, can I force a GRANT on a table that doesnt exist?

-
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: Lost primary key from table

2002-03-15 Thread denonymous

From: Martin MOKREJ [EMAIL PROTECTED]

 OK, my question is:

 could someone imagine a way how such a thing could happen? The information
about
 KEY's is set when the table is created. I suspect more end-user problem
then
 mysqld problem, but could it happen that the whole information in Key
 column got dropped? Can one get it out from the .frm file?


Did you, at any time backup and restore the table in the following manner?
CREATE TABLE blast_backup SELECT * FROM blast;
DROP TABLE blast;
CREATE TABLE blast SELECT * FROM blast_backup;

I've done this in the past, and this method of creating a table doesn't copy
key info. Took me a couple tries, but I finally figured it out.

I don't know if this is your problem, persay, but it's the only time I've
seen that happen unexplainedly.



--
denonymous
www.coldcircuit.net




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

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




mysql_num_rows/insert/3.23.41

2002-03-15 Thread Robert Cross


Found a strange problem with a system here I'm wondering if anyone can help
with.

Got a v3.23.41 installation (source build) on RedHat 6.2 using BDB tables.
A front end program
uses this database via the C API. gcc on this system is egcs-2.91.66
19990314/Linux (egcs-1.1.2 release)

At one point the front end generates an INSERT query to put a new record
into the main table
of the database. In another bit of the code it does a check to see if a
particular record
exists (SELECT query on the primary key followed by a mysql_num_rows on the
result) before trying to update
the record.

Now this program has been running fine for a good while, but yesterday in
the space of five
minutes I got 6 warnings from my front end program that the users were
trying to update
records that didn't exist. When I did some digging, it looks like the
records were/should-have-been
present.

So I've got two possibilities:
1.   The initial insert for the six records didn't work. I'm not sure about
this, since there
were other record inserts being done around the same time frame that did
work.
2.   For some reason, either my SELECT decided to return no results, or
mysql_num_rows
decided to return zero.

I'm going to put in some error trapping on the insert now, so if it does
fail at least I get an error
message. I'm a bit loathe to do this since the system has been so stable,
(100K's of transactions
at these are the first failures, so replicating the problem is near enough
impossible). Plan B is to
replace the r41 install with a local build of r49a(/r50?) in case it's a
know problem now solved.

Any ideas oh great MySQL gurus?

Regards

Bob Cross.




* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This message is confidential.  It may also be privileged or
protected by other legal rules.  It is not an offer 
or acceptance of an offer, nor shall it form any part
of a legally binding contract.  If you have received this
communication in error, please let us know by reply then
destroy it.  You should not use, print, copy the message or
disclose its contents to anyone.

E-mail is subject to possible data corruption, is not
secure, and its content does not necessarily represent the
opinion of this Company.  No representation or warranty is
made as to the accuracy or completeness of the information
and no liability is accepted for any loss arising from
its use.

This e-mail and any attachments are not guaranteed to be
free from so-called computer viruses. You should check for 
viruses before down-loading it to your computer equipment. 
This Company has no control over other websites to which there
may be hypertext links and no liability is accepted in relation
to those sites.

This Company randomly monitors its e-mail system (including 
incoming e-mails) for operational purposes.

Scottish  Newcastle plc
Registered in Scotland, Registered Number 16288
Registered Office: 33, Ellersly Road, Edinburgh, EH12 6HX
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

-
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: Grants to a database table that doesn't exist yet

2002-03-15 Thread Gurhan Ozen

Hi Luc,
I don't know if this will help you but you can do:

GRANT DELETE,SELECT,UPDATE on qbslive.* TO .

But this will give permission to ALL tables in qbslive database...

Gurhan



-Original Message-
From: Luc Foisy [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 10:45 AM
To: MYSQL-List (E-mail)
Subject: Grants to a database table that doesn't exist yet



Is there someway I can force a Grant to take if the database table doesn't
exist yet?

I have the database created, awaiting the data that is being dropped into
it, but I want to set up privileges to it before it exists so its ready to
go live in an instant

mysql GRANT DELETE,SELECT,UPDATE on qbslive.PRINTJOB to
PrintHandler@'192.168.0.250' identified by 'passwd';
ERROR 1146: Table 'qbslive.PRINTJOB' doesn't exist

there would be several grant statements ( about 20, trying to keep the
database controlled as much as possible)

I suppose I could do this by editing the tables directly, there is just a
bit more work involved ( user and tables_priv inserts ). I would really like
the server to do the work though through the grant though

I could create the table first, then make the grants, then delete the
tables, BUT I have a slave replicating this database ( so when I load the
data, it will be replicated right from the get go) and I would rather not
have that unneccissary stuff in the bin logs. ( now I see I should have
started the replication after I did all the messing around )

I don't want to stop anything and reconfigure it, cause I know its working
now and I don't want to make something not work :)

Anyways, can I force a GRANT on a table that doesnt exist?

-
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




it cannot inititate downloads

2002-03-15 Thread alan4100

I am trying to download mysql for my windows XP but this url site:

http://www.mysql.com/downloads/mysql-3.23.html

has been unaccessible for over two weeks. I just could not initiate the download. My 
provider is Comcast Cable.

What is the problem?



joining 2 identical tables

2002-03-15 Thread Christian


hi,

i'm working on a project for managing used motorcycles. for security reasons
i setup two identical tables. both with the same attributes.
ID,UNIID,Manufacurer... one of the tables is named Com and the other
Prv.

till now i used to search either Com or Prv. but i want to look for a
match in both of them and listing the result. i have tried anything i knew,
but without luck.

please can anyone tell me, how the SQL Statment must look like to get such
an output?

-
Com
-
ID | UNIID | Manufacturer |
-
1  | 12D2  | Yamaha   |
2  | 21E3  | test  |

-
Prv
-
ID | UNIID | Manufacturer |
-
1  | 43I2   | Kawasaki  |
2  | 68U2  | Something|


-
output 
-
ID | UNIID | Manufacturer |
-
1  | 43I2   | Kawasaki  |
2  | 68U2  | Something|
1  | 12D2  | Yamaha   |
2  | 21E3  | test  |


(Data of ID's equals, UNIID's are different, Manufacturer's are different.)

many thanx in advance

yours christian



-
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




A problem with ROUND()

2002-03-15 Thread ghost



I have database with table and 1 milions random characters. Key for
searching each character is a counter from 1 to milion.

when I execute statement:

SELECT count, character FROM table_name WHERE count=ROUND(rand()*10);

Example:

count ||character ||

1   dasarewr
2   adswarwrf
3   sfdqwerw
4   dfweqrqwe
5   asdfwerdfwe
6   fdwerwer
7   fsdwefwe
8   frefer
... .

daswer
1000fdferte
.


99  asdwerer
100 dasrewg

RESULT:

1) Sometimes I get just one result like:
4352342 dcfsfwer

2)Sometimes I get TWO results!

1000fdferte
99  asdwerer

3) sometimes even THREE



4) sometimes NONE


The select statement must to gave me just ONE result!

Does anyone know what that is about? Does ROUND() have any bugs?

Sorry for bad english.

Elvir


---end of your message---

MySQL Development Team


-
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: it cannot inititate downloads

2002-03-15 Thread Edward Chase

You should have been sent to another page that lists many of the mirrors to 
download from.  Did this happen?

http://www.mysql.com/downloads/download.php?file=Downloads/MySQL-3.23/mysql-3.23.49-win.zip

Somewhere on the page it says that you can also download from sourceforge.net

http://sourceforge.net/projects/mysql/

You could give that a try too.



At 11:17 AM 3/15/2002 -0500, you wrote:
I am trying to download mysql for my windows XP but this url site:

http://www.mysql.com/downloads/mysql-3.23.html

has been unaccessible for over two weeks. I just could not initiate the 
download. My provider is Comcast Cable.

What is the problem?

---
  Edward F. Chase III |   [EMAIL PROTECTED]
  Providence College  |   http://www.providence.edu
  Computer Services   |   http://studentweb.providence.edu
  Providence, RI  02918   |


-
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: replication through port forwarded firewall

2002-03-15 Thread John Hunter

 Van == Van  [EMAIL PROTECTED] writes:

Van This means you need to re-initialize the slave; i.e. stop the
Van master and slave; copy the data dir to the slave; start the
Van slave (ensure the perms on the slave are correct first);
Van start the master.  If the error above had been
Van connectivity-related you'd have received different ERROR
Van messages in the log.

Ok, thanks for all you detailed help.  Unfortunately, I am still
having the same problem, so I want to provide a few more details.

1) I shut down the master and shut down the slave with
   '/etc/init.d/mysqld stop' on the master and slave

2) I changed all the ownership on the master to be mysql.mysql with
   chown -R /path/to/data/dir

3) I cd'd into the slave data dir.  This is the dir that has 
   subdirs for the various mysql databases, which contain the *.MYD,
   *.MYI, *.frm files.  I updated the slave data dir with 
   rsync -avz --delete  -e ssh root@nitace:/path/to/data/dir/ .
   This also copied all the mother-001.bin, mother-002.bin etc... files
   from the data dir of the master

4) I restarted the slave and got saw the message in the log that the
   slave could not connect to the master.  This was expected, because
   you said to restart the slave before the master (which I found
   confusing because the manual section 'Replication HOWTO' says to
   restart the master first

5) I restarted the master

6) After the 60 sec wait on the slave, it reattempted a connect to the
   master, which was by then alive, and I got the same error message
   (posted below) about the duplicate insertion from mother-002.bin.
   Although this is a binary file, I did 'less' on it and it has text
   that you can read.  The first command in that file is

  INSERT INTO multifile VALUES (
   2472160,
   '2001-3-9',
   '101.bmp',
   2
   Which is the line that the slave is complaining about.

When I sync my data dirs, the slave dir also has the mother-bin.*
files on it and it gets the mysql user dir from the master.  Is this
correct?

Stumped.

Thanks,
John Hunter

Master mysql version: 3.23.37
Slave mysql version: 3.23.36

Error message:

020315  9:30:52  Slave: connected to master '[EMAIL PROTECTED]:3306',  replication 
started in log 'FIRST' at position 4
ERROR: 1062  Duplicate entry '2472160-101.bmp-2' for key 1
020315  9:30:52  Slave:  error running query 'INSERT INTO multifile VALUES (
   2472160,
   '2001-3-9',
   '101.bmp',
   2
   )' 
020315  9:30:52  Error running query, slave aborted. Fix the problem, and re-start the 
slave thread with mysqladmin start-slave. We stopped at log 'mother-bin.002' 
position 73
020315  9:30:52  Slave thread exiting, replication stopped in log
'mother-bin.002' at position 73



-
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




My JDBC does not work.

2002-03-15 Thread Jianping Zhu


I have spend three days try to get jdbc for mysql work, but failed. I am
very frustrated. I will
be appreciated if somebody can help me out.

I have redhat 7.2 OS, I download the sever and client mysql .rpm files and
instaled it, i believe succssfully. i use command like 'mysqladmin
version' to test the mysql server, the server seems work fine, I have a
mysql user account 'jianping' which has been granted all global privilges. 

I downloaded  the JDBC mm.mysql-2.0.4-bin.jar to my system and set the env
varible properly.

I have a database called 'evote' and there is one table 'stocks' in the
database.
I use the code download form a jDBc tutrial website the code is:   
  

import java.sql.*;
import java.io.*;
import java.util.*;

class StocksMy {
   public static void main (String args []) {

  try {

 Class.forName(org.gjt.mm.mysql.Driver).newInstance();
  System.out.println();

 // Create a Connection and a Statement
 Connection conn = DriverManager.getConnection(

jdbc:mysql://localhost/evote?user=jianpingpassword=ping1830);
  System.out.println(33);
 Statement stmt = conn.createStatement();
 // Select all columns from the STOCKS table
 ResultSet rset = stmt.executeQuery (select * from stocks);

 // Iterate through the result and print the records
 while (rset.next()) {
String ticker=rset.getString(1).trim();
String title=rset.getString(2).trim();
String price=rset.getString(3).trim();
String blanks=
  ;
// print the data in a table format
System.out.print (ticker);
System.out.print(blanks.substring(1,8-ticker.length()));
System.out.print (title);
System.out.print(blanks.substring(1,41-title.length()));
System.out.println (price);
 }
  } catch (Exception e) {
 System.out.println(StocksMy: JDBC exception);
 System.exit(1);
  }
   }
}

I added some System.out.println () trying to the code.

The code can be compiled succesfully, but when i tried to execute it, it
gave  folliing output.

1
Stocksmy: JDBC exception

because it did not print 333 so I believe the problem is that
the connection can not be establish.

Thanks in advance.


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

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




MySQL++ dll linkage warnings

2002-03-15 Thread Thi Cao

Compiler - MSVC 6.0
OS - Windows 2K
MySQL++ 1.7.1

Whenever I perform a build of my project and link against the static
mysql++.lib library, I often get the following warnings.  Because I don't
want to disturb the mysql++ source code, is there anything I can do to
resolve the dllexport implicit definition?  I can always disable the
warnings with a #pragma statement, but I prefer not to do that if at all
possible.

c:\mysql++\sqlplus\convert1.hh(40) : warning C4273: 'strtol' : inconsistent
dll linkage.  dllexport assumed.
c:\mysql++\sqlplus\convert1.hh(41) : warning C4273: 'strtoul' : inconsistent
dll linkage.  dllexport assumed.

Thanks.

Thi

-
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: My JDBC does not work.

2002-03-15 Thread TAKAHASHI, Tomohiro
  Hi,

Jianping Zhu wrote:
 
 I have spend three days try to get jdbc for mysql work, but failed. I am
 very frustrated. I will
 be appreciated if somebody can help me out.
snip
   } catch (Exception e) {
  System.out.println("StocksMy: JDBC exception");
  System.exit(1);
   }
}
 }

  Please print Exception as below and check RDBMS configuration.

} catch (Exception e) {
   System.out.println(e.getMessage());
   e.printStackTrace();
   System.exit(1);
}

-- 
TAKAHASHI, Tomohiro

-
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 problem with ROUND()

2002-03-15 Thread Christopher Thompson

Your problem, I _think_, is that your query works as follows:

for i = 0 to table_name.rows {
row -- table_name.row[i]
if row.count = ROUND(rand() * 10) then result += row
}

NOTE:  ROUND(rand() * 10) is performed FOR EACH ROW in your table.  You 
actually mean for it to be performed once and that specific row be returned.

The solution, then, is to have a constant in your WHERE clause.  Or at least, 
determine its value outside of the select statement.

On Friday 15 March 2002 9:23 am, [EMAIL PROTECTED] wrote:
 I have database with table and 1 milions random characters. Key for
 searching each character is a counter from 1 to milion.

 when I execute statement:

 SELECT count, character FROM table_name WHERE count=ROUND(rand()*10);

 Example:

 count ||  character ||

 1 dasarewr
 2 adswarwrf
 3 sfdqwerw
 4 dfweqrqwe
 5 asdfwerdfwe
 6 fdwerwer
 7 fsdwefwe
 8 frefer
 ...   .

   daswer
 1000  fdferte
   .


 99asdwerer
 100   dasrewg

 RESULT:

 1) Sometimes I get just one result like:
 4352342   dcfsfwer

 2)Sometimes I get TWO results!

 1000fdferte
 99  asdwerer

 3) sometimes even THREE
 


 4) sometimes NONE


 The select statement must to gave me just ONE result!

 Does anyone know what that is about? Does ROUND() have any bugs?

 Sorry for bad english.

 Elvir


 ---end of your message---

 MySQL Development Team


 -
 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




Replication: bin-log confusion and other

2002-03-15 Thread Juergen Jaeschke

Hi, 

i'm setting up a rather simple replication setup but i'm not
able to understand the behaviour of mysql (3.23.44)

- one server is master, all update are on master
- some of the databases on master should be replicated
  to some slaves; the others should not
- create/drop database/table should be replicated for
  theses databases
- cross updates should work

- If bin-log-do-db=xxx is set on master
and nothing on slaves, then - as stated somewhere
in the archive - crossupdates doesn't work. In addition, 
create database is not recoginzed and drop database is only
recognized if it is useed ( seems to be the same Problem )

- If nothing beside bin-log is set on master, 
with replicate-do-db= or replicate-ignore-db= on slaves
problem seems to be the same (as stated in the mysql-doc ). 
Furthermore I don't want to use any of the ignore directives
Can i ignore %.% and replicate-do-wild=db.% ?

- if replicate-do-wild-table=dbname.%, then i get
the create database for any database from master. 

Isn't it possible to do something like
bin-log-do-db=xxx on master, nothing on slave and
to get all updates to mysql concerning this database
(i.e. drop database, create database, any crossupdates) 
as one - o.k., me - would think prior to use ?

Another, similar, effect: i would assume SET sql_log_bin = 0
to forbidd logging for *all* processes and all databases, but
it seems to be only for the current process and all databases. 
Is there a command like set sql_log_bin_ALL|ME_DATABASE|ALL = 0 ?
For now, i have to shtdown mysql, change my.cnf, then restart.


Third Problem:
What about sort of SET other_clients_can't_connect = 1 ?
For sure, i can do flush tables with read lock, update and
release lock, but possible client's would not notice, so
i have to shutdown the db after my update to get sane state. 

Thanks,
Jürgen



-- 
Jürgen Jaeschke  Humboldt-University Berlin
Department of Computer Uses in Education Geschwister-Scholl-Str. 7
D-10099 Berlin   Tel. (030) 2093-4143
PGP Key ID: 9249A675, Fingerprint:   FB953F70 3CEDF075 60D4794B CB8EC240
certified key on all keyservers 




-
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: cannot create Tables with MysqlGUI 1.7.5

2002-03-15 Thread Stefaan Contreras


- Original Message -
From: [EMAIL PROTECTED]
To: Stefaan Contreras [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 5:58 PM
Subject: Re: cannot create Tables with MysqlGUI 1.7.5


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

 sql,query

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

 You have written the following:

 Heya,

 I am quite new to all this intriguing stuff.

 I see my database, but cannot create tables in it. Any ideas?


 Kind regards,

 Stefaan

 ___
 http://www.vitamine-z.com/esse/






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

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




Re: MySQL++ dll linkage warnings

2002-03-15 Thread Sinisa Milivojevic

Thi Cao writes:
 Compiler - MSVC 6.0
 OS - Windows 2K
 MySQL++ 1.7.1
 
 Whenever I perform a build of my project and link against the static
 mysql++.lib library, I often get the following warnings.  Because I don't
 want to disturb the mysql++ source code, is there anything I can do to
 resolve the dllexport implicit definition?  I can always disable the
 warnings with a #pragma statement, but I prefer not to do that if at all
 possible.
 
 c:\mysql++\sqlplus\convert1.hh(40) : warning C4273: 'strtol' : inconsistent
 dll linkage.  dllexport assumed.
 c:\mysql++\sqlplus\convert1.hh(41) : warning C4273: 'strtoul' : inconsistent
 dll linkage.  dllexport assumed.
 
 Thanks.
 
 Thi


You are not using libmysqlclient.dll from 3.23 version of MySQL. 

-- 
Regards,
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
   ___/   www.mysql.com


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

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




RE: replication through port forwarded firewall

2002-03-15 Thread Luc Foisy

From what you are writing here it looks as though you are porting a database
to the slave that has already been bin logging.
If your master has been logging the database in question, and you are
copying that database over to the slave, then of course when it reads the
bin logs from  the master the data is already in there. When you port the
database into the slave it should be a copy of the master database just at
the instance you started the bin logging.

My Slave-Master Setup

( at this time if you want to start over, stop the slave and the master)
1. Dump master database ( perhaps you should lock all the tables from
writing at this time ) Or stop the master server and tar/gzip the master
database directory and send it to the slave server to use later
2. Set master settings( if possible at this time, remove the bin logs and
index file from master HOSTNAME-bin.### and HOSTNAME-bin.index)
3. Create database on slave and load it with the master dump ( remove the
master.info if starting over )
4. Set slave settings
5. Restart the master server so it starts the fresh bin logging ( unlock
your tables if you locked them before )
6. Restart the slave server so it starts its replication process

You could combine a couple of the steps 1-3 by using this on the slave db
mysqladmin -p create databasename
mysqldump -p -h0.0.0.0 -c -q themasterdb | mysql -p databasename
 ^^^
host ip address

this will dump right into the database on the slave ( again you might want
to lock the master from writing at this time )

don't know, this might be your problem


OR 

you could lock the master from writing, note the position and bin file it is
on, copy the master as is, send it to the slave and use the MASTER CHANGE
command to set up the binlog and position on the slave, then start up the
slave and unlock the master of course

hmm what else

GRANT FILE on *.* to replicant@'slaveIP' identified by 'passwd';
This must be FILE and the *.* must be *.* not database.* ( FILE is a
global grant option and is not available to database, table, column
permissions)



-Original Message-
From: John Hunter [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 11:23 AM
To: [EMAIL PROTECTED]
Cc: MySQL mailing list
Subject: Re: replication through port forwarded firewall


 Van == Van  [EMAIL PROTECTED] writes:

Van This means you need to re-initialize the slave; i.e. stop the
Van master and slave; copy the data dir to the slave; start the
Van slave (ensure the perms on the slave are correct first);
Van start the master.  If the error above had been
Van connectivity-related you'd have received different ERROR
Van messages in the log.

Ok, thanks for all you detailed help.  Unfortunately, I am still
having the same problem, so I want to provide a few more details.

1) I shut down the master and shut down the slave with
   '/etc/init.d/mysqld stop' on the master and slave

2) I changed all the ownership on the master to be mysql.mysql with
   chown -R /path/to/data/dir

3) I cd'd into the slave data dir.  This is the dir that has 
   subdirs for the various mysql databases, which contain the *.MYD,
   *.MYI, *.frm files.  I updated the slave data dir with 
   rsync -avz --delete  -e ssh root@nitace:/path/to/data/dir/ .
   This also copied all the mother-001.bin, mother-002.bin etc... files
   from the data dir of the master

4) I restarted the slave and got saw the message in the log that the
   slave could not connect to the master.  This was expected, because
   you said to restart the slave before the master (which I found
   confusing because the manual section 'Replication HOWTO' says to
   restart the master first

5) I restarted the master

6) After the 60 sec wait on the slave, it reattempted a connect to the
   master, which was by then alive, and I got the same error message
   (posted below) about the duplicate insertion from mother-002.bin.
   Although this is a binary file, I did 'less' on it and it has text
   that you can read.  The first command in that file is

  INSERT INTO multifile VALUES (
   2472160,
   '2001-3-9',
   '101.bmp',
   2
   Which is the line that the slave is complaining about.

When I sync my data dirs, the slave dir also has the mother-bin.*
files on it and it gets the mysql user dir from the master.  Is this
correct?

Stumped.

Thanks,
John Hunter

Master mysql version: 3.23.37
Slave mysql version: 3.23.36

Error message:

020315  9:30:52  Slave: connected to master '[EMAIL PROTECTED]:3306',
replication started in log 'FIRST' at position 4
ERROR: 1062  Duplicate entry '2472160-101.bmp-2' for key 1
020315  9:30:52  Slave:  error running query 'INSERT INTO multifile VALUES (
   2472160,
   '2001-3-9',
   '101.bmp',
   2
   )' 
020315  9:30:52  Error running query, slave aborted. Fix the problem, and
re-start the slave thread with mysqladmin start-slave. We 

How to use transactions

2002-03-15 Thread Alexander Burbello

I would like to know how work transactions!! are there is mysql 3.23.49??

If there is, how can I use transaction with rollback and commit? I read
about transaction, and exist other way to use. How can I use?



Regards



Alexander
Curitiba/Pr/Brazil









A busca mais veloz e precisa da internet. Acesse agora: http://www.zoom.com.br.


-
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 problem with ROUND()

2002-03-15 Thread Alec . Cawley


I think you misunderstood how this is going to work. The expression
ROUND(rand()*100) is not a constant, so it is going to re-evaluate it
and generate a *different* random number for each line in the table. Apart
from anything else, this is going to be slow because it will have to scan
the whole table. There is an INDEPENDENT probability of one in a million
that it will match each separate line, so you will get an average of one
hit but, as you have found, sometimes none or two.

One way to solve this would be to use a user variable:

SET @Random = ROUND(rand()*100) ;
SELECT count, character FROM table_name WHERE count = @Random ;

Alternatively, this might work:

SELECT count, character FROM tableName ORDER BY rand() LIMIT 1 ;

 Alec Cawley


---


I have database with table and 1 milions random characters. Key for
searching each character is a counter from 1 to milion.

when I execute statement:

SELECT count, character FROM table_name WHERE count=ROUND(rand()*10);

Example:

count ||character ||

1dasarewr
2adswarwrf
3sfdqwerw
4dfweqrqwe
5asdfwerdfwe
6fdwerwer
7fsdwefwe
8frefer
...  .

 daswer
1000 fdferte
 .


99asdwerer
100   dasrewg

RESULT:

1) Sometimes I get just one result like:
4352342   dcfsfwer

2)Sometimes I get TWO results!

1000fdferte
99  asdwerer

3) sometimes even THREE



4) sometimes NONE


The select statement must to gave me just ONE result!

Does anyone know what that is about? Does ROUND() have any bugs?

Sorry for bad english.

Elvir


---end of your message---

MySQL Development Team


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

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






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

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




RE: MySQL++ dll linkage warnings

2002-03-15 Thread Thi Cao

Sinisa,

I downloaded and am currently using the binary version of 3.23.49.  Are you
saying I should download the source version and build the
libmysqlclient.dll?  Please clarify.  Thanks for the quick response before.

Thi

-Original Message-
From: Sinisa Milivojevic [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 11:10 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: MySQL++ dll linkage warnings


Thi Cao writes:
 Compiler - MSVC 6.0
 OS - Windows 2K
 MySQL++ 1.7.1
 
 Whenever I perform a build of my project and link against the static
 mysql++.lib library, I often get the following warnings.  Because I don't
 want to disturb the mysql++ source code, is there anything I can do to
 resolve the dllexport implicit definition?  I can always disable the
 warnings with a #pragma statement, but I prefer not to do that if at all
 possible.
 
 c:\mysql++\sqlplus\convert1.hh(40) : warning C4273: 'strtol' :
inconsistent
 dll linkage.  dllexport assumed.
 c:\mysql++\sqlplus\convert1.hh(41) : warning C4273: 'strtoul' :
inconsistent
 dll linkage.  dllexport assumed.
 
 Thanks.
 
 Thi


You are not using libmysqlclient.dll from 3.23 version of MySQL. 

-- 
Regards,
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
   ___/   www.mysql.com

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

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




password special character muck up (I think)

2002-03-15 Thread adam nelson

I just had the brilliant idea of using a password for mysql root with
semi-colons:

password is blahblah;;

this appears to have not worked in some way and now I'm stuck.  I don't
want to restart since that isn't very graceful (on a production
machine).  I've tried blahblah;;; and blahblah and blahblah;

Anyone know what to do?


-
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: Grants to a database table that doesn't exist yet

2002-03-15 Thread Scott Helms

Luc,

I think you have to do the manual inserts to make this work before the
tables are there.  I wrestled with this problem briefly, before writing a
quick script.


Scott Helms
Director of Technology, ZCorum

- Original Message -
From: Luc Foisy [EMAIL PROTECTED]
To: MYSQL-List (E-mail) [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 10:44 AM
Subject: Grants to a database table that doesn't exist yet



 Is there someway I can force a Grant to take if the database table doesn't
 exist yet?

 I have the database created, awaiting the data that is being dropped into
 it, but I want to set up privileges to it before it exists so its ready to
 go live in an instant

 mysql GRANT DELETE,SELECT,UPDATE on qbslive.PRINTJOB to
 PrintHandler@'192.168.0.250' identified by 'passwd';
 ERROR 1146: Table 'qbslive.PRINTJOB' doesn't exist

 there would be several grant statements ( about 20, trying to keep the
 database controlled as much as possible)

 I suppose I could do this by editing the tables directly, there is just a
 bit more work involved ( user and tables_priv inserts ). I would really
like
 the server to do the work though through the grant though

 I could create the table first, then make the grants, then delete the
 tables, BUT I have a slave replicating this database ( so when I load the
 data, it will be replicated right from the get go) and I would rather not
 have that unneccissary stuff in the bin logs. ( now I see I should have
 started the replication after I did all the messing around )

 I don't want to stop anything and reconfigure it, cause I know its working
 now and I don't want to make something not work :)

 Anyways, can I force a GRANT on a table that doesnt exist?

 -
 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




Extending tablespace for innodb

2002-03-15 Thread Varshavchick Alexander

Hello,

How can I increase the size of the tablespace for innodb tables? Can you
say if this is a correct procedure:

1. Dumping the database;
2. Stopping it;
3. Deleting innodb log files (ib_logfile0, ...) and innodb data file
specified in innodb_data_file_path;
4. Changing size of data file in innodb_data_file_path;
5. Starting mysql;
6. Restoring the databases from the dump file.

Does it seems to be a correct procedure, or I've messed up something?

Regards

Alexander Varshavchick, Metrocom Joint Stock Company
Phone: (812)118-3322, 118-3115(fax)


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

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




RE: MySQL++ dll linkage warnings

2002-03-15 Thread Sinisa Milivojevic

Thi Cao writes:
 Sinisa,
 
 I downloaded and am currently using the binary version of 3.23.49.  Are you
 saying I should download the source version and build the
 libmysqlclient.dll?  Please clarify.  Thanks for the quick response before.
 
 Thi

No, you are OK.

All you have to do is change settings in VC++, but I truly do not know
which.

Probably our own string routines are conflicting with VC++. But I can
not help you on VC++.

If those are just warnings, disregard them.

-- 
Regards,
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
   ___/   www.mysql.com


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

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




RE: MySQL++ dll linkage warnings

2002-03-15 Thread Thi Cao

Thanks again.

-Original Message-
From: Sinisa Milivojevic [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 11:37 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: MySQL++ dll linkage warnings


Thi Cao writes:
 Sinisa,
 
 I downloaded and am currently using the binary version of 3.23.49.  Are
you
 saying I should download the source version and build the
 libmysqlclient.dll?  Please clarify.  Thanks for the quick response
before.
 
 Thi

No, you are OK.

All you have to do is change settings in VC++, but I truly do not know
which.

Probably our own string routines are conflicting with VC++. But I can
not help you on VC++.

If those are just warnings, disregard them.

-- 
Regards,
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Mr. Sinisa Milivojevic [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
   ___/   www.mysql.com

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

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




Re: How MySQL handles variables

2002-03-15 Thread DL Neil

Hi GEORGE,

 The typical way refers to the update syntax. Ideally,
 I would like to be able to do something like that:
 - read the value of the variable through a read
 statement.
 -Specify the value to be appended.
 -Do the task.

 Could you please help me out with that?

   I would like to ask a simple question about the
  way
   MySQL handles string variabels. Say i have a
  variable
   whose value is foo and I want to change it to
  foobar.
  
   Instead of doing it the 'typical' way, I would
  like to
   ask whether there is any mysql command that will
  allow
   me to say read the value of the variable and then
   append bar to it.
 
  What is the typical way that you don't want to
  use?
 
  Check out CONCAT( foo, bar ) = man ref 6.3.2 String
  Functions

Sounds straightforward enough:

- SELECT colNm [etc] FROM ... WHERE ...
- ascertain the bar to be appended
- UPDATE tblNm SET colNm = CONCAT( colNm, bar ) WHERE ...

The ticklish part is making sure you get the WHERE clause(s) correct.

I'm not sure what you wanted me to say about the middle task. That would
depend upon where you were getting the data to be appended from, and if
you are using native-MySQL or some language calling MySQL across an
API/whatever.

I hope I have understood your question correctly,
=dn


-
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: password special character muck up (I think)

2002-03-15 Thread Luc Foisy

Perhaps the ; is not getting escaped correctly ( though it should if it is
contained in the quotes ('blahblah;;;'). The ; is the end of line token.
maybe it got confused. or maybe its a matter of the client acception the ;'s
you changed your root password? does that mean you are unable to connect
with the client?

-Original Message-
From: adam nelson [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 12:37 PM
To: [EMAIL PROTECTED]
Subject: password special character muck up (I think)


I just had the brilliant idea of using a password for mysql root with
semi-colons:

password is blahblah;;

this appears to have not worked in some way and now I'm stuck.  I don't
want to restart since that isn't very graceful (on a production
machine).  I've tried blahblah;;; and blahblah and blahblah;

Anyone know what to do?


-
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




cannot create Tables with MysqlGUI 1.7.5

2002-03-15 Thread Stefaan Contreras

Heya,

I am quite new to all this intriguing stuff.

I use mysql-3.23.47-win with MySqlGUI 1.7.5
I see my mysql database, but cannot create tables in it.

Any ideas?


Kind regards,

Stefaan

___
http://www.vitamine-z.com/esse/


-
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: joining 2 identical tables

2002-03-15 Thread DL Neil

Hi Christian,

 i'm working on a project for managing used motorcycles. for security
reasons
 i setup two identical tables. both with the same attributes.
 ID,UNIID,Manufacurer... one of the tables is named Com and the other
 Prv.

 till now i used to search either Com or Prv. but i want to look
for a
 match in both of them and listing the result. i have tried anything i
knew,
 but without luck.

 please can anyone tell me, how the SQL Statment must look like to get
such
 an output?

 -
 Com
 -
 ID | UNIID | Manufacturer |
 -
 1  | 12D2  | Yamaha   |
 2  | 21E3  | test  |

 -
 Prv
 -
 ID | UNIID | Manufacturer |
 -
 1  | 43I2   | Kawasaki  |
 2  | 68U2  | Something|


 -
 output 
 -
 ID | UNIID | Manufacturer |
 -
 1  | 43I2   | Kawasaki  |
 2  | 68U2  | Something|
 1  | 12D2  | Yamaha   |
 2  | 21E3  | test  |


 (Data of ID's equals, UNIID's are different, Manufacturer's are
different.)


Check out the SELECT ... UNION ... SELECT... possibility at 6.4.1.2
UNION Syntax.
Alternatively because the tables follow an identical schema, or if you
have an older version of MySQL take a look at 7.2 MERGE Tables.

Regards,
=dn


-
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




UDFs (2nd Try)

2002-03-15 Thread Scalper

Hello:

I never received an answer to the first try, so I thought I might try again.

Has anyone out there been able to successfully compile a UDF for Win32 and 
if so, do they have a simple example?  I looked in the archives and there 
are plenty of questions, but no answers to this.

Thanks,
Craig

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: joining 2 identical tables

2002-03-15 Thread Gurhan Ozen

Hi Christian,
You can create a temporary table (see manual
http://www.mysql.com/doc/C/R/CREATE_TABLE.html) with the same structure as
prv or com and populate it with prv's and com's data by using
INSERT INTO  SELECT ... syntax (see manual
http://www.mysql.com/doc/I/N/INSERT_SELECT.html)

Gurhan


-Original Message-
From: Christian [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 11:22 AM
To: [EMAIL PROTECTED]
Subject: joining 2 identical tables



hi,

i'm working on a project for managing used motorcycles. for security reasons
i setup two identical tables. both with the same attributes.
ID,UNIID,Manufacurer... one of the tables is named Com and the other
Prv.

till now i used to search either Com or Prv. but i want to look for a
match in both of them and listing the result. i have tried anything i knew,
but without luck.

please can anyone tell me, how the SQL Statment must look like to get such
an output?

-
Com
-
ID | UNIID | Manufacturer |
-
1  | 12D2  | Yamaha   |
2  | 21E3  | test  |

-
Prv
-
ID | UNIID | Manufacturer |
-
1  | 43I2   | Kawasaki  |
2  | 68U2  | Something|


-
output 
-
ID | UNIID | Manufacturer |
-
1  | 43I2   | Kawasaki  |
2  | 68U2  | Something|
1  | 12D2  | Yamaha   |
2  | 21E3  | test  |


(Data of ID's equals, UNIID's are different, Manufacturer's are different.)

many thanx in advance

yours christian



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

2002-03-15 Thread Venu

Hi !!

 -Original Message-
 From: m.colurcio@ [mailto:[EMAIL PROTECTED]]On Behalf Of Massimo
 Colurcio
 Sent: Friday, March 15, 2002 1:59 AM
 To: [EMAIL PROTECTED]
 Subject: Slow query
 
 
 Hi all.
 
 I'm using MySQL server 3.23.47 (client 3.23.44) on Windows 98 (...sorry)
 accessing to database via ODBC (MySQL ODBC release 3.5.01.01) and 
 VC++6.0  MFC
 (CRecordset).
 I have noticed that queries are really slow... with a simple 
 SELECT like this:
 
 SELECT 
 ID_Field, Text_Field, Date_Field, Num_Field 
 FROM 
 mytable 
 ORDER BY 
 Num_Field
 
 the server takes about 31 seconds to show all the 2872 records.
 
 I tried to modify some parameters in the DSN and I noticed that 
 checking 'Use
 compressed protocol' the same query takes only about 6 seconds to 
 complete and I
 said That's great :
 I have used  for the tests WinSQL (www.indus-soft.com/winsql) and 
 -of course-
 the program I'm developing.
 
 Now I would like to know:
 Am I doing something wrong?

No. There is nothing wrong in using the compressed protocol.

Also, the current dynamic cursor behaviour slows down the 
performance drastically. I am working on this to have a different 
logic, and probably included in the next 3.51.03 version.

I recommend you to use 3.51.02 instead of .01 as the new one has lot 
of fixes and improvements on Windows.

Regards, Venu
--
For technical support contracts, go to https://order.mysql.com
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /   Mr. Venu [EMAIL PROTECTED]
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Developer
/_/  /_/\_, /___/\___\_\___/  California, USA
   ___/  www.mysql.com
 

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

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




RE: password special character muck up (I think)

2002-03-15 Thread adam nelson

I don't see how to submit 'blahblah;;' using the quotes.

I've tried

mysql -u root

and then typed all the conceivable combinations for password

and 

mysql -u root --password=blahblah;;

and

mysql -u root --password='blahblah;;'

What's worse is that I've looked at the raw table file and confirmed
that the password is blahblah;;

I could change it manually, but I don't want to corrupt the table (I
assume that's a real possibility).  -- tried that on a dev machine, it
doesn't work because I can't flush the privileges.


-
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: password special character muck up (I think)

2002-03-15 Thread adam nelson

I can access the client using other users, but none have mysql database
access (ie. everything is fine except that I can't add users).  If
nobody knows the answer, I will restart with skip-grant-tables during
off-hours.


-
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: My JDBC does not work.

2002-03-15 Thread Jianping Zhu


Thanks for your advices.
After I modified my code according to your advice i get following error
message.

Invalid authorization specification: Access denied for user: 
'jianping@chambleea' (Using password: YES)
java.sql.SQLException: Invalid authorization specification: Access denied 
for user: 'jianping@chambleea' (Using password: YES)
at org.gjt.mm.mysql.MysqlIO.init(MysqlIO.java:330)
at org.gjt.mm.mysql.Connection.connectionInit(Connection.java:261)
at 
org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89)
at org.gjt.mm.mysql.Driver.connect(Driver.java:167)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:199)
at StocksMy.main(StocksMy.java:66)


I am just wondering, I do have a account 'jianping' which have all
privilege in global level.

I will be appreciated for any further advice.

 



On Fri, 15 Mar 2002, Diego, Emil wrote:

 
 Try using a URL in the following format
 
 m_dbURL = jdbc:mysql:// + m_dbServer + / + m_dbName;
 
 and then use the following statement to connect.
 
 m_dbConn  = DriverManager.getConnection(m_dbURL, m_dbUID, m_dbPWD);
 
 
 
 Also add the following statement to your SQL Exception to get a more
 meaningfull error message
 
 System.out.println(e.getMessage());
 
 Try this and post the error message you are getting, that should give us a
 better idea of what is going wrong with the connection attempt.
 
 
 Emil Diego
 Web Coordinator
 University of Miami School of Business
 [EMAIL PROTECTED]
 ph: 305.284.5449
 fx: 305.284.3404
 
 
 
 -Original Message-
 From: Jianping Zhu [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 15, 2002 11:22 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: My JDBC does not work.
 
 
 
 I have spend three days try to get jdbc for mysql work, but failed. I am
 very frustrated. I will
 be appreciated if somebody can help me out.
 
 I have redhat 7.2 OS, I download the sever and client mysql .rpm files and
 instaled it, i believe succssfully. i use command like 'mysqladmin
 version' to test the mysql server, the server seems work fine, I have a
 mysql user account 'jianping' which has been granted all global privilges. 
 
 I downloaded  the JDBC mm.mysql-2.0.4-bin.jar to my system and set the env
 varible properly.
 
 I have a database called 'evote' and there is one table 'stocks' in the
 database.
 I use the code download form a jDBc tutrial website the code is:   
   
 
 import java.sql.*;
 import java.io.*;
 import java.util.*;
 
 class StocksMy {
public static void main (String args []) {
 
   try {
 
  Class.forName(org.gjt.mm.mysql.Driver).newInstance();
   System.out.println();
 
  // Create a Connection and a Statement
  Connection conn = DriverManager.getConnection(
 
 jdbc:mysql://localhost/evote?user=jianpingpassword=ping1830);
   System.out.println(33);
  Statement stmt = conn.createStatement();
  // Select all columns from the STOCKS table
  ResultSet rset = stmt.executeQuery (select * from stocks);
 
  // Iterate through the result and print the records
  while (rset.next()) {
 String ticker=rset.getString(1).trim();
 String title=rset.getString(2).trim();
 String price=rset.getString(3).trim();
 String blanks=
   ;
 // print the data in a table format
 System.out.print (ticker);
 System.out.print(blanks.substring(1,8-ticker.length()));
 System.out.print (title);
 System.out.print(blanks.substring(1,41-title.length()));
 System.out.println (price);
  }
   } catch (Exception e) {
  System.out.println(StocksMy: JDBC exception);
  System.exit(1);
   }
}
 }
 
 I added some System.out.println () trying to the code.
 
 The code can be compiled succesfully, but when i tried to execute it, it
 gave  folliing output.
 
 1
 Stocksmy: JDBC exception
 
 because it did not print 333 so I believe the problem is that
 the connection can not be establish.
 
 Thanks in advance.
 
 
 -
 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
 



Jianping Zhu
Department of Computer Science
Univerity of Georgia 
Athens, GA 30602
Tel 706 5423900

Berkeley DB 10,000,000 rows

2002-03-15 Thread Aaron D. Turner

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


I've got a small database (16 tables, a few thousand rows total) running
3.23.48-max w/ 3 of the tables Berkeley DB (for transactions) on Solaris
7/SPARC.  One of these tables (the largest of the 3) has a little over
1,000 rows and occasionally sometime during the night when nobody is using
the DB, MySQL get's really confused and fails to do any SELECT's against
the table and thinks there are *10,000,000* rows (at least that's what
PHPMyAdmin is reporting).

Problem goes away once I restart mysqld and as far as I can tell, there's
no corruption.

I've checked the logs, and as far as I can tell the only thing that
happens during the night is the backups.  However, the backup scripts
shutdown the daemon, do the backup, and then restart.  I've verified the
backup and mysql logs and it shows the daemon being stopped/started
properly.

I'm really at a loss to explain what's going on.  Thoughts anyone?

- -- 
Aaron D. Turner  Security Architect, OneSecure  http://www.onesecure.com/
[EMAIL PROTECTED]  work: 408-992-8045  cell: 408-314-9874
pub  1024D/1B57EB4D 2000-09-27 Aaron D. Turner [EMAIL PROTECTED]
 Key fingerprint = F90C BFB4 4404 5504 295D  4435 578B 1DD5 1B57 EB4D
All emails by me are PGP signed; an invalid signature indicates a forgery.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Public key 0x1B57EB4D at: http://www.keyserver.net/en/
Filter: gpg4pine 4.1 (http://azzie.robotics.net)

iEYEARECAAYFAjySVT8ACgkQV4sd1RtX600q4gCeI172L0PtL1M4UH8BQwjy/i9G
NKQAn3ky3JMge21+h3zVrCFDka6aQryp
=zQzD
-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




Is the new MySQL table cache implemented in InnoDb? #

2002-03-15 Thread BD

The eWeek article http://www.eweek.com/article/0,3658,s=708a=23115,00.asp 
that benchmark the various databases including MySQL stated:

MySQL's great performance was due mostly to our use of an in-memory query 
results cache that is new in MySQL 4.0.1. When we tested without this 
cache, MySQL's performance fell by two-thirds.

1) Has this new caching been implemented for InnoDb tables?
2) If not, will it be implemented for InnoDb tables? Time frame?

TIA

Brent 


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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




SOLUTION: can't run mysql_install_db on Solaris 2.8

2002-03-15 Thread Chuck Roberts

Found the fix!

What happened to me is I had used Winzip to unzip and untar the
files on a Win2000 machine, then copied those files to the
server. However, I found GNU tar, installed it, deleted my old
mysql directory, and used GNU tar to untar the file in
/usr/local. After that mysql_install_db worked fine. I didn't
have to change permissions or anything.


-
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: My JDBC does not work.

2002-03-15 Thread Linux Rules

On Fri, 15 Mar 2002, Jianping Zhu wrote:


 I have spend three days try to get jdbc for mysql work, but failed. I am
 very frustrated. I will
 be appreciated if somebody can help me out.

 I have redhat 7.2 OS, I download the sever and client mysql .rpm files and
 instaled it, i believe succssfully. i use command like 'mysqladmin
 version' to test the mysql server, the server seems work fine, I have a
 mysql user account 'jianping' which has been granted all global privilges.

 I downloaded  the JDBC mm.mysql-2.0.4-bin.jar to my system and set the env
 varible properly.

 I have a database called 'evote' and there is one table 'stocks' in the
 database.
 I use the code download form a jDBc tutrial website the code is:

 
 import java.sql.*;
 import java.io.*;
 import java.util.*;

 class StocksMy {
public static void main (String args []) {

   try {

  Class.forName(org.gjt.mm.mysql.Driver).newInstance();
   System.out.println();

  // Create a Connection and a Statement
  Connection conn = DriverManager.getConnection(

 jdbc:mysql://localhost/evote?user=jianpingpassword=ping1830);
   System.out.println(33);
  Statement stmt = conn.createStatement();
  // Select all columns from the STOCKS table
  ResultSet rset = stmt.executeQuery (select * from stocks);

  // Iterate through the result and print the records
  while (rset.next()) {
 String ticker=rset.getString(1).trim();
 String title=rset.getString(2).trim();
 String price=rset.getString(3).trim();
 String blanks=
   ;
 // print the data in a table format
 System.out.print (ticker);
 System.out.print(blanks.substring(1,8-ticker.length()));
 System.out.print (title);
 System.out.print(blanks.substring(1,41-title.length()));
 System.out.println (price);
  }
   } catch (Exception e) {
  System.out.println(StocksMy: JDBC exception);
  System.exit(1);
   }
}
 }
 
 I added some System.out.println () trying to the code.

 The code can be compiled succesfully, but when i tried to execute it, it
 gave  folliing output.

 1
 Stocksmy: JDBC exception

 because it did not print 333 so I believe the problem is that
 the connection can not be establish.

 Thanks in advance.



 ___
 Redhat-list mailing list
 [EMAIL PROTECTED]
 https://listman.redhat.com/mailman/listinfo/redhat-list




Why don't you print the error ??

tr{
blablabla

}catch ( Exception X ){
System.out.println ( X.getMessage() );
}

this way your java program will tell you what's the problemo


Seguimos ...

leonel;



-
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




mingw, mysql c api, win2k cmd line error

2002-03-15 Thread David Thompson

I am having a heck of a time getting a simple c program up and running using mingw and 
the mysql c api.

My makefile is simple enough I'm not sure what the -lm switch on the search compile 
line is for but I saw it in someone's makefile on the web so I through it in hoping it 
would work):

# makefile for search

CC = gcc
CFLAGS = -Ic:\progra~1\mysql\include
COUT = search.exe
OBJ = main.o search.o site.o sqldb.o


default : search
pause
copy $(COUT) c:\usr\www\localhost\htdocs\cgi-bin\$(COUT)

search : $(OBJ)
$(CC) $(CFLAGS) -o $(COUT) $(OBJ) -Lc:\progra~1\mysql\lib\opt -lmysqlclient -lm

main.o : main.c
$(CC) $(CFLAGS) -c main.c

search.o : search.c
$(CC) $(CFLAGS) -c search.c

site.o : site.c
$(CC) $(CFLAGS) -c site.c

sqldb.o : sqldb.c
$(CC) $(CFLAGS) -c sqldb.c

clean :
del *.o
del $(COUT)

--

My c program contains the following (neither function is being called):

#ifndef SQLDB_H
#define SQLDB_H

#include windows.h
#include mysql.h

typedef MYSQL SQLDB;

SQLDB *sqldb_init(SQLDB *);
int sqldb_term(SQLDB *);

SQLDB *sqldb_init(SQLDB *sqldb)
{
return mysql_init(sqldb);
}

#endif /* SQLDB_H */

--

And the following error is being reported:

gcc -Ic:\progra~1\mysql\include -c main.c
gcc -Ic:\progra~1\mysql\include -c search.c
gcc -Ic:\progra~1\mysql\include -c site.c
gcc -Ic:\progra~1\mysql\include -c sqldb.c
gcc -Ic:\progra~1\mysql\include -o search.exe main.o search.o site.o sqldb.o -Lc
:\progra~1\mysql\lib\opt -lmysqlclient -lm
Warning: resolving __iob by linking to __imp___iob (auto-import)
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/my_thr_init.obj)(.text+0x1e)
:C:\49\mysys\my_thr: variable '_iob' can't be auto-imported. Please read the doc
umentation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/default.obj)(.text+0x2b2):C:
\49\mysys\defaul: variable '_iob' can't be auto-imported. Please read the docume
ntation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/default.obj)(.text+0x44a):C:
\49\mysys\defaul: variable '_iob' can't be auto-imported. Please read the docume
ntation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/default.obj)(.text+0x47e):C:
\49\mysys\defaul: variable '_iob' can't be auto-imported. Please read the docume
ntation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/default.obj)(.text+0x38):C:\
49\mysys\defaul: variable '_iob' can't be auto-imported. Please read the documen
tation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/default.obj)(.text+0x107):C:
\49\mysys\defaul: variable '_iob' can't be auto-imported. Please read the docume
ntation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/default.obj)(.text+0x137):C:
\49\mysys\defaul: variable '_iob' can't be auto-imported. Please read the docume
ntation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/default.obj)(.text+0x156):C:
\49\mysys\defaul: variable '_iob' can't be auto-imported. Please read the docume
ntation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/default.obj)(.text+0x164):C:
\49\mysys\defaul: variable '_iob' can't be auto-imported. Please read the docume
ntation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/my_messnc.obj)(.text+0x1):C:
\49\mysys\my_mes: variable '_iob' can't be auto-imported. Please read the docume
ntation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/my_messnc.obj)(.text+0x16):C
:\49\mysys\my_mes: variable '_iob' can't be auto-imported. Please read the docum
entation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/my_messnc.obj)(.text+0x2e):C
:\49\mysys\my_mes: variable '_iob' can't be auto-imported. Please read the docum
entation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/my_messnc.obj)(.text+0x39):C
:\49\mysys\my_mes: variable '_iob' can't be auto-imported. Please read the docum
entation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/my_messnc.obj)(.text+0x4f):C
:\49\mysys\my_mes: variable '_iob' can't be auto-imported. Please read the docum
entation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/my_messnc.obj)(.text+0x5a):C
:\49\mysys\my_mes: variable '_iob' can't be auto-imported. Please read the docum
entation for ld's --enable-auto-import for details.
c:\progra~1\mysql\lib\opt\mysqlclient.lib(./release/my_messnc.obj)(.text+0x66):C
:\49\mysys\my_mes: variable '_iob' can't be auto-imported. Please 

Server Databases Clash

2002-03-15 Thread Kenneth Hylton

I read your article and found it to be interesting and overall, quite
accurate.

I do have one bone to pick with you however.

I know the MySQL staffer who worked the MySQL portion of the test.  I had
occasion to meet him and talk briefly about the PC Magazine test in Houston
the week following the test.

From my discussions with him, I also believe that the MySQL folks asked if
they could use a Linux based platform instead of Win2K and were told no.

That's fine in that it makes the comparisons fair for all vendors.

Frankly, I was surprised that MySQL did as well as it did under Win2K!

My problem is that you then published numbers for MS SQL Server running in a
non-standard configuration from the rest of the test!

... As an extra data point, we also rewrote the benchmark in ASP .Net and,
due to time constraints, tested just SQL Server on this platform. We stress
that the results of this test are not comparable to the Java benchmark
results because the ASP .Net test used a different Web server (Internet
Information Services 5.0), different application engine (ASP .Net) and
different database driver (OLE DB). 
However, our results do provide evidence that this all-Microsoft software
stack can produce excellent performance, peaking at just under 870 pages per
second ...
This leads one to believe that SQL Server and an all Microsoft solution is
better than the 600 pages per second that MySQL and Oracle were able to
serve up.
At least that would have been the conclusion that I would have drawn from
your article, not knowing the the test environment was supposedly fixed for
all competitors.
If you want to let SQL Server turn in it's highest numbers by running on a
native platorm, that's fine.  Just let the rest of the competitors do the
same.
Yes, I know that everyone would be interested in .Net performance, but I
just don't think it should have been presented in a way that appears
misleading.

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261

sql, query

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

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




tuning mysql

2002-03-15 Thread Scott Helms

I have a fairly decent server who is handling lots of connections, but very
simple SQL and I am looking for tuning advice.  I have a pretty high number
of simultaneous connections and the box is showing a few signs of stress,
that I want to address before they become a problem.  Any help will be
greatly appreciated.

Scott



Here are some box stats:

The disk is 10k UltraSCSI.

model:UltraAX-i2
Sun development name: Flapjack2
Solaris 8 10/00 s28s_u2wos_11b SPARC, 64-bit kernel, SunOS 5.8
1 UltraSPARC-IIe cpu, cpu freq: 500MHz, system freq: 100MHz
CPU Units:
= CPUs =
Run   Ecache   CPUCPU
Brd  CPU   Module   MHz MBImpl.   Mask
---  ---  ---  -  --  --  
 0 0 0  500 0.2   13   1.4
Memory Units:
socket DIMM0 has a 256MB DIMM (address 0x-0x0fff)
socket DIMM1 has a 256MB DIMM (address 0x2000-0x2fff)
socket DIMM2 has a 512MB DIMM (address 0x4000-0x5fff)
empty sockets: DIMM3
total memory = 1024MB (1GB)

This is what I have in the mysqld section of the my.cnf:
[mysqld]
port= 3306
socket  = /tmp/mysql.sock
skip-locking
skip-name-resolve
set-variable= key_buffer=512M
set-variable= max_allowed_packet=1M
set-variable= table_cache=768
set-variable= sort_buffer=2M
set-variable= record_buffer=2M
set-variable= myisam_sort_buffer_size=64M
set-variable= thread_cache=8
# Try number of CPU's*2 for thread_concurrency
set-variable= thread_concurrency=8
set-variable= max_connections=1000
log-bin




Below is the output of a show status:
mysql show status
- ;
+--+---+
| Variable_name| Value |
+--+---+
| Aborted_clients  | 97|
| Aborted_connects | 818   |
| Bytes_received   | 62528355  |
| Bytes_sent   | 103284617 |
| Connections  | 180746|
| Created_tmp_disk_tables  | 0 |
| Created_tmp_tables   | 14|
| Created_tmp_files| 0 |
| Delayed_insert_threads   | 0 |
| Delayed_writes   | 0 |
| Delayed_errors   | 0 |
| Flush_commands   | 1 |
| Handler_delete   | 25|
| Handler_read_first   | 0 |
| Handler_read_key | 290436|
| Handler_read_next| 605   |
| Handler_read_prev| 0 |
| Handler_read_rnd | 115416|
| Handler_read_rnd_next| 449963586 |
| Handler_update   | 115780|
| Handler_write| 115929|
| Key_blocks_used  | 4950  |
| Key_read_requests| 1743430   |
| Key_reads| 3902  |
| Key_write_requests   | 464   |
| Key_writes   | 533   |
| Max_used_connections | 207   |
| Not_flushed_key_blocks   | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables  | 198   |
| Open_files   | 259   |
| Open_streams | 0 |
| Opened_tables| 185   |
| Questions| 647665|
| Select_full_join | 0 |
| Select_full_range_join   | 0 |
| Select_range | 122   |
| Select_range_check   | 0 |
| Select_scan  | 59926 |
| Slave_running| OFF   |
| Slave_open_temp_tables   | 0 |
| Slow_launch_threads  | 0 |
| Slow_queries | 0 |
| Sort_merge_passes| 0 |
| Sort_range   | 0 |
| Sort_rows| 0 |
| Sort_scan| 0 |
| Table_locks_immediate| 465361|
| Table_locks_waited   | 763   |
| Threads_cached   | 4 |
| Threads_created  | 6167  |
| Threads_connected| 47|
| Threads_running  | 4 |
| Uptime   | 9010  |
+--+---+





-
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




404 on search function on mysql.com

2002-03-15 Thread Steve Suehring

Hi,

For some reason I get a 404 error when I click on 'search' in the Quick 
links section at http://www.mysql.com/documentation/mysql/bychapter/.

It looks like it does some type of redirect so my browser could be broken 
too, but usually not so much with a 404.  :)

Steve

-
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




Remote access to MySQL

2002-03-15 Thread Thomas Schweikle


Hi!

I want to access various databases on a MySQL server remotely. I've set up
an entry in the mysql.user table to allow access to mysql for all hosts
in subnet 10.2.107.0/255.255.255.0. First this worked fine. Then my server
moved from address 10.2.107.24 to 10.2.107.204. Now I do not have access
anymore to any of the databases except on the server itself accessing via
localhost.

Any idea how to bring this back to work to allow access to whole subnet
10.2.107.0/255.255.255.0 would be appreciated!

--
Thomas


-
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




Bad pthreads detection on Tru64 5.1a

2002-03-15 Thread Dan Nelson

Description:

Tru64 5.1a is more strict than other versions of Tru64 when
compiling a threaded program.

extract of pthreads.h file on Tru64 5.1:

/*
 * Enable reentrant errno.h. HOWEVER: this is here only to avoid breaking old
 * (and incorrect) code that assumes it's here. This will only work if
 * pthread.h is the first header file included, and it is always far better
 * to avoid such assumptions. You should always define _REENTRANT on the
 * command line, usually by using cc -pthread or cxx -pthread, to be sure
 * that it will be available for all header files.
 */
#ifdef _PTHREAD_ENV_UNIX
# ifndef _REENTRANT
#  define _REENTRANT1
# endif
#endif

extract of pthreads.h file on Tru64 5.1a:

#ifdef _PTHREAD_ENV_UNIX
# ifndef _REENTRANT
#  error Please compile the module including pthread.h with -pthread
# endif
#endif


How-To-Repeat:
   ./configure , then notice that mit-pthreads is getting built

Fix:
   
--- configure.in~   Thu Mar 14 16:40:46 2002
+++ configure.inThu Mar 14 16:40:46 2002
@@ -907,6 +907,8 @@
then
  with_named_thread=-lpthread -lmach -lexc
  #with_named_thread=-lpthread -lmach -lexc -lc
+ CFLAGS=$CFLAGS -D_REENTRANT
+ CXXFLAGS=$CXXFLAGS -D_REENTRANT
  AC_DEFINE(HAVE_DEC_THREADS)
  AC_MSG_RESULT(yes)
else




Submitter-Id:  submitter ID
Originator:Dan Nelson [EMAIL PROTECTED]
Organization:  The Allant Group
MySQL support: none
Synopsis:  Bad pthreads detection on Tru64 5.1a
Severity:  serious
Priority:  medium
Category:  mysql
Class: sw-bug
Release:   mysql-3.23.49 (Source distribution)
Server: /usr/local/bin/mysqladmin  Ver 8.23 Distrib 3.23.49, for dec-osf5.1 on 
alphaev56
Copyright (C) 2000 MySQL AB  MySQL Finland AB  TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version  3.23.49-log
Protocol version10
Connection  Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 2 hours 49 min 1 sec

Threads: 1  Questions: 9  Slow queries: 0  Opens: 6  Flush tables: 1  Open tables: 0 
Queries per second avg: 0.001
Environment:

System: OSF1 dbsrv1.emsphone.com V5.1 1885 alpha
Machine: alpha
Some paths:  /bin/perl /sbin/make /usr/local/bin/gmake /usr/local/bin/gcc /bin/cc
GCC: Reading specs from /usr/local/lib/gcc-lib/alphaev56-dec-osf5.1/3.0.4/specs
Configured with: ./configure 
Thread model: single
gcc version 3.0.4
Compilation info: CC='gcc'  CFLAGS=''  CXX='g++'  CXXFLAGS=''  LDFLAGS=''
LIBC: 
lrwxrwxrwx   1 root system17 Feb 24  2001 /lib/libc.a - ../ccs/lib/libc.a
lrwxrwxrwx   1 root system17 Feb 24  2001 /usr/lib/libc.a - 
../ccs/lib/libc.a
Configure command: ./configure --localstatedir=/var/db/mysql --without-debug 
--without-bench --with-innodb

-
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




Bad pthreads detection on Tru64 5.1a

2002-03-15 Thread Dan Nelson

Description:

Tru64 5.1a is more strict than other versions of Tru64 when
compiling a threaded program.

extract of pthreads.h file on Tru64 5.1:

/*
 * Enable reentrant errno.h. HOWEVER: this is here only to avoid breaking old
 * (and incorrect) code that assumes it's here. This will only work if
 * pthread.h is the first header file included, and it is always far better
 * to avoid such assumptions. You should always define _REENTRANT on the
 * command line, usually by using cc -pthread or cxx -pthread, to be sure
 * that it will be available for all header files.
 */
#ifdef _PTHREAD_ENV_UNIX
# ifndef _REENTRANT
#  define _REENTRANT1
# endif
#endif

extract of pthreads.h file on Tru64 5.1a:

#ifdef _PTHREAD_ENV_UNIX
# ifndef _REENTRANT
#  error Please compile the module including pthread.h with -pthread
# endif
#endif


How-To-Repeat:
   ./configure , then notice that mit-pthreads is getting built

Fix:
   
--- configure.in~   Thu Mar 14 16:40:46 2002
+++ configure.inThu Mar 14 16:40:46 2002
@@ -907,6 +907,8 @@
then
  with_named_thread=-lpthread -lmach -lexc
  #with_named_thread=-lpthread -lmach -lexc -lc
+ CFLAGS=$CFLAGS -D_REENTRANT
+ CXXFLAGS=$CXXFLAGS -D_REENTRANT
  AC_DEFINE(HAVE_DEC_THREADS)
  AC_MSG_RESULT(yes)
else




Submitter-Id:  submitter ID
Originator:Dan Nelson [EMAIL PROTECTED]
Organization:  The Allant Group
MySQL support: none
Synopsis:  Bad pthreads detection on Tru64 5.1a
Severity:  serious
Priority:  medium
Category:  mysql
Class: sw-bug
Release:   mysql-3.23.49 (Source distribution)
Server: /usr/local/bin/mysqladmin  Ver 8.23 Distrib 3.23.49, for dec-osf5.1 on 
alphaev56
Copyright (C) 2000 MySQL AB  MySQL Finland AB  TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version  3.23.49-log
Protocol version10
Connection  Localhost via UNIX socket
UNIX socket /tmp/mysql.sock
Uptime: 2 hours 49 min 1 sec

Threads: 1  Questions: 9  Slow queries: 0  Opens: 6  Flush tables: 1  Open tables: 0 
Queries per second avg: 0.001
Environment:

System: OSF1 dbsrv1.emsphone.com V5.1 1885 alpha
Machine: alpha
Some paths:  /bin/perl /sbin/make /usr/local/bin/gmake /usr/local/bin/gcc /bin/cc
GCC: Reading specs from /usr/local/lib/gcc-lib/alphaev56-dec-osf5.1/3.0.4/specs
Configured with: ./configure 
Thread model: single
gcc version 3.0.4
Compilation info: CC='gcc'  CFLAGS=''  CXX='g++'  CXXFLAGS=''  LDFLAGS=''
LIBC: 
lrwxrwxrwx   1 root system17 Feb 24  2001 /lib/libc.a - ../ccs/lib/libc.a
lrwxrwxrwx   1 root system17 Feb 24  2001 /usr/lib/libc.a - 
../ccs/lib/libc.a
Configure command: ./configure --localstatedir=/var/db/mysql --without-debug 
--without-bench --with-innodb

-
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




stored procedure

2002-03-15 Thread sandra

Hi:
Can anyone help about how can I create stored procedure to mysql? I took a
look to mylua but it is just to Linux. My server is Windows 2000. In the
MySql documentation I just see some examples in C, but I don't know how can
I do it, and if I done it in C, how I would call it from php?
Thanks in advance
Sandra


-
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




drop down list using php and mysql

2002-03-15 Thread mailing list

Hello,

I am trying to build a drop down list using php and mysql.  Does anyone
have any examples of this?

Regards,

Adrian


-
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




insert and select

2002-03-15 Thread Javier Gloria

Hi:

how i can insert and select information  at the same time.

first i want to insert the information relative to the client and after 
that i need to select the same information on the same query.

that is possible



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.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




ssl confusion

2002-03-15 Thread Chris Hanes

Hi All,
I've been through the list archives and the documentation and have found no
good discussion of getting ssl connetions working with mysql 4.  My main
question is how does one provide mysqld with a private key and certificate?
Also, how is the --des-key-file command line arg used.  I am guessing it has
something to do with providing mysqld with a password to an encrytped rsa
private key?  All help would be greatly appreciated here.

Thanks..


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

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




Re: insert and select

2002-03-15 Thread c.smart

Hi

No you can't.

if you are using and AUTO_INCREMENT field as a key you could follow the
INSERT with a select statement like:
SELECT * FROM tablename WHERE keyfield = LAST_INSERT_ID()

See the manual: LAST_INSERT_ID()
http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Miscellaneous_functions

Javier Gloria wrote:

 Hi:

 how i can insert and select information  at the same time.

 first i want to insert the information relative to the client and after
 that i need to select the same information on the same query.

 that is possible

 _
 Do You Yahoo!?
 Get your free @yahoo.com address at http://mail.yahoo.com

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

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


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

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




update mysql database via php form

2002-03-15 Thread Valerie Brooks

Hi,

I'm using php form to update mysql database, the form has several drop down 
menus to choose from.  What would the best way of updating information in the 
database, update, as a function?  Any help will be greatly appericated.

Thanks.


-


Valerie Brooks
Fujitsu Software
Voice: (408)456-7222
Email:  [EMAIL PROTECTED]


There's no limit to what can be accomplished
 if it doesn't matter who gets the credit


-
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




Access denied for user: 'root@localhost'

2002-03-15 Thread Chris Becker

root login failing??? why?  anonymus failing too??

I just installed the following on Win2k Server:
Ver 8.23 Distrib 3.23.47, for Win95/Win98 on i32
Server version  3.23.47-max-nt

Install goes seemingly ok.  I test whether or not MySQL is working and have 
problem with this command below...

C:\mysql\binmysqlshow -u root mysql
mysqlshow: Access denied for user: 'root@localhost' (Using password: NO)

C:\mysql\binmysql mysql
ERROR 1044: Access denied for user: '@localhost' to database 'mysql'

C:\mysql\bin\mysql test  (this works ok)

tia

chris

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


-
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: drop down list using php and mysql

2002-03-15 Thread Gurhan Ozen

Hi,
This type of qustion should be forwarded to PHP-DB list. Its adres is:
[EMAIL PROTECTED] .

As for the answer to your question.. IF you'd like to create a dynamic
drop-down menu.. You can just just query the table for the options to be
displayed and loop through the result set and print them on html .. For
example:

   $query=select field from table;
   $result=mysql_query($query);
   $numrows=mysql_num_rows($result);

   echo 'select name=categories';
   for ($i=0; $numresult  $i; $i++)
   {
 $row=mysql_fetch_array($result);
 echo 'option'.($row[field]).'';
   }


Gurhan

-Original Message-
From: mailing list [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 4:52 PM
To: [EMAIL PROTECTED]
Subject: drop down list using php and mysql


Hello,

I am trying to build a drop down list using php and mysql.  Does anyone
have any examples of this?

Regards,

Adrian


-
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: drop down list using php and mysql

2002-03-15 Thread Gurhan Ozen

A correction... for line has the greater sign wrong:) It has to be :

 for ($i=0; $numresult  $i; $i++)

Sorry about that:)

Gurhan

-Original Message-
From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 6:01 PM
To: mailing list; [EMAIL PROTECTED]
Subject: RE: drop down list using php and mysql


Hi,
This type of qustion should be forwarded to PHP-DB list. Its adres is:
[EMAIL PROTECTED] .

As for the answer to your question.. IF you'd like to create a dynamic
drop-down menu.. You can just just query the table for the options to be
displayed and loop through the result set and print them on html .. For
example:

   $query=select field from table;
   $result=mysql_query($query);
   $numrows=mysql_num_rows($result);

   echo 'select name=categories';
   for ($i=0; $numresult  $i; $i++)
   {
 $row=mysql_fetch_array($result);
 echo 'option'.($row[field]).'';
   }


Gurhan

-Original Message-
From: mailing list [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 4:52 PM
To: [EMAIL PROTECTED]
Subject: drop down list using php and mysql


Hello,

I am trying to build a drop down list using php and mysql.  Does anyone
have any examples of this?

Regards,

Adrian


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

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


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

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


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

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




RE: update mysql database via php form

2002-03-15 Thread Gurhan Ozen

Hi,
didn't really understand what you are asking.. Can you please be more
specific? What exactly you are asking?

Gurhan


-Original Message-
From: Valerie Brooks [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 5:28 PM
To: [EMAIL PROTECTED]
Subject: update mysql database via php form


Hi,

I'm using php form to update mysql database, the form has several drop down
menus to choose from.  What would the best way of updating information in
the
database, update, as a function?  Any help will be greatly appericated.

Thanks.


-


Valerie Brooks
Fujitsu Software
Voice: (408)456-7222
Email:  [EMAIL PROTECTED]


There's no limit to what can be accomplished
 if it doesn't matter who gets the credit


-
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: drop down list using php and mysql

2002-03-15 Thread Nathan

You could also bypass the num_rows entirely...

   ?php
   $query=select field from table;
   $result=mysql_query($query) or exit(mysql_error().BR.$query);

   echo 'select name=categories';
   for ($i=0; $row = mysql_fetch_assoc($result); $i++) {
  echo 'option'.($row[field]).'';
   }
   echo '/select';
   ?

# Nathan

- Original Message - 
From: Gurhan Ozen [EMAIL PROTECTED]
To: mailing list [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 4:17 PM
Subject: RE: drop down list using php and mysql


A correction... for line has the greater sign wrong:) It has to be :

 for ($i=0; $numresult  $i; $i++)

Sorry about that:)

Gurhan

-Original Message-
From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 6:01 PM
To: mailing list; [EMAIL PROTECTED]
Subject: RE: drop down list using php and mysql


Hi,
This type of qustion should be forwarded to PHP-DB list. Its adres is:
[EMAIL PROTECTED] .

As for the answer to your question.. IF you'd like to create a dynamic
drop-down menu.. You can just just query the table for the options to be
displayed and loop through the result set and print them on html .. For
example:

   $query=select field from table;
   $result=mysql_query($query);
   $numrows=mysql_num_rows($result);

   echo 'select name=categories';
   for ($i=0; $numresult  $i; $i++)
   {
 $row=mysql_fetch_array($result);
 echo 'option'.($row[field]).'';
   }


Gurhan


-
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: Getting a text field in a table....

2002-03-15 Thread Richard D. Williams

Dear Mad,

Don't give a szie just this;
ALTER TABLE tablename ADD fieldname LONGTEXT

Hope this helps,
Richard

MadProfessor wrote:

 Stupid newbie question, but why in the hell can't I get this damned TEXT
 column added? I've specified it as size 254 and cannot get it to
 work Someone please give me an example of a working create table
 statement with a TEXT or LONGTEXT column? I've read through my book
 (MySQL) and checked the documentation, but no working examples, just the
 standard stuff..
 Cheers,
 MadProfessor ZERO

 -
 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




Fetching an optional array from an optional column

2002-03-15 Thread phplist

I'm working on a form that queries by selection in PHP, where a user
selects a subject and an optional selection of geographic region to get
information. Each database entry will have 2 subject fields, Subject 1
being the main subject and Subject 2 being the cross-subject, and a
geographic field, which is optional. A table is set up like this:

+--+--+--+--+--+-+
| ID   | Organization | URL  | SUBJECT1 | SUBJECT2 | Geographic  |
+--+--+--+--+--+-+
|  1   | Acme | www  |  Math|  English | Canada  |
|  2   | Loony Toons  | www  |  Comedy  |  Math| Brazil  |

...


The idea is that the query will check the database to see if $Subject
has a match in either Subject1 or Subject2. The geographic is an
optional selection. If I select a country, then that's fairly simple.
However, if I select Math as a subject, and left the Geographic option
unselected, I want it to select all records that has a match in either
Subject1 and Subject2, irregardless of the Geographic option.

I tried the following query:

SELECT * FROM links WHERE (SUBJECT1='Legislation' OR
SUBJECT2='Legislation') AND GEOGRAPHIC = ''

But it won't find the above records because the geographic is not a
blank field.

I could drop the .. AND GEOGRAPHIC part, but then if someone does
select a country, it won't take country into consideration. How do I get
it to select all records based on the subject, irregardless of the
country?

Thanks in advance,

Lmlweb



-
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: drop down list using php and mysql

2002-03-15 Thread Gurhan Ozen

Yup Yup , you sure could.. Or you could also use
  while ($array_name=mysql_fetch_Array($result)) {..}but for some reason
i always write at least a couple extra lines and use number of rows.. I
guess it is because thats how i learned it  first :))

Gurhan


-Original Message-
From: Nathan [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 6:31 PM
To: Gurhan Ozen; mailing list; [EMAIL PROTECTED]
Subject: Re: drop down list using php and mysql


You could also bypass the num_rows entirely...

   ?php
   $query=select field from table;
   $result=mysql_query($query) or exit(mysql_error().BR.$query);

   echo 'select name=categories';
   for ($i=0; $row = mysql_fetch_assoc($result); $i++) {
  echo 'option'.($row[field]).'';
   }
   echo '/select';
   ?

# Nathan

- Original Message -
From: Gurhan Ozen [EMAIL PROTECTED]
To: mailing list [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, March 15, 2002 4:17 PM
Subject: RE: drop down list using php and mysql


A correction... for line has the greater sign wrong:) It has to be :

 for ($i=0; $numresult  $i; $i++)

Sorry about that:)

Gurhan

-Original Message-
From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 6:01 PM
To: mailing list; [EMAIL PROTECTED]
Subject: RE: drop down list using php and mysql


Hi,
This type of qustion should be forwarded to PHP-DB list. Its adres is:
[EMAIL PROTECTED] .

As for the answer to your question.. IF you'd like to create a dynamic
drop-down menu.. You can just just query the table for the options to be
displayed and loop through the result set and print them on html .. For
example:

   $query=select field from table;
   $result=mysql_query($query);
   $numrows=mysql_num_rows($result);

   echo 'select name=categories';
   for ($i=0; $numresult  $i; $i++)
   {
 $row=mysql_fetch_array($result);
 echo 'option'.($row[field]).'';
   }


Gurhan


-
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: Fetching an optional array from an optional column

2002-03-15 Thread Gurhan Ozen

Hi,

Since you are using a form to query the table i assume the subject1, subject
and geographic will be variables. So, you could do something like:

 SELECT * FROM links WHERE (subject1='$sub1' OR subject2='$sub2') AND
GEOGRAPHIC like '$geo%'

 In this way, if the user enters no value for the variable $geo then the
query statement will query with (WHERE geographic like '%' ) clause which
will mean any country.. On the other hand, if the user enters  a country
name for the $geo , say Canada, then the query statement will query with
(WHERE geopgrahic like 'Canada%') clause which will hit the rows with
Canada.

Gurhan


-Original Message-
From: phplist [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 7:01 PM
To: [EMAIL PROTECTED]
Subject: Fetching an optional array from an optional column


I'm working on a form that queries by selection in PHP, where a user
selects a subject and an optional selection of geographic region to get
information. Each database entry will have 2 subject fields, Subject 1
being the main subject and Subject 2 being the cross-subject, and a
geographic field, which is optional. A table is set up like this:

+--+--+--+--+--+-+
| ID   | Organization | URL  | SUBJECT1 | SUBJECT2 | Geographic  |
+--+--+--+--+--+-+
|  1   | Acme | www  |  Math|  English | Canada  |
|  2   | Loony Toons  | www  |  Comedy  |  Math| Brazil  |

...


The idea is that the query will check the database to see if $Subject
has a match in either Subject1 or Subject2. The geographic is an
optional selection. If I select a country, then that's fairly simple.
However, if I select Math as a subject, and left the Geographic option
unselected, I want it to select all records that has a match in either
Subject1 and Subject2, irregardless of the Geographic option.

I tried the following query:

SELECT * FROM links WHERE (SUBJECT1='Legislation' OR
SUBJECT2='Legislation') AND GEOGRAPHIC = ''

But it won't find the above records because the geographic is not a
blank field.

I could drop the .. AND GEOGRAPHIC part, but then if someone does
select a country, it won't take country into consideration. How do I get
it to select all records based on the subject, irregardless of the
country?

Thanks in advance,

Lmlweb



-
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




FW: Fetching an optional array from an optional column

2002-03-15 Thread phplist


Thank you for the hint.

I've tried further, and still came up short. This time, if I use the % -
it returns nothing.

Here's the sample code I'm using:

?php

if (!subject) {
header(Location: nowhere.html);
exit;
}

// Connects to database
include(cnx_db.inc);

// First addslashes to text:
$formatted_subject = addslashes($subject);
// Formats Query
$sql = SELECT * FROM links WHERE (SUBJECT1='$formatted_subject' OR
SUBJECT2='$formatted_subject') AND GEOGRAPHIC='$geographic%'
 ORDER BY ORGANIZATION ASC;

print($sql);

$sql_result = mysql_query($sql);
if (!$sql_result) {
   echo Can't execute $sql  . mysql_error();
   exit;
}

// organizes data in an orderly manner (ie bulleted area)
while ($row = mysql_fetch_array($sql_result)) {

$esc_organization = $row[ORGANIZATION];
$esc_desc = $row[DESCRIPTION];
$esc_url = $row[URL];
$esc_subject1 = $row[SUBJECT1];
$esc_subject2 = $row[SUBJECT2];
$esc_geographic = $row[GEOGRAPHIC];

$organization = stripslashes($esc_organization);
$description = stripslashes($esc_desc);
$url = stripslashes($esc_url);
$subject1 = stripslashes($esc_subject1);
$subject2 = stripslashes($esc_subject2);
$geographic = stripslashes($esc_geographic);

$option_block .= libOrganization:/b a
href=\http://$url\;$organization/abrbGeographic Region:/b
$geographicbrbDescription:/b $descriptionbrbURL:/b a
href=\http://$url\;$url/a/librbSubject1:/b
$subject1brbSubject2:/b $subject2\n; } include(byebye.inc);

?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN


html
head
titleTest Result/title
/head

body
h1?php echo $subject; ?/h1
You have chosen ?php echo $subject; ?. Here are the results: Ul
?php echo $option_block; ? /UL

/body
/html

The printed SQL comes out like this: 
SELECT * FROM links WHERE (SUBJECT1='Legislation' OR
SUBJECT2='Legislation') AND GEOGRAPHIC='%' ORDER BY ORGANIZATION ASC 

Any ideas? Again, thanks for your help

 -Original Message-
 From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 15, 2002 4:18 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: Fetching an optional array from an optional column
 
 
 Hi,
 
 Since you are using a form to query the table i assume the
 subject1, subject and geographic will be variables. So, you 
 could do something like:
 
  SELECT * FROM links WHERE (subject1='$sub1' OR
 subject2='$sub2') AND GEOGRAPHIC like '$geo%'
 
  In this way, if the user enters no value for the variable
 $geo then the query statement will query with (WHERE 
 geographic like '%' ) clause which will mean any country.. On 
 the other hand, if the user enters  a country name for the 
 $geo , say Canada, then the query statement will query with 
 (WHERE geopgrahic like 'Canada%') clause which will hit the 
 rows with Canada.
 
 Gurhan
 
 
 -Original Message-
 From: phplist [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 15, 2002 7:01 PM
 To: [EMAIL PROTECTED]
 Subject: Fetching an optional array from an optional column
 
 
 I'm working on a form that queries by selection in PHP, where
 a user selects a subject and an optional selection of 
 geographic region to get information. Each database entry 
 will have 2 subject fields, Subject 1 being the main subject 
 and Subject 2 being the cross-subject, and a geographic 
 field, which is optional. A table is set up like this:
 
 +--+--+--+--+--+-+
 | ID   | Organization | URL  | SUBJECT1 | SUBJECT2 | Geographic  |
 +--+--+--+--+--+-+
 |  1   | Acme | www  |  Math|  English | Canada  |
 |  2   | Loony Toons  | www  |  Comedy  |  Math| Brazil  |
 
 ...
 
 
 The idea is that the query will check the database to see if
 $Subject has a match in either Subject1 or Subject2. The 
 geographic is an optional selection. If I select a country, 
 then that's fairly simple. However, if I select Math as a 
 subject, and left the Geographic option unselected, I want it 
 to select all records that has a match in either Subject1 and 
 Subject2, irregardless of the Geographic option.
 
 I tried the following query:
 
 SELECT * FROM links WHERE (SUBJECT1='Legislation' OR
 SUBJECT2='Legislation') AND GEOGRAPHIC = ''
 
 But it won't find the above records because the geographic is
 not a blank field.
 
 I could drop the .. AND GEOGRAPHIC part, but then if
 someone does select a country, it won't take country into 
 consideration. How do I get it to select all records based on 
 the subject, irregardless of the country?
 
 Thanks in advance,
 
 Lmlweb
 
 
 
 -
 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 

RE: Fetching an optional array from an optional column

2002-03-15 Thread Gurhan Ozen

Hi :)
Rewrite your query statement as:

$sql = SELECT * FROM links WHERE (SUBJECT1='$formatted_subject' OR
SUBJECT2='$formatted_subject') AND GEOGRAPHIC='.$geographic.%'
 ORDER BY ORGANIZATION ASC;

I think it looks like a $geographic% variable:) Let me know if it does or
does not work..
Sincerely,

Gurhan


-Original Message-
From: phplist [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 7:37 PM
To: [EMAIL PROTECTED]
Subject: FW: Fetching an optional array from an optional column



Thank you for the hint.

I've tried further, and still came up short. This time, if I use the % -
it returns nothing.

Here's the sample code I'm using:

?php

if (!subject) {
header(Location: nowhere.html);
exit;
}

// Connects to database
include(cnx_db.inc);

// First addslashes to text:
$formatted_subject = addslashes($subject);
// Formats Query
$sql = SELECT * FROM links WHERE (SUBJECT1='$formatted_subject' OR
SUBJECT2='$formatted_subject') AND GEOGRAPHIC='$geographic%'
 ORDER BY ORGANIZATION ASC;

print($sql);

$sql_result = mysql_query($sql);
if (!$sql_result) {
   echo Can't execute $sql  . mysql_error();
   exit;
}

// organizes data in an orderly manner (ie bulleted area)
while ($row = mysql_fetch_array($sql_result)) {

$esc_organization = $row[ORGANIZATION];
$esc_desc = $row[DESCRIPTION];
$esc_url = $row[URL];
$esc_subject1 = $row[SUBJECT1];
$esc_subject2 = $row[SUBJECT2];
$esc_geographic = $row[GEOGRAPHIC];

$organization = stripslashes($esc_organization);
$description = stripslashes($esc_desc);
$url = stripslashes($esc_url);
$subject1 = stripslashes($esc_subject1);
$subject2 = stripslashes($esc_subject2);
$geographic = stripslashes($esc_geographic);

$option_block .= libOrganization:/b a
href=\http://$url\;$organization/abrbGeographic Region:/b
$geographicbrbDescription:/b $descriptionbrbURL:/b a
href=\http://$url\;$url/a/librbSubject1:/b
$subject1brbSubject2:/b $subject2\n; } include(byebye.inc);

?
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN


html
head
titleTest Result/title
/head

body
h1?php echo $subject; ?/h1
You have chosen ?php echo $subject; ?. Here are the results: Ul
?php echo $option_block; ? /UL

/body
/html

The printed SQL comes out like this:
SELECT * FROM links WHERE (SUBJECT1='Legislation' OR
SUBJECT2='Legislation') AND GEOGRAPHIC='%' ORDER BY ORGANIZATION ASC

Any ideas? Again, thanks for your help

 -Original Message-
 From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 15, 2002 4:18 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: Fetching an optional array from an optional column


 Hi,

 Since you are using a form to query the table i assume the
 subject1, subject and geographic will be variables. So, you
 could do something like:

  SELECT * FROM links WHERE (subject1='$sub1' OR
 subject2='$sub2') AND GEOGRAPHIC like '$geo%'

  In this way, if the user enters no value for the variable
 $geo then the query statement will query with (WHERE
 geographic like '%' ) clause which will mean any country.. On
 the other hand, if the user enters  a country name for the
 $geo , say Canada, then the query statement will query with
 (WHERE geopgrahic like 'Canada%') clause which will hit the
 rows with Canada.

 Gurhan


 -Original Message-
 From: phplist [mailto:[EMAIL PROTECTED]]
 Sent: Friday, March 15, 2002 7:01 PM
 To: [EMAIL PROTECTED]
 Subject: Fetching an optional array from an optional column


 I'm working on a form that queries by selection in PHP, where
 a user selects a subject and an optional selection of
 geographic region to get information. Each database entry
 will have 2 subject fields, Subject 1 being the main subject
 and Subject 2 being the cross-subject, and a geographic
 field, which is optional. A table is set up like this:

 +--+--+--+--+--+-+
 | ID   | Organization | URL  | SUBJECT1 | SUBJECT2 | Geographic  |
 +--+--+--+--+--+-+
 |  1   | Acme | www  |  Math|  English | Canada  |
 |  2   | Loony Toons  | www  |  Comedy  |  Math| Brazil  |

 ...


 The idea is that the query will check the database to see if
 $Subject has a match in either Subject1 or Subject2. The
 geographic is an optional selection. If I select a country,
 then that's fairly simple. However, if I select Math as a
 subject, and left the Geographic option unselected, I want it
 to select all records that has a match in either Subject1 and
 Subject2, irregardless of the Geographic option.

 I tried the following query:

 SELECT * FROM links WHERE (SUBJECT1='Legislation' OR
 SUBJECT2='Legislation') AND GEOGRAPHIC = ''

 But it won't find the above records because the geographic is
 not a blank field.

 I could drop the .. AND GEOGRAPHIC part, but 

  1   2   >