AUTOCOMMIT and MySQL 4.1, returning nothing on a valid query

2004-03-22 Thread Parker, Eddie
OK, the scenario I've got is that I'm using MySQL 4.1, and Python (using
mysql-python to access the server).
 
I have a script like the following:
 

conn = MySQLdb.connect() # Basic parameters
cursor = conn.cursor()
cursor.execute("SET AUTOCOMMIT=0")
cursor.execute("BEGIN")
for i in range(1000):
cursor.execute("SELECT * from _msg where id='282'")
print (str i) + str( cursor.fetchone() )

 
For the uninitiated, it's simply connecting, setting AUTOCOMMIT to 0,
calling BEGIN, and executing the same query over 1000 times. After i
equals 650, it starts returning "None", whereas it used to return
appropriate values.
 
I'm just curious: what limit is this blowing by? This was not being seen
on previous versions of MySQL, so I'm not sure what's causing it now. It
may in fact be the MySQLdb API wrapper - but I'm curious as to what it
would be oversetting on the MySQL side.
 
Oh, and if I remove he "SET AUTOCOMMIT=0", then it works fine, up to
1000.
 
Can anyone offer any advice? Thanks!
 
   
 _/ __ \  
  \  ___/ 
   \___  >
eddieparker   \/  
electronic arts  software engineer 
 developer  relations 
 


Re: commit,buffers

2004-03-22 Thread Parker, Eddie
OK, first off, this website is kinda infuriating. Why can't I click on
the message thread on the web, and reply that way? I'm not even sure
this message will reach it's recipients. .

Anyhow, I was just reading on
http://www.mysql.com/doc/en/Server_system_variables.html, there's a
variable called 'init_connect', that's automatically done for every
client that connects (not sure if this is new or not). So you can do
stuff like:

SET GLOBAL init_connect="SET AUTOCOMMIT=0";.

Hope that helps!

-e-

"Jamie Murray" <[EMAIL PROTECTED]> wrote:
> Hi Guys,
> How can I disable autocommit in the database. Can this only be done
per session as
> opposed to having it done globally at the database level.

You can turn off autocommit only per session.

> Last where can I get a complete list and explanation of the
buffer/memory areas of
> mysql.
> I checked the manual and it was brief at best.

Did you look at ?
http://www.mysql.com/doc/en/SHOW_VARIABLES.html
http://www.mysql.com/doc/en/InnoDB_start.html



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



Thread

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



Re: Downloading Data

2004-03-22 Thread Nitin Mehta
mysql doesn't write any files to any directory other than its data
directory, so try:

SELECT * INTO OUTFILE 'Results.txt' FROM Answer;

and then copy it whereever you want.

HTH
Nitin


- Original Message - 
From: "Rick Duley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Geoff Roy" <[EMAIL PROTECTED]>
Sent: Tuesday, March 23, 2004 8:52 AM
Subject: Downloading Data


> Hi folks
>
> I am running MySQL 4..0.7-gamma on Red Hat Linux 7.2.
>
> I wish to download data from my database.
>
> I have a directory called 'Results' with permissions set to: drwxrwxrwx
>
> I enter the command:
>
>   SELECT * INTO OUTFILE '/home/rick/Results/Results.txt' FROM Answer;
>
> and I get:
>
>   ERROR 1045: Access denied for user '[EMAIL PROTECTED]' (Using password:
YES)
>
> The command without the  "INTO OUTFILE '/home/rick/Results/Results.txt'"
> clause works just fine.
>
>
> Where have I missed the bus?
>
> Thanks
>
> ---
> Rick Duley
> School of Engineering Science
> Murdoch University, Perth, Western Australia
> aussie :0409 106 049
> o'seas : +61 409 106 049
>   .-_|\
> "The Main Thing is  / \
> to keep the Main Thing perth *_.-._/
>the Main Thing"v
>  (Stephen Covey, 1994)
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]
>



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



Re: mysql openssl Question

2004-03-22 Thread mathan
Hello Rmck,

If your mysql uses openssl static libraries, then you must rebuild your
mysql with new openssl libraries. If mysql uses dynamic openssl libraries
then no need to rebuild your mysql.

Use "ldd" command to your mysql binaries to check the openssl library
type. If it uses dynamic libraries then it will show the openssl libraries
in "ldd" command output.

Thanks
Mathan

- Original Message - 
From: "rmck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 23, 2004 6:04 AM
Subject: mysql openssl Question


> Hello,
>
> I have a redhat system that is running mysql with openssl for secure
connections.
>
> There was just a rpm update from redhat for openssl. I applied that and
mysql/openssl connections seem fine.
>
> But my question is do I need to recomplie mysql to use the latest
openssl
>
> This was a custom mysql server install. Syntax:
>
>  shell> ./configure
(default=)--prefix=/usr/local/mysql --with-extra-charsets=complex --enable-t
hread-safe-client --enable-local-infile --enable-assembler --disable-shared
> with-client-ldflags=-all-static  --with-mysqld-ldflags=-all-static
>
(Added=)--with-vio --with-openssl --without-innodb --localstatedir=/local/db
 --with-mysqld-username=mysql
>
> mysql shows that ssl is in use:
>
> mysql> \s
> blah
> blah
> SSL:Cipher in use is DHE-RSA-AES256-SHA
> blah
> blah
> mysql>
>
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.627 / Virus Database: 402 - Release Date: 3/16/2004



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



mysql have same function mthod as Oracle decode()

2004-03-22 Thread Qiang.zhou
Dear All;

   At oracle8i i can write this sql:
   select decode(a.id,null,'NULL',2,"God',3,'Norma','Animal') from user

   Then i want know ,how to write this at mysql4.1 

Thanks 



  

Downloading Data

2004-03-22 Thread Rick Duley
Hi folks

I am running MySQL 4..0.7-gamma on Red Hat Linux 7.2.

I wish to download data from my database.

I have a directory called 'Results' with permissions set to: drwxrwxrwx

I enter the command:

 SELECT * INTO OUTFILE '/home/rick/Results/Results.txt' FROM Answer;

and I get:

 ERROR 1045: Access denied for user '[EMAIL PROTECTED]' (Using password: YES)

The command without the  "INTO OUTFILE '/home/rick/Results/Results.txt'" 
clause works just fine.

Where have I missed the bus?

Thanks

---
Rick Duley
School of Engineering Science
Murdoch University, Perth, Western Australia
aussie :0409 106 049
o'seas : +61 409 106 049
 .-_|\
"The Main Thing is  / \
   to keep the Main Thing perth *_.-._/
  the Main Thing"v
(Stephen Covey, 1994) 

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


HA cluster + replication + loadbalancing

2004-03-22 Thread Atif Ghaffar
Hi all,

I am working on a project that uses Mysql.
My task is to provide a fault taulerant platform for it.
I would like some help to optimize the two ends of this platform.


There are few things that need to be solved.
High Availibility
Load sharing.


For HA, we are using a SAN disk to store the data and run heartbeat 
between two nodes. This works fine. Only one node has access to the 
disk and only one node can perform write operations.

The only problem is when/if heartbeat misbehaves or for some reason, 
both nodes start to access the disk, there can be FileSystem 
corruption(Not related to Mysql)

To avoid that situation, I would like to have a replica running that 
can become master if neccessary or can be used to restore the data 
to just before the crash state.

In future, I also want the first replica to provide replication 
service to other application-server nodes so that they do read 
operations on localhost and writes on the main server. (this part is 
easy)

My design is something like this.
Machine1: primary for master-mysql 
Machine2: Standby for master-mysql
  master-mysql listens to 10.10.10.10 (floating IP for heartbeat)

Machine1: replicates from 10.10.10.10
Listens on 10.10.10.1
Machine2: replicates from 10.10.10.10
Listens on 10.10.10.2
  These servers only grant Select access to the user

A Loadbalanced IP address 10.10.10.20 can be given to direct traffic 
to 10.10.10.1 and 10.10.10.2  for SELECT queries. This way, we get a 
little loadsharing.

I want other application server to replicate from the 10.10.10.20 
(load balanced) IP address, but I think I will get into some 
troubles with the binary logfiles naming. Will get to in in some 
time when I readup more on replication.

So, now I would like some help on putting the correct settings on 
the server that does the WRITES and the ones that do the READS.

I have at the moment for both(REPLICA and MASTER) of them the 
following.

skip-name-resolve
skip-locking
sort_buffer=8M
read_buffer_size=2M
net_buffer_length=2M
key_buffer = 256M
max_allowed_packet = 1M
table_cache = 256
myisam_sort_buffer_size = 64M
thread_cache = 8
thread_stack=128K
query_cache_size= 16M

Both nodes currently have 1GB RAM but will be upgraded to 4GB in the 
next few days.

Would you please advice, which settings I should remove from the 
WRITE daemon and which to change for the READ daemon to get best 
performance.

thanks in advance.

-- 
Atif Ghaffar
Tel: +41 (0)78 845 31 64







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



mysql openssl Question

2004-03-22 Thread rmck
Hello,

I have a redhat system that is running mysql with openssl for secure connections.

There was just a rpm update from redhat for openssl. I applied that and mysql/openssl 
connections seem fine.

But my question is do I need to recomplie mysql to use the latest openssl

This was a custom mysql server install. Syntax:

 shell> ./configure (default=)--prefix=/usr/local/mysql 
--with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile 
--enable-assembler --disable-shared 
with-client-ldflags=-all-static  --with-mysqld-ldflags=-all-static 
(Added=)--with-vio --with-openssl --without-innodb --localstatedir=/local/db 
--with-mysqld-username=mysql

mysql shows that ssl is in use:

mysql> \s
blah
blah
SSL:Cipher in use is DHE-RSA-AES256-SHA
blah
blah
mysql> 


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



Re: PHP script cannot connect MySQL server

2004-03-22 Thread beacker
Sami Maisniemi <[EMAIL PROTECTED]> writes:
>> mysql> use mysql
>> mysql> select User,Host,Password,Select_priv from user;
>>
>> which will show basic access capabilities for user/host/password
>
>Hmmm ... did not work as you can see:
>
>mysql> select User,Host,Password,Select_priv from user;
>ERROR 1054: Unknown column 'User' in 'field list'

 H, that's interesting.  You'll probably need to take a look
at the 'desc user;' output.  Mine reports the following initial
portion:

mysql> desc user
-> ;
+---+---+--+-+-
+---+
| Field | Type  | Null | Key | 
Default | Extra |
+---+---+--+-+-
+---+
| Host  | varchar(60) binary|  | PRI | 
|   |
| User  | varchar(16) binary|  | PRI | 
|   |
| Password  | varchar(16) binary|  | | 
|   |
| Select_priv   | enum('N','Y') |  | | N   
|   |

...

If yours does not report Host and User as the first two columns, your user
table has been corrupted in some manner.  You haven't tried to define your
own user table have you?  If so, that may be what is causing the errors.
  Brad Eacker ([EMAIL PROTECTED])



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



Re: PHP script cannot connect MySQL server

2004-03-22 Thread beacker
>> tcp0  0 *:3307  *:* LISTEN
>
>It seems that the correct socket is used. Here is the output:
>
>unix  2  [ ACC ] STREAM LISTENING 3303   private/relay
>unix  2  [ ACC ] STREAM LISTENING 3307   public/showq

 Looks like 3307 is indeed open, so you may want to modify your
mysql_connect to use localhost:3307 - since that is likely to be the
port mysqld is using based upon this output.  The default is usually
3306, so if you do not include the :3307 port reference you may very
well not be able to connect.
Brad Eacker ([EMAIL PROTECTED])



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



can anyone help with mysql/innodb stuff?

2004-03-22 Thread dan
I have a problem with mysql/innodb, hopefully someone
here can offer a nice pointer.

our innodb databases got wiped out (oops), and the problem
is the .frm files dont seem to match the structure needed,
we tried working around that in the docs online, but now
we get this message:

InnoDB: Error: table ./dan_logs_innodb/sent has a primary key in InnoDB
InnoDB: data dictionary, but not in MySQL!

can anyone tell me how to fix this?

Thanks,

Dan.



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



can anyone help with mysql/innodb stuff?

2004-03-22 Thread Beyonder
I have a problem with mysql/innodb, hopefully someone
here can offer a nice pointer.

our innodb databases got wiped out (oops), and the problem
is the .frm files dont seem to match the structure needed,
we tried working around that in the docs online, but now
we get this message:

InnoDB: Error: table ./dan_logs_innodb/sent has a primary key in InnoDB
InnoDB: data dictionary, but not in MySQL!

can anyone tell me how to fix this?

Thanks,

Dan.


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



Binary size problem

2004-03-22 Thread Admin-Stress
I compiles a C application which uses mysql library on two RedHat 9.0 machines.

Both machines are using the same GCC and the same MySQL 4.0.16 :

MySQL-client-4.0.16-0
MySQL-server-4.0.16-0
MySQL-devel-4.0.16-0
MySQL-shared-compat-4.0.16-0
gcc-3.2.2-5
gcc-c++-3.2.2-5
libgcc-3.2.2-5

In the MACHINE_1, the resulting binary size is about 20 KB, and in the MACHINE_2, the 
resulting
binary is about 180 KB. 

Anyone can explain why in the MACHINE_2, the binary size is very big ?

Here is my compile script :

#!/bin/sh
echo "building $1"
gcc -o $1 $1.c -I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient -lz

If I do "strings" to the binary from MACHINE_2 (180 KB), I saw (see below, not all).
Is it possible that all the mysql libraries are statically linked ?

Please help me,

Thanks.

/lib/ld-linux.so.2
libz.so.1
uncompress
_DYNAMIC
_init
_fini
_GLOBAL_OFFSET_TABLE_
_Jv_RegisterClasses
__gmon_start__
libc.so.6
strcpy
bcmp
stdout
vsprintf
getlogin
connect
readdir64
fdopen
geteuid
memmove
getenv
__strtol_internal
qsort
fgets
memcpy
readlink
malloc
endpwent
socket
select
fflush
bzero
strrchr
write
fprintf
strcat
inet_addr
__stpcpy
chdir
setsockopt
memchr
strstr
signal
read
getrusage
realloc
strtok
sscanf
__xstat64
symlink
localtime
inet_ntoa
opendir
poll
strcmp
shutdown
getpwuid
getcwd
gethostbyname
getpwnam
getservbyname
__mempcpy
fclose
getpeername
gethostbyname_r
stderr
error
__lxstat64
fputc
strftime
htons
__errno_location
exit
atoi
fileno
_IO_stdin_used
__libc_start_main
strlen
strchr
fputs
realpath
closedir
fcntl
__fxstat64
strpbrk
free
fopen64
_edata
__bss_start
_end
GLIBC_2.3
GLIBC_2.1.2
GLIBC_2.1
GLIBC_2.2
GLIBC_2.0
PTRh0w
8"t+B8"t&B8"t!B
8"t+B8"t&B8"t!B
RSWV
root
 lik
,WVS
j0j0
F [^_
j0h
PjnSW
[EMAIL PROTECTED](@80t#@
@@+E @
[EMAIL PROTECTED](@80t#@
@@+E
[EMAIL PROTECTED](@80t#@
[EMAIL PROTECTED](@80t#@
8([EMAIL PROTECTED](t(@8(t#@
PRQSV
A@;Ahttp://taxes.yahoo.com/filing.html

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



mysql as cluster service, failover causes broken replication

2004-03-22 Thread Matt Sturtz
Hello--

We're using Red Hat's cluster manager (RH AS 2.1, MySQL 4.0.16 RPM).  Due
to a problem within the cluster software that we're working on with Red
Hat, the cluster fails over from one node to the other sometimes when it
shouldn't (one node will reboot, services will fail over-- at this point
we think it's probably related to IO on the shared quorum partitions).

When service is restored some seconds later, the slaves won't start
replicating from the newly created binary-log, instead continuing to read
from the previous one (IE db-bin.002 is created when MySQL is restarted,
but the slaves keep reading from the old file, db-bin.001).  The only fix
seems to be CHANGE MASTER TO..., which seems somewhat error prone.

Anybody else running MySQL in this type of environment have any words of
wisdom?  Thanks in advance for any info...

-Matt Sturtz-

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



Cannot Resolve External Symtab Entries to mysqlclient Library Within C Program

2004-03-22 Thread Rick Emery
I am attempting to interface between a simple C program and MySQL client library, but 
without luck.

I searched the MySQLforum archives to see if there was info specific to this problem.  
While there
were other folks who had problems connecting C/C++ to MySQL, none of the issue were 
similar to this,
that is linking to resolve external name table references.

Here is the actual program:
*** myprog.cc ***
#include 
int main(void)
{
MYSQL * myptr;
mysql_init(myptr);
return 0;
}

To compile it, I use:
$ gcc -c myprog.cc

To link/load:
$ ld myprog.o -o myprog
ld: warning: cannot find entry symbol _start; defaulting to 08048074
myprog.o: In function `main':
myprog.o(.text+0xd): undefined reference to `mysql_init

I tried the following (with this result):
$ ld -lmysqlclient -o myprog myprog.o
ld: warning: cannot find entry symbol _start; defaulting to 08048208
/usr/lib/libmysqlclient.so: undefined reference to [EMAIL PROTECTED]'

Or, if I compile and link/load in one step, I get this:
$ gcc -o myprog myprog.cc
/tmp/ccJ8uuvK.o: In function `main':
/tmp/ccJ8uuvK.o(.text+0xd): undefined reference to `mysql_init'
collect2: ld returned 1 exit status

And "ls -l /usr/lib/libmysqlclient*"  reveals:
rwxrwxrwx1 root root   24 Mar 13 19:34 /usr/lib/libmysqlclient.so ->
libmysqlclient.so.12.0.0
lrwxrwxrwx1 root root   24 Mar 13 19:34 /usr/lib/libmysqlclient.so.10 
->
libmysqlclient.so.10.0.0
-rwxr-xr-x1 root root   224606 Feb 13 04:25 
/usr/lib/libmysqlclient.so.10.0.0
lrwxrwxrwx1 root root   24 Mar 13 19:34 /usr/lib/libmysqlclient.so.12 
->
libmysqlclient.so.12.0.0
-rwxr-xr-x1 root root   249972 Feb 13 04:25 
/usr/lib/libmysqlclient.so.12.0.0
lrwxrwxrwx1 root root   26 Mar 13 19:34 /usr/lib/libmysqlclient_r.so ->
libmysqlclient_r.so.12.0.0
lrwxrwxrwx1 root root   26 Mar 13 19:34 
/usr/lib/libmysqlclient_r.so.10 ->
libmysqlclient_r.so.10.0.0
-rwxr-xr-x1 root root   230560 Feb 13 04:25 
/usr/lib/libmysqlclient_r.so.10.0.0
lrwxrwxrwx1 root root   26 Mar 13 19:34 
/usr/lib/libmysqlclient_r.so.12 ->
libmysqlclient_r.so.12.0.0

My setup is Red Hat Linux version 7.0.  I used the latest mysql RPM (for Red Hat 7.0) 
from the mysql
web-site

Where can I go for help on this?  If somebody has a suggestion, I'm all ears.  FYI, 
using MySQL with
PHP works like a charm from the command line and when called from a web-page.  So, I 
know MySQL is
there, ready to do my bidding.  I looked through the latestMySQL manual concerning the 
C/C++ API; no
help.

thanks

rick


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



Re: PHP script cannot connect MySQL server

2004-03-22 Thread Sami Maisniemi
On Monday 22 March 2004 22:43, [EMAIL PROTECTED] wrote:
> >specify how to check the socket, please?
>
> Based on your ps information, the socket will likely be in the
> /usr/local/mysql/data/my.cnf file under the [mysqld] area.  Another way
> to tell if there is a socket open for the server would be to use
>
>   netstat -a | grep 330
>
> Which would show a line similar to this:
>
> tcp0  0 *:3307  *:* LISTEN

It seems that the correct socket is used. Here is the output:

unix  2  [ ACC ] STREAM LISTENING 3303   private/relay
unix  2  [ ACC ] STREAM LISTENING 3307   public/showq
unix  3  [ ] STREAM CONNECTED 3330   
unix  3  [ ] STREAM CONNECTED 3309   
unix  3  [ ] STREAM CONNECTED 3306   
unix  3  [ ] STREAM CONNECTED 3305   
unix  3  [ ] STREAM CONNECTED 3302   
unix  3  [ ] STREAM CONNECTED 3301  

Regards Sami


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



Re: How to prompt variable

2004-03-22 Thread Victor Pendleton
As of now, there is no MySQL equivalent to PL/SQL.

On Mon, 22 Mar 2004, Seena Blace wrote:
> 
> Hi,
> i want to update couple of columns like 
> update tablename
> set =
> where columname=;
> I want to run query on mysql prompt each time and enter value1 and
> value2 for diffrent columnname ?
> Value1 and value2 will be diffrent.
> in oracle we use & to prompt value.
> thx
> 
> Do you Yahoo!?
> Yahoo! Finance Tax Center - File online. File on time.
> 

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



How to prompt variable

2004-03-22 Thread Seena Blace
Hi,
i want to update couple of columns like 
update tablename
set =
where columname=;
I want to run query on mysql prompt each time and enter value1 and value2 for diffrent 
columnname ?
Value1 and value2 will be diffrent.
in oracle we use & to prompt value.
thx

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

Re: Need help finding months with entries

2004-03-22 Thread Rhino
I think you need the DISTINCT operator.

Assuming you haven't seen it, it works like this. Let's say that your query
asks for a list of all the job titles in your employee table, where the job
title is one of the columns of that table. The employee table looks like
this:

EMPNO  NAME   JOB
1  SmithProgrammer
2  JonesAnalyst
3  Green   Programmer
4  Brown  Analyst
5  BlackManager

Select empno, job
from employee;

should return exactly the same number of rows as there are in the table.
Each of the result rows will contain the job title from one of the rows read
by the query so you should get this:

EMPNO  JOB
1  Programmer
2  Analyst
3  Programmer
4  Analyst
5  Manager

The result of removing EMPNO from the query should be obvious but here it is
anyway:

select job
from employee;

JOB
Programmer
Analyst
Programmer
Analyst
Manager


Now, in your case, you just want to know the different job titles in the
table and don't care who has that title or how many people have that title.
So, you change the query like this:

select distinct job
from employee

That should give you this:

JOB
Analyst
Manager
Programmer

I haven't actually tried this in MySQL - I mostly use DB2 - but it should
work. It won't take long for you to give it a try to be sure

Rhino

- Original Message - 
From: "Daniel" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 22, 2004 1:04 PM
Subject: Need help finding months with entries


>
> I have a MySQL table with a Date column in format \"-MM-DD\" and I\'m
trying to figure out a query that would return a list of months that have an
entry in the above table. With output like:
>
> Mar-01, Feb-01, Apr-01 etc...
>
> I\'m still pretty new to MySQL and the date functions are still a bit
confusing to me. Would something like this work?
>
> \"SELECT (DATE_FORMAT( DateCol, \"%b-%Y\") AS MonthWithEntry) FROM
BlogTable;\"
>
> I think that would work but how do I get it to return only 1 row per month
with entries rather than 1 row per entry that month?
>
> Cheers,
>
> Danielb
>
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
>


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



Re: PHP script cannot connect MySQL server

2004-03-22 Thread beacker
Sami Maisniemi writes:
>I think I am using root access, but should I create another user name for 
>MySQL? On the command line, I start MySQL by typing just 'MySQL'. How can I 
>view the user?

from the mysql program:

mysql> use mysql
mysql> select User,Host,Password,Select_priv from user;

which will show basic access capabilities for user/host/password

mysql select Host,Db,User,Table_Name,Table_priv from tables_priv;

will show similar information on a db/table basis for the host/user
combinations.
  Brad Eacker ([EMAIL PROTECTED])



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



Re: Should there be an entry in the mysql error log?

2004-03-22 Thread Victor Pendleton
This error should be logged. Do you have a file called .err in your
directory?

 On Mon, 22 Mar 2004, Daniel Gaddis wrote:
> I copied the following from my coldfusion application.log
> 
> "Error","2152","03/20/04","09:03:13",,"ODBC Error Code = S1000 (General
> error) [MySQL][ODBC 3.51 Driver][mysqld-4.0.18-max-nt-log]Incorrect
> key file for table: 'referenceEntries'. Try to repair it SQL =
> ""UPDATE referenceEntries  SET heading =
> 'Delete', body = '',
> keywords = ''   ,
> dateVerified = NULLWHERE entryID
> = 168"" "
> 
> The contents makes me think there should also be something in the mysql
> error log similar to... 
> 
>  Incorrect key file for table: 'referenceEntries'. Try to repair it
> 
> But there is no entry in the mysql error log. Any thoughts why not?
> 
> Thanks,
> Daniel
> 
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

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



Re: Should there be an entry in the mysql error log?

2004-03-22 Thread Paul DuBois
At 14:33 -0600 3/22/04, Daniel Gaddis wrote:
I copied the following from my coldfusion application.log

"Error","2152","03/20/04","09:03:13",,"ODBC Error Code = S1000 (General
error) [MySQL][ODBC 3.51 Driver][mysqld-4.0.18-max-nt-log]Incorrect
key file for table: 'referenceEntries'. Try to repair it SQL =
""UPDATE referenceEntries  SET heading =
'Delete', body = '',
keywords = ''   ,
dateVerified = NULLWHERE entryID
= 168"" "
The contents makes me think there should also be something in the mysql
error log similar to...
 Incorrect key file for table: 'referenceEntries'. Try to repair it

But there is no entry in the mysql error log. Any thoughts why not?
The error log is for messages pertaining to problems with the operational
state of the server.  Normally there's not much in it at all.
The error you show above is a problem with a query sent by a client.
That type of error message is sent to the client, not logged.
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com
MySQL Users Conference: April 14-16, 2004
http://www.mysql.com/uc2004/
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


Re: PHP script cannot connect MySQL server

2004-03-22 Thread beacker
>It seems that mysqld is up and running (view the results below), but could 
you
>specify how to check the socket, please?

Based on your ps information, the socket will likely be in the
/usr/local/mysql/data/my.cnf file under the [mysqld] area.  Another way
to tell if there is a socket open for the server would be to use

netstat -a | grep 330

Which would show a line similar to this:

tcp0  0 *:3307  *:* LISTEN 


with the port I'm using {3307} showing up as currently in use, tcp
protocol with a listener {LISTEN} connected to the socket.  Hopefully
the port specified in the my.cnf will show on the netstat output as
described above.
   Brad Eacker ([EMAIL PROTECTED])



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



Should there be an entry in the mysql error log?

2004-03-22 Thread Daniel Gaddis

I copied the following from my coldfusion application.log

"Error","2152","03/20/04","09:03:13",,"ODBC Error Code = S1000 (General
error) [MySQL][ODBC 3.51 Driver][mysqld-4.0.18-max-nt-log]Incorrect
key file for table: 'referenceEntries'. Try to repair it SQL =
""UPDATE referenceEntries  SET heading =
'Delete', body = '',
keywords = ''   ,
dateVerified = NULLWHERE entryID
= 168"" "

The contents makes me think there should also be something in the mysql
error log similar to... 

 Incorrect key file for table: 'referenceEntries'. Try to repair it

But there is no entry in the mysql error log. Any thoughts why not?

Thanks,
Daniel



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



Re: MERGE table with some packed tables?

2004-03-22 Thread Dan Nelson
In the last episode (Mar 22), Chris Elsworth said:
> Ah, well these tables do need to be queryable and thus live; I only
> ask about packing because it'll save space and (apparently) make them
> faster; I've never actually played with packing MyISAM tables before.
> 
> Happen to know if MySQL will need a kick after the packing is done?
> Would a flush-tables do, assuming I can guarantee there was nothing
> outstanding to be written to the table before I started packing it?

Flushing the tables should be all you need.

-- 
Dan Nelson
[EMAIL PROTECTED]

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



RE: What is Frequency of Master Binlog Dump to Slave

2004-03-22 Thread John McCaskey
The master pushes data to the slave as soon as it has executed the query
itself.  It is not a periodic push, but an asyncrounous push as soon as
data is ready to be sent.  So the gap would only be as great as the
latency between your two servers.

If the servers are disconnected or unable to communicate for any reason
you need to be careful about your timeout values and connection retry
values or they may not attempt to reconnect for a while and then there
will be a datagap until they attempt to reconnect.

John

-Original Message-
From: Henry Chang [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 22, 2004 11:32 AM
To: [EMAIL PROTECTED]
Subject: What is Frequency of Master Binlog Dump to Slave



I got MySQL replication working in  master-slave configuration.  It's
really cool, but how often does the master send binlog dump to the
slave.  The implication is if the master crashes, what would be the
potential data gap in the slave??


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


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



Re: *very* strange...

2004-03-22 Thread mos
At 01:30 AM 3/20/2004, you wrote:
> insert into table (username, password) values ('username', 'password')
>
> Skip out the "username=" and "password=" part.  What you are ending up
> doing here is that the values portion of the insert statement, these two
You may kick my ass... Royally.

Sorry, I feel like a phrick to say the least... That's what copy and pasting
code to save time does for you
--
Chris
Chris,
Like the old joke says, "The problem lies somewhere between the 
keyboard and the chair".

Mike  

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


Re: Performance Koan

2004-03-22 Thread Pete Harlan
Do a mysqldump -d on both machines to make sure the schema, and the
indexes in particular, are exactly the same.  Run "analyze table" on
all tables.  Make sure the MySQL conf files (e.g., /etc/my.cnf) are
the same.  Do an 'explain ' on both machines; the output should
be the same.

4.0.1 isn't the latest, so I assume you're using something later.
Regardless, I wouldn't expect the performance on the two machines to
be so different unless the one has so much ram that everything is
running from memory while the other has to thrash the disk.

--Pete


On Sun, Mar 21, 2004 at 11:05:49AM -0800, Gene H. Dreher wrote:
> I've got 2 Redhat 8 machines with 4.0.1 (? latest) database.   Machine1 is a P3-750, 
> Machine2 is a P4-1.6  .. The same database is deployed to both machines using myisam 
> tables.   Query on Machine 1 takes almost 2 min to produce data.  Same query on 
> Machine2 returns in 5 seconds... ? Why?  (I don't expect the same, but close would 
> be nice.) 
> 
> thanks, ghd
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
> 

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



Re: Selecting non opposites

2004-03-22 Thread Tony Richardson
I'm a newbie but thought I'd try my hand and offer an extremely 
inefficient query that seemed to work ...

select * from
   word join
   word as tw join
   word as tm
where  concat(word.wd, tw.wd, tm.wd) not like '%male%female%' and
   concat(word.wd, tw.wd, tm.wd) not like '%female%male%'
ORDER BY rand()
 LIMIT 1;


Dave Dash wrote:

Yeah, I want to avoid code if possible, some ideas was marking 
adjectives with a class tag, and doing a group by class so only one 
item in any given class would appera

e.g. good and evil would have the same class or male and female would 
have the same class.

this, however, requires me to enter a class id for each thing which is 
time(or code) consuming, but doable.

Diana Cristina Neves Soares wrote:

To select random values you could use:

SELECT word FROM table ORDER BY rand() LIMIT 3
,
But the problem of not to select male and female together... Well, 
you could LIMIT your query to 4 and in your code, if one entry is one 
of  male or female, you test the others not to be female or male 
(respectively). For shure, you will always have 3 different values 
and you won't have male and female together (pityfully ;-)

Diana Soares







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


Re: PHP script cannot connect MySQL server

2004-03-22 Thread B. van Ouwerkerk
At 22:00 22-03-2004 +0200, Sami Maisniemi wrote:
> Did you provide access to the databases as root?  Is there a password
> associated with access?  For instance, how do you statr mysql from the
> command line:  mysql -u root -ppassword mydatabase
I think I am using root access, but should I create another user name for
MySQL? On the command line, I start MySQL by typing just 'MySQL'. How can I
view the user?
I tried to create a root password and I added the password to the PHP script,
but I did not see any impact.
You may want to look at some tutorials at php.net and devshed.com first.

They should get you started.

B. 

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


Re: Count all rows if limit by?

2004-03-22 Thread Victor Spång Arthursson
Thanks a lot, Jigal and Egor - just what i searched for!

Sincerely

Victor

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


Re: PHP script cannot connect MySQL server

2004-03-22 Thread Sami Maisniemi
> Did you provide access to the databases as root?  Is there a password
> associated with access?  For instance, how do you statr mysql from the
> command line:  mysql -u root -ppassword mydatabase

I think I am using root access, but should I create another user name for 
MySQL? On the command line, I start MySQL by typing just 'MySQL'. How can I 
view the user?

I tried to create a root password and I added the password to the PHP script, 
but I did not see any impact.

Regards Sami


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



Re: PHP script cannot connect MySQL server

2004-03-22 Thread Sami Maisniemi
On Monday 22 March 2004 21:45, [EMAIL PROTECTED] wrote:
> This error could result from a number of possible problems.  First off I
> would check to make sure the mysqld is running and attaching to the default
> socket (3306).  If you have it set up otherwise, you will likely need the
> connect to contain the ':3307' socket adjustment to the name of the host
> being sought.  I have validated that the rest of your logic is correct
> once the connection is established.

It seems that mysqld is up and running (view the results below), but could you 
specify how to check the socket, please?

Regards Sami

dhcppc9:/home/smaisnie # ps  -efc | grep mys
root  1211 1 -21 19:45 ?00:00:00 /bin/sh ./bin/mysqld_safe 
--datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/dhcppc9.pid
mysql 1240  1211 -24 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1288  1240 -24 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1289  1288 -20 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1290  1288 -23 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1291  1288 -23 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1292  1288 -20 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1294  1288 -24 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1295  1288 -24 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1296  1288 -24 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
mysql 1297  1288 -24 19:45 ?00:00:00 /usr/local/mysql/bin/
mysqld --defaults-extra-file=/usr/local/mysql/data/my.cnf --basedir=/usr/
local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/
local/mysql/data/dhcppc9.pid --skip-locking
root  2206  1829 -21 21:57 pts/100:00:00 grep mys


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



Re: PHP script cannot connect MySQL server

2004-03-22 Thread Sami Maisniemi
On Monday 22 March 2004 20:36, [EMAIL PROTECTED] wrote:
> This means that your server is not up, most likely.  Can you connect from
> the command line?  try running
> ps  -efc | grep mys
>
> do you see an entry for mysqld?

It seems that the server is up and running, because I am able to see multiple 
processes referring to MySQL.

> How did you start your server?

I have some scripts that start MySQL server automatically during login.

Regards Sami


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



Re: PHP script cannot connect MySQL server

2004-03-22 Thread beacker
>I finally managed to install MySQL succesfully. I created a simple DB with 
two
>different tables. I also created a simple PHP script to list all DBs and 
>tables.
>
>However, it seems that the PHP script cannot access MySQL server, because the 
>following error message is displayed:
>
>Warning: mysql_connect(): Can't connect to local MySQL server through socket 
>'/var/lib/mysql/mysql.sock' (2) in /srv/www/htdocs/sqltest.php on line 4

This error could result from a number of possible problems.  First off I
would check to make sure the mysqld is running and attaching to the default
socket (3306).  If you have it set up otherwise, you will likely need the
connect to contain the ':3307' socket adjustment to the name of the host
being sought.  I have validated that the rest of your logic is correct
once the connection is established.
 Brad Eacker ([EMAIL PROTECTED])



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



Re: MERGE table with some packed tables?

2004-03-22 Thread Chris Elsworth
On Mon, Mar 22, 2004 at 01:40:29PM -0600, Dan Nelson wrote:
> In the last episode (Mar 22), Chris Elsworth said:
> > Now that's all well and good and I'm fairly sure it'll all work, but
> > another interesting idea I was wondering over was - can I myisampack
> > the tables that I know won't be updated anymore, and still MERGE
> > them, with other unpacked-tables?
> 
> It should work.  I think I tried something similar before deciding to
> just gzip the tables and if I needed them I'd uncompress them and query
> them individually :)

Ah, well these tables do need to be queryable and thus live; I only
ask about packing because it'll save space and (apparently) make them
faster; I've never actually played with packing MyISAM tables before.

Happen to know if MySQL will need a kick after the packing is done?
Would a flush-tables do, assuming I can guarantee there was nothing
outstanding to be written to the table before I started packing it?

-- 
Chris

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



Re: MERGE table with some packed tables?

2004-03-22 Thread Dan Nelson
In the last episode (Mar 22), Chris Elsworth said:
> Now that's all well and good and I'm fairly sure it'll all work, but
> another interesting idea I was wondering over was - can I myisampack
> the tables that I know won't be updated anymore, and still MERGE
> them, with other unpacked-tables?

It should work.  I think I tried something similar before deciding to
just gzip the tables and if I needed them I'd uncompress them and query
them individually :)

-- 
Dan Nelson
[EMAIL PROTECTED]

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



MERGE table with some packed tables?

2004-03-22 Thread Chris Elsworth
Hello,

Just a quick question to see if anyone's tried this and run into any
problems, or if it'll even work - I have a *huge* table that's just
crashed thanks to FreeBSD panicking, and the repair operation I'm
estimating is going to be another 4 hours :(

But anyway, I'm pondering over splitting this table up into a few
sub-tables then making the change transparent to overlying code via a
MERGE table. The data in this table is inserted hourly, and once it's
in there, it doesn't change until I delete it 25 days later. It's kind
of a rolling database. I've mused over the idea of making one MyISAM
table for each day, creating a new one every night, and updating the
MERGE schema - this also means I don't have to do a time consuming
DELETE of old data - I just take the table definition out of the
MERGE, move the datafile away so MySQL can't see it, and flush-tables.

Now that's all well and good and I'm fairly sure it'll all work, but
another interesting idea I was wondering over was - can I myisampack
the tables that I know won't be updated anymore, and still MERGE them,
with other unpacked-tables?

Sorry, this got a bit long and rambly :)
-- 
Chris

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



What is Frequency of Master Binlog Dump to Slave

2004-03-22 Thread Henry Chang

I got MySQL replication working in  master-slave configuration.  It's
really cool, but how often does the master send binlog dump to the
slave.  The implication is if the master crashes, what would be the
potential data gap in the slave??


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



Re: select statement not working in a php page

2004-03-22 Thread beacker
>I am trying to get a single result from a database, which works fine at 
>the sql command line. I have tried several versions of code, this being 
>the most recent -
...
>No matter what I do I do not get the desired max id number from the column 
>WarrantyID. The same query works fine at the sql command line. What am I 
>doing wrong?

Chip,
 Are you getting any output at all on the browser?  You may want to
check the error output on the web server.  It may have some information
as to what could be going wrong.  Alternatively you could run the script
from the php program that is likely to be available.  It will put out
what looks like the HTML source for the page, but will point out errors
if there are any.  Another possibility is that the connect is not working
properly due to access rights/limitations.
 Brad Eacker ([EMAIL PROTECTED])



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



Re: select statement not working in a php page

2004-03-22 Thread Chip Wiegand
Thanks for the tip. Got it working.
--
Chip

"Rick Emery" <[EMAIL PROTECTED]> wrote on 03/22/2004 09:50:59 AM:

> What result are you getting?
> 
> First off, I see that your HTML is possibly incorrect; should it be:
> echo "Warranty ID:\n";
> 
>  is a table header.
> 
> Second, if you are expecting a single result row, then you do not 
> need the while() loop.  Do a
> single fetch and display the result.
> 
> rick
> "People will forget what you said. People will forget what you did.
> But people will never forget how you made them feel."
> - Original Message - 
> From: "Chip Wiegand" <[EMAIL PROTECTED]>
> To: "MySQL " <[EMAIL PROTECTED]>
> Sent: Monday, March 22, 2004 11:33 AM
> Subject: select statement not working in a php page
> 
> 
> I am trying to get a single result from a database, which works fine at
> the sql command line. I have tried several versions of code, this being
> the most recent -
>  $sql = "select max(WarrantyID) from warrantycopy";
> $result=mysql_query($sql) or die("Could not get the id number :" .
> mysql_error());
> while($query_data = mysql_fetch_array($result)) {
> $WarrantyID = $query_data["WarrantyID"];
> echo "\n";
> echo "Warranty ID:\n";
> echo "$WarrantyID\n";
> echo "\n";
> }
> ?>
> No matter what I do I do not get the desired max id number from the 
column
> WarrantyID. The same query works fine at the sql command line. What am I
> doing wrong?
> thanks
> --
> Chip
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 


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



Re: Selecting non opposites

2004-03-22 Thread Dave Dash
Yeah, I want to avoid code if possible, some ideas was marking 
adjectives with a class tag, and doing a group by class so only one item 
in any given class would appera

e.g. good and evil would have the same class or male and female would 
have the same class.

this, however, requires me to enter a class id for each thing which is 
time(or code) consuming, but doable.

Diana Cristina Neves Soares wrote:
To select random values you could use:

SELECT word FROM table ORDER BY rand() LIMIT 3

But the problem of not to select male and female together... 
Well, you could LIMIT your query to 4 and in your code, if one entry is one of  male or female, you test the others not to be female or male (respectively). For shure, you will always have 3 different values and you won't have male and female together (pityfully ;-)

Diana Soares


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


Re: PHP script cannot connect MySQL server

2004-03-22 Thread jeffrey_n_Dyke



I finally managed to install MySQL succesfully. I created a simple DB with
two
different tables. I also created a simple PHP script to list all DBs and
tables.

However, it seems that the PHP script cannot access MySQL server, because
the
following error message is displayed:
_
This means that your server is not up, most likely.  Can you connect from
the command line?  try running
ps  -efc | grep mys

do you see an entry for mysqld?

How did you start your server?

HTH
Jeff



Warning: mysql_connect(): Can't connect to local MySQL server through
socket
'/var/lib/mysql/mysql.sock' (2) in /srv/www/htdocs/sqltest.php on line 4

Warning: mysql_list_dbs(): supplied argument is not a valid MySQL-Link
resource in /srv/www/htdocs/sqltest.php on line 5

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /srv/www/htdocs/sqltest.php on line 6

Any idea what might be wrong? There is no file 'mysql.sock' in '/var/lib/
mysql'. The PHP script is as follows:



";
  $result2 = mysql_list_tables($db_data[0]);
  $num_rows2 = mysql_num_rows($result2);
  while ($table_data = mysql_fetch_row($result2)) {
echo "--" . $table_data[0]. "";
  }
  echo "==> $num_rows2 table(s) in " . $db_data[0] . "";
}
?>



Regards Sami


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







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



Re: PHP script cannot connect MySQL server

2004-03-22 Thread Rick Emery
/var/lib/mysql/mysql.sock is created when the mysql server starts.  It disappears when 
mysql shuts
down.

Did you provide access to the databases as root?  Is there a password associated with 
access?  For
instance, how do you statr mysql from the command line:  mysql -u root -ppassword 
mydatabase

rick
"People will forget what you said. People will forget what you did.
But people will never forget how you made them feel."
- Original Message - 
From: "Sami Maisniemi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 22, 2004 12:25 PM
Subject: PHP script cannot connect MySQL server


I finally managed to install MySQL succesfully. I created a simple DB with two
different tables. I also created a simple PHP script to list all DBs and
tables.

However, it seems that the PHP script cannot access MySQL server, because the
following error message is displayed:

Warning: mysql_connect(): Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2) in /srv/www/htdocs/sqltest.php on line 4

Warning: mysql_list_dbs(): supplied argument is not a valid MySQL-Link
resource in /srv/www/htdocs/sqltest.php on line 5

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /srv/www/htdocs/sqltest.php on line 6

Any idea what might be wrong? There is no file 'mysql.sock' in '/var/lib/
mysql'. The PHP script is as follows:



";
  $result2 = mysql_list_tables($db_data[0]);
  $num_rows2 = mysql_num_rows($result2);
  while ($table_data = mysql_fetch_row($result2)) {
echo "--" . $table_data[0]. "";
  }
  echo "==> $num_rows2 table(s) in " . $db_data[0] . "";
}
?>



Regards Sami


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


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



PHP script cannot connect MySQL server

2004-03-22 Thread Sami Maisniemi
I finally managed to install MySQL succesfully. I created a simple DB with two 
different tables. I also created a simple PHP script to list all DBs and 
tables.

However, it seems that the PHP script cannot access MySQL server, because the 
following error message is displayed:

Warning: mysql_connect(): Can't connect to local MySQL server through socket 
'/var/lib/mysql/mysql.sock' (2) in /srv/www/htdocs/sqltest.php on line 4

Warning: mysql_list_dbs(): supplied argument is not a valid MySQL-Link 
resource in /srv/www/htdocs/sqltest.php on line 5

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
resource in /srv/www/htdocs/sqltest.php on line 6

Any idea what might be wrong? There is no file 'mysql.sock' in '/var/lib/
mysql'. The PHP script is as follows:



";
  $result2 = mysql_list_tables($db_data[0]);
  $num_rows2 = mysql_num_rows($result2);
  while ($table_data = mysql_fetch_row($result2)) {
echo "--" . $table_data[0]. "";
  }
  echo "==> $num_rows2 table(s) in " . $db_data[0] . "";
}
?>



Regards Sami


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



Mystifying mysqld memory usage explosion

2004-03-22 Thread Tim Cutts
Some users' code is causing MySQL's memory use to explode.  By the time 
we reach about 200 simultaneous connections, the MySQL server is using 
8GB of virtual memory, and then falls over (the machine is an 
AlphaServer ES45 with 8 GB of physical memory, and 16 GB of swap, 
although processes are constrained to a total of 8GB of virtual memory 
in the OS)  The versions of MySQL I have found this behaviour on are 
4.0.14 and 4.0.17

I'm presuming that I have some configuration variable wrong somewhere, 
but I can't work out what it is.  Here's our .cnf file for the 
instance:

[mysqld_safe]
err-log=/mysql/log_3365/err.log
[mysqladmin]
socket=/mysql/data_3365/mysql_3365.sock
port=3365
[mysqld]
binlog_cache_size=32M
datadir=/mysql/data_3365/databases
interactive_timeout=2678200
key_buffer=1024M
#log=/mysql/log_3365/query.log
log_bin=/mysql/log_3365/bin.log
log_slow_queries=/mysql/log_3365/slow.log
log_warnings
max_allowed_packet=16M
max_binlog_size=2000M
max_connections=1024
net_write_timeout=60
pid-file=/mysql/data_3365/mysql_3365.pid
port=3365
query_cache_size=32M
read_buffer_size=256K
socket=/mysql/data_3365/mysql_3365.sock
sort_buffer_size=2M
table_cache=512
thread_cache_size=16
wait_timeout=2678200
# Replication options
server_id=1
I've tried reducing sort_buffer_size to a pathetic 32K, and it makes no 
difference, so it's not that.  Similarly, I've tried reducing 
max_allowed_packet, and that makes no difference.

The code in question is running a large number of compute jobs on a 
Linux cluster, and these jobs talk to the MySQL server both to inform a 
master control process what is going on, and secondly to store their 
results in it.

If I constrain the number of simultaneously running jobs to 20, then 
MySQL only grows to about 3.5 GB, 2.5 GB of which were allocated as 
soon as it started, so it looks like each connection is allocating 
around 50 MB inside MySQL, but I don't know where this is coming from.  
Surely each thread within the OS doesn't take 50 MB before it's 
allocated anything else?

Any ideas, including ways I can get MySQL to tell me more about what 
it's doing, would be most helpful.  The query log, even with 
log-warnings on, does not tell us much.

Many  thanks in advance...

Tim

--
Dr Tim Cutts
Informatics Systems Group
Wellcome Trust Sanger Institute
Hinxton, Cambridge, CB10 1SA, UK
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: Selecting non opposites

2004-03-22 Thread Diana Cristina Neves Soares
To select random values you could use:

SELECT word FROM table ORDER BY rand() LIMIT 3

But the problem of not to select male and female together... 
Well, you could LIMIT your query to 4 and in your code, if one entry is one of  male 
or female, you test the others not to be female or male (respectively). For shure, you 
will always have 3 different values and you won't have male and female together 
(pityfully ;-)

Diana Soares

-Original Message-
From:   news on behalf of Dave Dash
Sent:   Mon 3/22/2004 3:38 PM
To: [EMAIL PROTECTED]
Cc: 
Subject:Selecting non opposites
I have a table of adjectives:

++
| word   |
++
| green  |
| ugly   |
| dark   |
| evil   |
| female |
| male   |
| drunk  |
++


and I want to select three of them randomly, but I don't want female and 
male to accidentally appear together (since they are opposites).

I can't think of a query that can do that, although it seems like there 
should be something easy.

Any help out there?

Thanks ;)


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





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



RE: select statement not working in a php page

2004-03-22 Thread Diana Cristina Neves Soares
Hi,

Assuming that you are connecting to the mysql server with success, try just changing 
your query to:

$sql = "select max(WarrantyID) as WarrantyID from warrantycopy";

Hope this helps,
Diana Soares


-Original Message-
From:   Chip Wiegand [mailto:[EMAIL PROTECTED]
Sent:   Mon 3/22/2004 5:33 PM
To: MySQL 
Cc: 
Subject:select statement not working in a php page
I am trying to get a single result from a database, which works fine at 
the sql command line. I have tried several versions of code, this being 
the most recent -
\n";
echo "Warranty ID:\n";
echo "$WarrantyID\n";
echo "\n";
}
?>
No matter what I do I do not get the desired max id number from the column 
WarrantyID. The same query works fine at the sql command line. What am I 
doing wrong?
thanks
--
Chip 


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



Need help finding months with entries

2004-03-22 Thread Daniel

I have a MySQL table with a Date column in format \"-MM-DD\" and I\'m trying to 
figure out a query that would return a list of months that have an entry in the above 
table. With output like:

Mar-01, Feb-01, Apr-01 etc...

I\'m still pretty new to MySQL and the date functions are still a bit confusing to me. 
Would something like this work?

\"SELECT (DATE_FORMAT( DateCol, \"%b-%Y\") AS MonthWithEntry) FROM BlogTable;\"

I think that would work but how do I get it to return only 1 row per month with 
entries rather than 1 row per entry that month?

Cheers, 

Danielb

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



Replication errors...

2004-03-22 Thread Stanton, Brian
Shortly after the MySQL 4.0 line went to production, I upgraded to mysql
4.0.12.  Since then my slave has been getting corrupted tables 2 to 3 times
every month.  I've also seen this problem in mysql 4.0.13.  When I run a
check table on the table in question it gives the following results:
 
+-+---+--+--
---+
| Table   | Op| Msg_type | Msg_text
|
+-+---+--+--
---+
| database.table  | check | warning  | Table is marked as crashed
|
| database.table  | check | warning  | 2 clients is using or hasn't closed
the table properly  |
| database.table  | check | warning  | Not used space is supposed to be:
526688 but is: 522768 |
| database.table  | check | error| record delete-link-chain corrupted
|
| database.table  | check | error| Corrupt
|
+-+---+--+--
---+
5 rows in set (0.01 sec)
 
It repairs just fine and then replication continues, but I never ran into
this issue in the 3.23.xx line.  Has anyone else been seeing this problem?
Has it been fixed in a later 4.0.x version?
 

ERROR: 1030  Got error 127 from table handler
040207  3:44:03  Slave: error 'Got error 127 from table handler' on query
...
040207  3:44:03  Error running query, slave SQL thread aborted. Fix the
problem,
 and restart the slave SQL thread with "SLAVE START". We stopped at log ...

 
Thanks,
Brian
 
"I don't need any of that SQL stuff -- I just want a database!"
 


Re: select statement not working in a php page

2004-03-22 Thread Rick Emery
What result are you getting?

First off, I see that your HTML is possibly incorrect; should it be:
echo "Warranty ID:\n";

 is a table header.

Second, if you are expecting a single result row, then you do not need the while() 
loop.  Do a
single fetch and display the result.

rick
"People will forget what you said. People will forget what you did.
But people will never forget how you made them feel."
- Original Message - 
From: "Chip Wiegand" <[EMAIL PROTECTED]>
To: "MySQL " <[EMAIL PROTECTED]>
Sent: Monday, March 22, 2004 11:33 AM
Subject: select statement not working in a php page


I am trying to get a single result from a database, which works fine at
the sql command line. I have tried several versions of code, this being
the most recent -
\n";
echo "Warranty ID:\n";
echo "$WarrantyID\n";
echo "\n";
}
?>
No matter what I do I do not get the desired max id number from the column
WarrantyID. The same query works fine at the sql command line. What am I
doing wrong?
thanks
--
Chip

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


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



select statement not working in a php page

2004-03-22 Thread Chip Wiegand
I am trying to get a single result from a database, which works fine at 
the sql command line. I have tried several versions of code, this being 
the most recent -
\n";
echo "Warranty ID:\n";
echo "$WarrantyID\n";
echo "\n";
}
?>
No matter what I do I do not get the desired max id number from the column 
WarrantyID. The same query works fine at the sql command line. What am I 
doing wrong?
thanks
--
Chip 

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



Re: JVM unable to access MySQL intermittently?

2004-03-22 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Eric B. wrote:

> Hi,
>
> I'm running into a strange problem with my JVM and MySQL.  I'm using
> Macromedia JRun 4 as my JVM and everytime I restart the Jrun service, my
> application runs smoothly.  However, after an indeterminate amount of time
> (seemingly random - sometimes a couple of hours, sometimes 12-15
hours), my
> system is suddenly no longer able to access the MySQL database - my
queries
> are not being executed.  No error messages are thrown, nor any timeout's
> being hit.
>
> My problem is that I am not sure where to start debugging this problem.
> When it happens, I can see the MySQL threads (show full processlist) as
> being asleep for extended periods of time.  MySQL itself is alive, and
I am
> able to access it by manual queries through the command-line interface.
>
> This leads me to think that the problem either lies in my Connection
Pool or
> within the JConnector itself.  Is there any form of debugging I can enable
> in the JConnector to see if the JVM is actually attempting to make a
> connection and a query?  Or if a thread is being successfully retrieved by
> my Connection Pool?
>
> I'm running on MySQL 4.0.18 and JConnector 3.0.9.
>
> I am using autoReconnect=true and autoReconnectForPools=true as options to
> the JConnector.  I have also set the MySQL wait_timeout high (to
604800 = 1
> week) to ensure that it isn't a timeout problem I am seeing.
>
> Any help or suggestions would be greatly appreciated!

Eric,

If Connector/J is having trouble communicating with MySQL, it _will_
throw an exception. It just doesn't silently fail.

If you're not seeing _any_ exceptions being thrown, check where JRun is
logging exceptions. Do you have the opportunity to use a _different_ JVM
with JRun?

You might also try a newer version of Connector/J, to see if it changes
anything for your particular situation. You're using 3.0.9, while 3.0.11
is the latest production version.

-Mark


- --
Mr. Mark Matthews
MySQL AB, Software Development Manager, J2EE and Windows Platforms
Office: +1 708 332 0507
www.mysql.com

Meet the MySQL Team! April 14-16, 2004 http://www.mysql.com/uc2004/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFAXx5XtvXNTca6JD8RArAoAJ44DsDFL2b6VXIX6akxQE17oOULyACfQEX7
faUZbxDOo0IpxHwtFHeslFU=
=/4wc
-END PGP SIGNATURE-

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



Selecting non opposites

2004-03-22 Thread Dave Dash
I have a table of adjectives:

++
| word   |
++
| green  |
| ugly   |
| dark   |
| evil   |
| female |
| male   |
| drunk  |
++
and I want to select three of them randomly, but I don't want female and 
male to accidentally appear together (since they are opposites).

I can't think of a query that can do that, although it seems like there 
should be something easy.

Any help out there?

Thanks ;)

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


Re: Full-Text with JOIN

2004-03-22 Thread Sergei Golubchik
Hi!

On Mar 21, Lorderon wrote:
> Hi,
> 
> I also found that when you use JOIN with full-text, MySQL don't
> automatically sort the results by the coefficient of the full-text... when
> you use list of tables seperated by comma MySQL sorts it correctly...

What does EXPLAIN say in each case ?
 
Regards,
Sergei

-- 
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Senior Software Developer
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
   <___/  www.mysql.com

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



Re: COLLATE in CREATE TABLE

2004-03-22 Thread Victoria Reznichenko
[EMAIL PROTECTED] wrote:
> 
> I want to CREATE a TABLE an specify a collation.
> 
> If I do
> CREATE TABLE ... DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci;
> SHOW TABLE STATUS shows me Collation: latin1_swedish_ci
> If I omit the keyword DEFAULT the requested collation latin1_german1_ci
> is shown by SHOW TABLE STATUS.
> 
> So, what does DEFAULT before CHARACTER SET means?
> 
> If I don't use SHOW TABLE STATUS but SHOW CREATE TABLE the result is
> interesting too.
> For the table I applied the DEFAULT keyword the generated CREATE
> TABLE-statement uses the DEFAULT keyword too, but does not show the
> COLLATE part of the CREATE TABLE statement.
> For the table I omited the DEFAULT keyword, the generated
> CREATE-statement uses the DEFAULT keyword - though omited in my
> statement -, and shows the COLLATE part of the CREATE TABLE statement.
> It's in fact my first statement.
> 
> Is this regular behaviour?
> 
> I'm running MySQL 4.1.1a on an NT4-Box

Thank you for report! Entered to the bug database as bug #3255:
http://bugs.mysql.com/bug.php?id=3255


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





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



The MySQL data folder can be an virtual link?

2004-03-22 Thread Andre MATOS
Hi,

Is it possible to move the folder "data" where there are all databases to 
another hard driver and then create a virtual link using "ln -s"? If yes, 
is it just shutdown the MySQL server and then move the folder, create the 
link and finally start up the server?

Thanks!

Andre

-- 
Andre Matos
[EMAIL PROTECTED]



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



Fwd: Re: Another Performance query

2004-03-22 Thread Stefan Kuhn


--  Weitergeleitete Nachricht  --

Subject: Re: Another Performance query
Date: Mon, 22 Mar 2004 16:13:29 +0100
From: Stefan Kuhn <[EMAIL PROTECTED]>
To: A Z <[EMAIL PROTECTED]>

Indices can never be used with like "%x" (but with like "x%). This question
won't use indeces, neither in myisam nor in innodb. If you think about the
principles behind indices, you will see why indices can't work with like
starting with a joker.
Stefan

Am Monday 22 March 2004 15:39 schrieb A Z:
> here we go:
>
> explain select * from properties where reference like
> '%2332'
> +-+
> Table ¦ type ¦ possible keys ¦ key ¦ key_len ¦ ref ¦
> rows ¦ Extra
> +-+
> Properties ¦ All ¦ NULL ¦ NULL ¦ NULL ¦ NULL ¦ NULL ¦
> 2923 ¦ Using Where
>
> describe properties;
> +-+
> Field ¦ Type ¦ Null ¦ Key ¦ Default ¦ Extra
> +-+
> Reference ¦ VarChar(7) ¦   ¦ PRI ¦   ¦
>
> show index from properties;
> +-+
> Table ¦ Non_unique ¦ Key_name ¦ Seq_in_index ¦
> Column_name ¦ Collation ¦ Cardinality ¦ Sub_part ¦
> Pakced ¦ Null ¦ Index_type ¦ Comment
> +-+
> properties ¦ 0 ¦ PRIMARY ¦ 1 ¦ Reference ¦ A ¦ 2923 ¦
> NULL ¦ NULL ¦   ¦ BTREE
>
> regards
>
>
>
>  --- Benoit St-Jean <[EMAIL PROTECTED]> wrote: > A
>
> Z wrote:
> > >Thanks for your replies regarding to my previous
> > >query.
> > >
> > >We have encountered another problem:
> > >MySQL 4.0.14, INNODB.
> > >A table does have an Index on Field1, this field
> > >(Field1) is also the Primary Key.  Querying on this
> > >field takes a long time, running along with Explain
> > >command it displays that it does not use the index.
> > >
> > >Prior converting to INNODB it had been working fine
> >
> > in
> >
> > >MYISAM.
> > >
> > >What could cause this problem?
> >
> > Can you provide us with the EXPLAIN of the query, a
> > DESCRIBE TABLE and a
> > SHOW INDEX to help us pinpoint what the problem is?
>
> ___
> Yahoo! Messenger - Communicate instantly..."Ping"
> your friends today! Download Messenger Now
> http://uk.messenger.yahoo.com/download/index.html

--
Stefan Kuhn M. A.
Cologne University BioInformatics Center (http://www.cubic.uni-koeln.de)
Zülpicher Str. 47, 50674 Cologne
Tel: +49(0)221-470-7428   Fax: +49 (0) 221-470-7786
My public PGP key is available at http://pgp.mit.edu

---

-- 
Stefan Kuhn M. A.
Cologne University BioInformatics Center (http://www.cubic.uni-koeln.de)
Zülpicher Str. 47, 50674 Cologne
Tel: +49(0)221-470-7428   Fax: +49 (0) 221-470-7786
My public PGP key is available at http://pgp.mit.edu


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



Re: Another Performance query

2004-03-22 Thread A Z
here we go:

explain select * from properties where reference like
'%2332'
+-+
Table ¦ type ¦ possible keys ¦ key ¦ key_len ¦ ref ¦
rows ¦ Extra
+-+
Properties ¦ All ¦ NULL ¦ NULL ¦ NULL ¦ NULL ¦ NULL ¦
2923 ¦ Using Where

describe properties;
+-+
Field ¦ Type ¦ Null ¦ Key ¦ Default ¦ Extra
+-+
Reference ¦ VarChar(7) ¦   ¦ PRI ¦   ¦

show index from properties;
+-+
Table ¦ Non_unique ¦ Key_name ¦ Seq_in_index ¦
Column_name ¦ Collation ¦ Cardinality ¦ Sub_part ¦
Pakced ¦ Null ¦ Index_type ¦ Comment
+-+
properties ¦ 0 ¦ PRIMARY ¦ 1 ¦ Reference ¦ A ¦ 2923 ¦
NULL ¦ NULL ¦   ¦ BTREE

regards



 --- Benoit St-Jean <[EMAIL PROTECTED]> wrote: > A
Z wrote:
> 
> >Thanks for your replies regarding to my previous
> >query.
> >
> >We have encountered another problem:
> >MySQL 4.0.14, INNODB.
> >A table does have an Index on Field1, this field
> >(Field1) is also the Primary Key.  Querying on this
> >field takes a long time, running along with Explain
> >command it displays that it does not use the index.
> 
> >Prior converting to INNODB it had been working fine
> in
> >MYISAM.
> >
> >What could cause this problem?
> >
> 
> Can you provide us with the EXPLAIN of the query, a
> DESCRIBE TABLE and a 
> SHOW INDEX to help us pinpoint what the problem is?
>  





___
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

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



RE: (simple select) bug? version problem? or just bad SQL?

2004-03-22 Thread Jennifer Horne
I think you need to be using:

select * from clients_tb where active='on' AND first_name LIKE '%ja%' OR
middle_name LIKE '%ja%' OR last_name LIKE '%ja%'";

Your query is looking for names where the first, middle and last name
all have 'ja' in them.  If you're looking for names where -any- of them
can have 'ja' in them, use the OR.

Jennifer Horne
Panda Voice Systems Inc.
1.888.767.2632  ext 23

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 22, 2004 9:41 AM
To: [EMAIL PROTECTED]
Subject: (simple select) bug? version problem? or just bad SQL?


Hi,
I am running this (simple?) query on mysql 3.23 :

select * from clients_tb where active='on' AND first_name LIKE '%ja%'
AND middle_name LIKE '%ja%' AND last_name LIKE '%ja%'";

I know there are people in the table with:
first name James
last name James
middle name Jacob
etc

but it does not display them...if i try with just first name then it
displays the people whose first names start with "ja"

whats wrong? is this a bug or not supported in 3.23 or I have written
bad SQL?

How can I do the above?

Thanks,
-Ryan A

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


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



(simple select) bug? version problem? or just bad SQL?

2004-03-22 Thread ryan

Hi,
I am running this (simple?) query on mysql 3.23 :

select * from clients_tb where active='on' AND first_name LIKE '%ja%' AND middle_name 
LIKE '%ja%' AND last_name LIKE '%ja%'";

I know there are people in the table with:
first name James
last name James
middle name Jacob
etc

but it does not display them...if i try with just first name then it displays the 
people whose first names start with "ja"

whats wrong? is this a bug or not supported in 3.23 or I have written bad SQL?

How can I do the above?

Thanks,
-Ryan A

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



Re: Another Performance query

2004-03-22 Thread Benoit St-Jean
A Z wrote:

Thanks for your replies regarding to my previous
query.
We have encountered another problem:
MySQL 4.0.14, INNODB.
A table does have an Index on Field1, this field
(Field1) is also the Primary Key.  Querying on this
field takes a long time, running along with Explain
command it displays that it does not use the index. 
Prior converting to INNODB it had been working fine in
MYISAM.

What could cause this problem?

Can you provide us with the EXPLAIN of the query, a DESCRIBE TABLE and a 
SHOW INDEX to help us pinpoint what the problem is?

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


Another Performance query

2004-03-22 Thread A Z

Thanks for your replies regarding to my previous
query.

We have encountered another problem:
MySQL 4.0.14, INNODB.
A table does have an Index on Field1, this field
(Field1) is also the Primary Key.  Querying on this
field takes a long time, running along with Explain
command it displays that it does not use the index. 
Prior converting to INNODB it had been working fine in
MYISAM.

What could cause this problem?

regards






___
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html

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



Re: CHAR problem ...

2004-03-22 Thread Rafal Kedziorski
At 13:56 22.03.2004, Martijn Tonies wrote:

> > I have some problmes with MySQL. We have some CHAR columns, which after
> > CREATE or ALTER TABLE
> >
> > ALTER TABLE `traffic_stat` CHANGE `media_file_class_id`
> > `media_file_class_id` CHAR(32)  NOT NULL
> >
> > will be VARCHAR. Is this an MySQL bug? We are using MySQL 4.0.18.
>
> http://www.mysql.com/doc/en/Silent_column_changes.html
>
> will answer your question: if there are any variable columns in a table,
> MySQL sees no virtue in fixed size CHAR columns and silently changes CHAR
> to VARCHAR.
As against the SQL standard, because CHAR and VARCHAR are
conceptually different.
yes. our CHAR columns has allways the same length. 

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


Re: CHAR problem ...

2004-03-22 Thread Rafal Kedziorski
thx.

At 13:43 22.03.2004, [EMAIL PROTECTED] wrote:







Rafal Kedziorski <[EMAIL PROTECTED]> wrote on 22/03/2004 12:36:33:

> hi,
>
> I have some problmes with MySQL. We have some CHAR columns, which after
> CREATE or ALTER TABLE
>
> ALTER TABLE `traffic_stat` CHANGE `media_file_class_id`
> `media_file_class_id` CHAR(32)  NOT NULL
>
> will be VARCHAR. Is this an MySQL bug? We are using MySQL 4.0.18.
http://www.mysql.com/doc/en/Silent_column_changes.html

will answer your question: if there are any variable columns in a table,
MySQL sees no virtue in fixed size CHAR columns and silently changes CHAR
to VARCHAR.
  Alec



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


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


Re: Optimal RAID stripe size(s) for InnoDB?

2004-03-22 Thread Heikki Tuuri
Jeremy,

I am not sure if I have seen benchmarks of this. I think the stripe size is
not very important, as long as you make it significantly bigger than the
InnoDB page size of 16 kB.

Since it is not guaranteed that the OS will align InnoDB's data pages to
stripes, having a small, 16 kB stripe size might cause 2 disk reads for a
random read of an InnoDB page.

Since there are usually unexplained performance phenomena in file i/o and
disk i/o, a real-world test is needed for your particular software/hardware
combination to determine a good stripe size.

Best regards,

Heikki
Innobase Oy
InnoDB - transactions, row level locking, and foreign keys for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM
tables
http://www.innodb.com/order.php

Register now for the 2004 MySQL Users Conference!
http://www.mysql.com/events/uc2004/index.html


.
List:MySQL General Discussion« Previous MessageNext Message »
From: Jeremy Zawodny Date:March 18 2004 11:48pm
Subject: Optimal RAID stripe size(s) for InnoDB?

Has anyone done much testing with RAID stripe sizes for heavy
concurrency InnoDB-based applications?

I'm expecting that using a stripe size that matches InnoDB's page size
would make sense, but it could save a lot of testing if someone else
has already done this.

Thanks,

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


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



Re: InnoDB Hot Backup problems with O_DIRECT (ibbackup)

2004-03-22 Thread Heikki Tuuri
Hi!

Looks like your Linux kernel makes the file read performed by ibbackup to
fail immediately, but does not set errno to anything. That is why ibbackup
says the errno is 0.

The support for O_DIRECT is rather new in Linux kernels.

For now the workaround is not to use O_DIRECT if you plan to use ibbackup. I
hope Linux kernels 2.6 will fix this issue, since the file i/o system is
modified in it, but I have not tested it.

Best regards,

Heikki
Innobase Oy
InnoDB - transactions, row level locking, and foreign keys for MySQL
InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyISAM
tables
http://www.innodb.com/order.php

Register now for the 2004 MySQL Users Conference!
http://www.mysql.com/events/uc2004/index.html


...
List: MySQL General Discussion« Previous MessageNext Message »
From:queritorDate:March 20 2004 3:22am
Subject: InnoDB Hot Backup problems with O_DIRECT (ibbackup)



I'm having the following problem while trying to run ibbackup when the
database is using innodb_flush_method=O_DIRECT
This is on Redhat Enterprise 3.0.
As you can see, it's reporting an error code of 0, which supposedly means
'success'

Is there a way around this or will I have to use another file flush
method?

Thanks
-- START OUTPUT ---
[EMAIL PROTECTED] mysql-hotbak]# ibbackup --compress /etc/my.cnf
/var/mysql-hotbak/myhotbak.cnf
InnoDB Hot Backup version 2.0-beta5; Copyright 2003 Innobase Oy
License xx is granted to [EMAIL PROTECTED] x 
(--apply-log works in any computer regardless of the hostname)
Licensed for use in a computer whose hostname is 'apollo'
Expires -0-0 (year-month-day) at 00:00
See http://www.innodb.com for further information
Type ibbackup --license for detailed license terms, --help for help

Contents of /etc/my.cnf:
innodb_data_home_dir got value /var/lib/mysql/
innodb_data_file_path got value
ibdata01:2000M;ibdata02:2000M;ibdata03:2000M;ibdata04:2000M;ibdata05:2000M
datadir got value /var/lib/mysql
innodb_log_group_home_dir got value /var/lib/mysql/
innodb_log_files_in_group got value 3
innodb_log_file_size got value 67108864

Contents of /var/mysql-hotbak/myhotbak.cnf:
innodb_data_home_dir got value /var/mysql-hotbak
innodb_data_file_path got value
ibdata01:2000M;ibdata02:2000M;ibdata03:2000M;ibdata04:2000M;ibdata05:2000M
datadir got value /var/mysql-hotbak
innodb_log_group_home_dir got value /var/mysql-hotbak
innodb_log_files_in_group got value 3
innodb_log_file_size got value 67108864

ibbackup: Found checkpoint at lsn 3 246406950
ibbackup: Starting log scan from lsn 3 246406656
040320  2:01:41  ibbackup: Copying log...
040320  2:01:41  ibbackup: Log copied, lsn 3 246406950
ibbackup: We wait 10 seconds before starting copying the data files...
040320  2:01:51  ibbackup: Copying /var/lib/mysql/ibdata01
040320  2:02:01  InnoDB: Operating system error number 0 in a file
operation.
InnoDB: Error number 0 means 'Success'.
InnoDB: See also section 13.2 at http://www.innodb.com/ibman.html
InnoDB: about operating system error numbers.
InnoDB: File operation call: 'read'.
InnoDB: Cannot continue operation.
- END OUTPUT ---


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



Re: CHAR problem ...

2004-03-22 Thread Martijn Tonies

> > I have some problmes with MySQL. We have some CHAR columns, which after
> > CREATE or ALTER TABLE
> >
> > ALTER TABLE `traffic_stat` CHANGE `media_file_class_id`
> > `media_file_class_id` CHAR(32)  NOT NULL
> >
> > will be VARCHAR. Is this an MySQL bug? We are using MySQL 4.0.18.
>
> http://www.mysql.com/doc/en/Silent_column_changes.html
>
> will answer your question: if there are any variable columns in a table,
> MySQL sees no virtue in fixed size CHAR columns and silently changes CHAR
> to VARCHAR.

As against the SQL standard, because CHAR and VARCHAR are
conceptually different.

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com


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



Re: CHAR problem ...

2004-03-22 Thread Alec . Cawley







Rafal Kedziorski <[EMAIL PROTECTED]> wrote on 22/03/2004 12:36:33:

> hi,
>
> I have some problmes with MySQL. We have some CHAR columns, which after
> CREATE or ALTER TABLE
>
> ALTER TABLE `traffic_stat` CHANGE `media_file_class_id`
> `media_file_class_id` CHAR(32)  NOT NULL
>
> will be VARCHAR. Is this an MySQL bug? We are using MySQL 4.0.18.

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

will answer your question: if there are any variable columns in a table,
MySQL sees no virtue in fixed size CHAR columns and silently changes CHAR
to VARCHAR.

  Alec




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



CHAR problem ...

2004-03-22 Thread Rafal Kedziorski
hi,

I have some problmes with MySQL. We have some CHAR columns, which after 
CREATE or ALTER TABLE

ALTER TABLE `traffic_stat` CHANGE `media_file_class_id` 
`media_file_class_id` CHAR(32)  NOT NULL

will be VARCHAR. Is this an MySQL bug? We are using MySQL 4.0.18.

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


Re: Reduce Log Level?

2004-03-22 Thread Egor Egorov
"Michael B Allen" <[EMAIL PROTECTED]> wrote:
> For some reason mysql is logging every sql statement. I don't recall
> turning on such a thing. Can someone tell me how to turn that down/off. It
> seems a little excessive for my wimpy vps.
> 
> Thanks,
> Mike
> 
> # dpkg -l | grep mys
> ii  libdbd-mysql-p 1.2216-2   mySQL database interface for Perl
> ii  libmysqlclient 3.23.49-8.5mysql database client library
> ii  mysql-client   3.23.49-8.5mysql database client binaries
> ii  mysql-common   3.23.49-8.5mysql database common files (e.g.
> /etc/mysql
> ii  mysql-server   3.23.49-8.5mysql database server binaries
> ii  php4-mysql 4.1.2-6woody3  MySQL module for php4
> 

Did you run mysqld with --log option?
What is the output of SHOW VARIABLES LIKE "%log%"?



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




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



JOINING...

2004-03-22 Thread David Scott
Hiya peeps.
I have a table which looks something like this:

TABLE1
id, something, page1, page2, page3
1, "wibble", 1, 3, 5

TABLE2
id, name
1, "hello"
2, "world"
3, "why can't"
4, "i get"
5, "this to work"

I want to SELECT everything from TABLE1 replacing the numbers in page1, 2, 3
with the words is TABLE2.

RESULT
id, something, page1, page2, page3
1, "wibble", "hello", "why can't", "this to work"

I usually just do "SELECT * FROM table1 WHERE table1.page1 = table2.id" but
this doesnt work when there are multiple pages (page1, 2, 3 in table1)

Help :S
I've tried using joins but I can't seem to get the syntax right...
and yes. I have read the manual, just not sire if the bit I read (joins) is
the bit I need to read
--
Dave


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



mysterious "can't connect" error message in our logs(2)

2004-03-22 Thread Jigal van Hemert
The continuing saga:

> Can't connect to MySQL server on '192.168.13.205' (4)
Our sysadmin has been searching in the sources of the MySQL client and came
up with this:

The errormessage (4) is probably (only place where this error could be
found) raised by this fragment in libmysql.c:

if ((sock = (my_socket) socket(AF_INET,SOCK_STREAM,0)) == SOCKET_ERROR)
{
  net->last_errno=CR_IPSOCK_ERROR;
  sprintf(net->last_error,ER(net->last_errno),socket_errno);
  goto error;
}

According to:
http://www-users.cs.umn.edu/~bentlema/unix/syscalls_and_ipc.html
this is what happens:

1) The MySQL client tries to create a new socket.
2) At that moment the thread is interupted by a signal. Control is passed to
the signal handler.
3) After the signal handler has done his work, control goes back to the
original thread. The socket() function notices that it was interupted and
returns the error-code.

If you look at the sample code in section 8.1 of the url above

  for (;;) {
   rmask = mask;
   nfound = select(FD_SETSIZE, &rmask, (fd_set *)0, (fd_set *)0,
&timeout);
   if (nfound < 0) {
if (errno == EINTR) {
 printf("interrupted system call\n");
 continue;
}
/* something is very wrong! */
perror("select");
exit(1);
   }
(...)

The client should try again if the EINTR error was returned.

Did we do something wrong in the configuration of the server or is this a
tiny bug?

Regards, Jigal.



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



Re: nested transactions

2004-03-22 Thread Egor Egorov
Egor Egorov <[EMAIL PROTECTED]> wrote:
> TO <[EMAIL PROTECTED]> wrote:
>> Does INNODB support nested transactions?  If so, what version?
> 
> No, InnoDB doesn't support nested transactions.
> 

Well, not really. I've forgot to mention the savepoints:
http://www.mysql.com/doc/en/Savepoints.html



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




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



PHP page killing session on submit!!

2004-03-22 Thread sgannon60

I am using the MX04 and PHP 4.3x to auto generate and authenticate a login
page but sessions just seem to be lost on submit???



When I call the login page this session is started;-

sess_eff5bcd126b406d7e99fee19727f85d3

  and this is the contents:-
   username|N;

once I have submitted the data is submitted the above session contains :-


   username|N;MM_Username|s:1:"a";MM_UserGroup|s:1:"a";

and if login is successful I am taken to the welcome page where the
session_start(); should have the name available  but instead a new blank
session is created

   sess_774fbd3a8ebb478e49a98dd69e5eb79f

I have set auto_session Start to on, set trans_id to on in the PHP>ini
filebut no good,

I have tried using $HTTP_SESSION_VAR[];
no good

Anybody have any ideas

PLEASE

Stu




MY earlier related post for background.




Hello, and I hope to god someone in here can answer my question as I am at
my wits end.


System, Mysql 4xx, php 4.3x, DWMX 2004, phpMyadmin 2.5, WinXP Pro, IIS

Will be uploading to a unix server

THE PLAN
to register users in a LOGIN table, if successful take them to the login
page where they login, and this brings up a page with their info from the
registration process .


THE PROBLEM
I am using DWMX04 to create and populate these tables and all seems well. I
can  successfully register a new user in the LOGIN  table, but when I go to
login in the login_id (The Master Key for all subsequent tables and tows
related to this user) is not made available to the target page and the
default is used so no matter who logs in they always see the info for the
first user.

..

this is the dynamic table entry
$colname_rs_log_info = "1";
if (isset($_GET['login_id'])) {
  $colname_rs_log_info =
(get_magic_quotes_gpc()) ? $_GET['login_id'] :
addslashes($_GET['login_id']);these take them to a welcome page with
this is the update entry
$colname_rs_login_check = "1";
if (isset($_COOKIE['login_id'])) {
  $colname_rs_login_check = (get_magic_quotes_gpc()) ?
$_COOKIE['login_id'] : addslashes($_COOKIE['login_id']);
}

I have tried all the combinations of the recordset wizard (except the
correct one - no doubt), I have checked that session_start(); is on and that
global variables is on (though I would have to turn these off when uploading
to hosting server).

Thanks in advance

stu









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



mysterious "can't connect" error message in our logs

2004-03-22 Thread Jigal van Hemert
Hi list,

We recently installed a new MySQL server (Redhat 8, MySQL 4.0.18, same as
old machine, but with more powerful hardware) and every now and then the
following error appears in the errorlog (the result of the mysql_error()
function of PHP):
Can't connect to MySQL server on '192.168.13.205' (4)

The errorcode '4' on Linux is supposed to mean "interrupted system call".
Yeah, like that's gonna help?

Any ideas in what direction we might have to search to solve this challenge?

Thanx in advance (also on behalve of our sysadmin)

Regards, Jigal.



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



RE: Preventing Duplicate Entries

2004-03-22 Thread David Perron
Is it possible to use a primary key to avoid duplicates?  The reaction to
duplicate rows will depend on what type of statement you are issuing.
An update/delete would update/delete all rows that are relevant, a select
would return multiple rows with the same values.

-Original Message-
From: Axel IS Main [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 21, 2004 10:25 PM
To: [EMAIL PROTECTED]
Subject: Preventing Duplicate Entries


I have a php app that updates an ever growing table with new information 
on a regular basis. Very often the information is duplicated. I'm 
currently handling this by checking the table for duplicate values every 
time I go to add new data. As you can imagine, as the table grows it 
takes longer and longer for this to happen, and the process gets slower 
and slower. In order to speed things up I'm wondering of it might not be 
a good idea to not allow duplication in a given field. The question is, 
if there is a duplicate, how will MySQL react? And what's the best way 
to manage that reaction? Also, will this actually be faster than doing 
it the way I'm doing it now?

Nick



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


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



Undelivered mail: fake

2004-03-22 Thread DrWeb-DAEMON
Dear User,

the message with following attributes has not been delivered,
because contains an infected object.

Sender = [EMAIL PROTECTED] (may be forged)
Recipients = [EMAIL PROTECTED] 
Subject =  fake
Message-ID =  <[EMAIL PROTECTED]>

Antivirus filter report:
--- Dr.Web report ---
Following virus(es) has been found:
infected with Win32.HLLM.Netsky.41984

Dr.Web detailed report:
drweb.tmp.cX86OU - archive MAIL
drweb.tmp.cX86OU/[text:plain] - Ok
drweb.tmp.cX86OU/doc.zip infected with Win32.HLLM.Netsky.41984

Dr.Web scanning statistic:
Infected : 1

--- Dr.Web report ---

The original message was stored in archive record named: 
drweb.quarantine.EYygAf 
In order to receive the original message, please send request to 
<[EMAIL PROTECTED]>, referring to the archive record 
name given above.

---
   Antivirus service provided by Dr.Web(R) Daemon for Unix
   (http://www.drweb.ru, http://www.dials.ru/english)
Уважаемый Отправитель [EMAIL PROTECTED] !

Сообщение, отправленное с Вашего адреса (возможно вирусом 
с другого компьютера) по адресу(ам) [EMAIL PROTECTED] 
инфицировано и не было доставлено.

--- Dr.Web report ---
Найден(ы) следующий(е) вирус(ы):
infected with Win32.HLLM.Netsky.41984

Детализированный отчет Dr.Web:
drweb.tmp.cX86OU - archive MAIL
drweb.tmp.cX86OU/[text:plain] - Ok
drweb.tmp.cX86OU/doc.zip infected with Win32.HLLM.Netsky.41984

Статистика сканирования Dr.Web:
Infected : 1

--- Dr.Web report ---

Ваше сообщение сохранено в карантине под именем:
drweb.quarantine.EYygAf

Чтобы получить это сообщение, обратитесь к администратору
по адресу <[EMAIL PROTECTED]>, указав имя, под которым
Ваше сообщение сохранено в карантине.

---
   Антивирусная защита почтовых серверов
   Dr.Web(R) Daemon for Unix (разработан в Daniloff's Labs)
   (http://www.drweb.ru, http://www.DialogNauka.ru)
Return-Path: <[EMAIL PROTECTED]>
Received: from makler.org.ua (constanta.finfort.com [193.110.72.98])
by mx.vline.ru (Postfix) with SMTP id D55452A4D9
for <[EMAIL PROTECTED]>; Mon, 22 Mar 2004 10:31:02 +0300 (MSK)
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: fake
Date: Mon, 22 Mar 2004 09:35:23 +0200
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="87774851"
Message-Id: <[EMAIL PROTECTED]>

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

Re: interesting....BUG?

2004-03-22 Thread Victoria Reznichenko
"Nestor Florez" <[EMAIL PROTECTED]> wrote:
> 
> I have a php web application that has an admin page for inserting course =
> records and one for selecting course records=20
> and a client page for selecting course record. =20
> In the admin side I insert records with an "insert into Course_Eng" and I =
> select records witha "select * from Course_Eng"
> In the client side I get records witha "select * from course_eng"
> 
> The kicker is that my client webbased select will only return 40 records =
> (no limits are being use) but my admin
> webbased select returns 200 records.  I SSH into the server and when I =
> check the table "desc course_eng"
> look good.
> After scraching my head several times I found out that if  manually typed =
> on the server
> my select statement as "select * from Course_Eng" I would get 200 records =
> back, but if I
> typed "select * from course_eng" I would get 40 records.
> 
> Is this a bug? or a feature?
> 
> Whe I did a "show tables;", the table name is  "course_eng"  ther was no =
> table "Course_Eng"
> 
> If I remember correct in the SQL syntax the case should not matter?
> 
> I change all my inserts and selects to "Course_Eng"  that seem to work and =
> returned me the most records
> My server is  a Mac OS 10.2 and the Mysql version is "server version: =
> 4.0.16"
> 

"SELECT * FROM course_eng" is the exact query that you use?
Check with SELECT @@session.sql_select_limit that it's not SQL_SELECT_LIMIT issue.


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





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



Avg and Std function - null values

2004-03-22 Thread Pina Kelwin
Hi,
(B
(BI have a table with the sales of each product by month (in the format 
(Bmm).
(BFor example: (table name: ventas)
(B
(Bsale_date prod_idsales
(B200301   A20
(B200302   A16
(B200303   A18
(B200301   B12
(B200302   B  3
(B200304   B10
(B
(BI would like to have the average sales per month of each product.
(BIf I use:
(B"SELECT prod_id, avg(sales) as average
(B  FROM ventas
(B  GROUP by prod_id"
(B
(Bthen I would get the average sales from Jan 2003 to Mar 2003 for product A 
(B(18.0) and the average sales for product B (8.33). 
(BHowever, as you would have probably noticed, my table covers the sales 
(Bperiod Jan 2003 to Apr 2003. I would like to get the average sales for the 
(Bperiod Jan-Apr 2003 for each product: A (13.5) and B (6.25).
(B
(BI know that if I add the missing lines with value 0 the problem would be 
(Bsolved, but I would like to know an efficient way to add those lines 
(Bwithout having to check the table for missing values with a script (I also 
(Bneed to calculate the standard deviation).
(B
(BThanks in advance for your help.
(B
(Bkelwin
(B
(B_
$BM'C#$H(B24$B;~4V%[%C%H%i%$%s!V(BMSN $B%a%C%;%s%8%c!http://messenger.msn.co.jp 
(B
(B
(B-- 
(BMySQL General Mailing List
(BFor list archives: http://lists.mysql.com/mysql
(BTo unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: nested transactions

2004-03-22 Thread Egor Egorov
TO <[EMAIL PROTECTED]> wrote:
> Does INNODB support nested transactions?  If so, what version?

No, InnoDB doesn't support nested transactions.



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




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



Re: FULLTEXT query format question

2004-03-22 Thread Sergei Golubchik
Hi!

On Mar 21, Shane Allen wrote:
> I've read through the boolean mode fulltext docs, and they address all 
> my questions well except how searches containing exact phrases are 
> handled when there is more than one. I believe the following will work 
> as I expect, but was wondering if anyone can confirm it for me:
> 
> Given the following search strings, are the following MATCH AGAINST 
> (BOOLEAN) going to operate as the search strings suggest?
> 
> Based on a discussion with a coworker, we've determined in the old 
> search strings that OR has a higher precedence than AND (the goal of the 
> first being either "ambulatory pediatrics" or "ambulatory obgyn", for 
> example)
> 
> "obgyn" OR "pediatrics" AND "ambulatory":
> MATCH (jobdescription) AGAINST('+("obgyn" "pediatrics") +("ambulatory")' 
> IN BOOLEAN MODE)

Yes. It could be simplified to

 '+(obgyn pediatrics) +ambulatory'

> "Training" AND "Documentation" OR "Technical Writer":
> MATCH (jobdescription) AGAINST('+("Training") +("Documentation" 
> "Technical Writer")' IN BOOLEAN MODE)

Correct. Or

 '+Training +(Documentation "Technical Writer")'
 
> "art" OR "graphic" OR "publishing":
> MATCH (jobdescription) AGAINST('+("art" "graphic" "publishing")' IN 
> BOOLEAN MODE)

Yes. Or simply

 'art graphic publishing'
 
> "web design" AND "web development" AND "webmaster":
> MATCH (jobdescription) AGAINST('+("web design") +("web development") 
> +("webmaster")' IN BOOLEAN MODE)

Yes. Or

 '+"web design" +"web development" +"webmaster"'

If you find that some of the above doesn't work as expected -
report at http://bugs.mysql.com :)

Regards,
Sergei

-- 
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__  MySQL AB, Senior Software Developer
/_/  /_/\_, /___/\___\_\___/  Osnabrueck, Germany
   <___/  www.mysql.com

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



Re: Strange behavior, Table Level Permission

2004-03-22 Thread Victoria Reznichenko
"Terence" <[EMAIL PROTECTED]> wrote:
> Will be fixed in 4.1.2?

Yes, it's fixed in 4.1.2.

>When can we expect that to be out? Anyone with an
> idea?

Soon. Probably in two weeks.

> 
> - Original Message ---

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





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



Re: Strange behavior, Table Level Permission

2004-03-22 Thread Terence
Will be fixed in 4.1.2? When can we expect that to be out? Anyone with an
idea?

(Also facing this problem here)

- Original Message - 
From: "Victoria Reznichenko" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 22, 2004 3:57 PM
Subject: Re: Strange behavior, Table Level Permission


Udbhav Shah <[EMAIL PROTECTED]> wrote:
>
> Using Mysql 4.1.1-alpha release on RH9,
> I have used RPM provided on Mysql site to upgrade from
> 3.23 to 4.1.1
>
> I have a very strange behavior of mysql server,when I
> restart my server, it is not reading permission given
> to user at Table Level from tables_priv.
>
> Permission are still there, but when I use "show
> grants for ..." it show that no privileges.
>
> Commands used:
> grant all on try.TBL_MACIP to 'tryAdmin1'@'localhost';
> /etc/init.d/mysqld restart
>
>>mysql -utryAdmin1
> mysql>use try
> access denied
>
> Does anyone know how to remove such unexpected
> behavior, because this was perfectly working in 3.23
>

Thank you for report. It's a known bug in version 4.1.1 and it's already
fixed:
http://bugs.mysql.com/bug.php?id=2546



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





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


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



Re: Strange behavior, Table Level Permission

2004-03-22 Thread Victoria Reznichenko
Udbhav Shah <[EMAIL PROTECTED]> wrote:
> 
> Using Mysql 4.1.1-alpha release on RH9,
> I have used RPM provided on Mysql site to upgrade from
> 3.23 to 4.1.1
> 
> I have a very strange behavior of mysql server,when I
> restart my server, it is not reading permission given
> to user at Table Level from tables_priv.
> 
> Permission are still there, but when I use "show
> grants for ..." it show that no privileges.
> 
> Commands used:
> grant all on try.TBL_MACIP to 'tryAdmin1'@'localhost';
> /etc/init.d/mysqld restart
> 
>>mysql -utryAdmin1
> mysql>use try
> access denied
> 
> Does anyone know how to remove such unexpected
> behavior, because this was perfectly working in 3.23
> 

Thank you for report. It's a known bug in version 4.1.1 and it's already fixed:
http://bugs.mysql.com/bug.php?id=2546



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





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