Re: HELP [nativecode=2013 ** Lost connection to MySQL server during query]

2005-12-16 Thread Gleb Paharenko
Hello.



Have a look here:

  http://dev.mysql.com/doc/refman/5.0/en/communication-errors.html







Doug Dalton wrote:

 

 I found a log error after turning on warning running the server manually:

 

 051215 17:32:42 [Warning] Aborted connection 3961 to db: 'db' user:

 'user' host: `client' (Got timeout reading communication packets)

 

 Any idea what this error is ?  the interfaces show no errors from a

 network perspective:

 

 db machine

 eth0  Link encap:Ethernet  HWaddr 00:30:48:2E:E1:F2

  inet addr:10.0.0.10  Bcast:10.0.0.255  Mask:255.255.255.0

  inet6 addr: fe80::230:48ff:fe2e:e1f2/64 Scope:Link

  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

  RX packets:7973410 errors:0 dropped:0 overruns:0 frame:0

  TX packets:9299327 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 txqueuelen:1000

  RX bytes:746369778 (711.7 Mb)  TX bytes:8126772010 (7750.2 Mb)

  Base address:0x2000 Memory:da20-da22

 client machine:

 eth1  Link encap:Ethernet  HWaddr 00:30:48:55:92:4F

  inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0

  inet6 addr: fe80::230:48ff:fe55:924f/64 Scope:Link

  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

  RX packets:19720381 errors:0 dropped:0 overruns:0 frame:0

  TX packets:16126186 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 txqueuelen:1000

  RX bytes:16315799815 (15559.9 Mb)  TX bytes:1696496582 (1617.9 Mb)

  Base address:0xc400 Memory:fc9a-fc9c

 

 and the query runs fine a second time? so the query isnt malformed

 

 Regards,

 Doug

 



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




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



Re: Declare Cursor Question

2005-12-16 Thread Gleb Paharenko
Hello.



Surround your code inside the IF statement with BEGIN...END. For example

this works for me:



drop procedure if exists testcursor;

DELIMITER //

CREATE PROCEDURE testcursor(IN city_name varchar(255))

DETERMINISTIC

BEGIN

declare tval int;

IF (INSTR(city_name, ',')  0) THEN

begin

DECLARE cur_neighborhood CURSOR FOR

  SELECT DISTINCT neighborhood

  FROM listing

  WHERE FIND_IN_SET(city, city_name);

open cur_neighborhood;

  FETCH cur_neighborhood into tval;

close cur_neighborhood;

select tval;

end;

ELSE

begin

DECLARE cur_neighborhood CURSOR FOR

  SELECT DISTINCT neighborhood

  FROM listing WHERE city =city_name;

end;

select goodby;

END IF;

END;

//

delimiter ;

call testcursor(test1,ts);





CREATE TABLE `listing` (

  `neighborhood` varchar(255) default NULL,

  `city` varchar(255) default NULL

) ENGINE=MyISAM DEFAULT CHARSET=latin2



mysql select * from listing;

+--+--+

| neighborhood | city |

+--+--+

| 1| ts   |

+--+--+



+--+

| version()|

+--+

| 5.0.16-debug-log |

+--+





Tripp Bishop wrote:

 Howdy all.

 

 I need to define a cursor in a stored procedure but I

 don't know what the nature of the select statement is

 going to be until runtime. I need to do something like

 the code below:

 

 IF (INSTR(city_name, ',')  0) THEN

   DECLARE cur_neighborhood CURSOR FOR

 SELECT DISTINCT neighborhood FROM listing WHERE

 FIND_IN_SET(city, city_name);

 ELSE

   DECLARE cur_neighborhood CURSOR FOR 

 SELECT DISTINCT neighborhood FROM listing WHERE

 city = 

 city_name;

 END IF;

 

 MySQL doesn't like this syntax. Is there a way that I

 can accomplish this?

 

 Cheers,

 

 Tripp

 

 __

 Do You Yahoo!?

 Tired of spam?  Yahoo! Mail has the best spam protection around 

 http://mail.yahoo.com 

 



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




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



Re: use deterministic within procedure

2005-12-16 Thread Gleb Paharenko
Hello.



In the example,routine_body is non-deterministic.But the function

defined  DETERNINISTIC.Do mysql throw a exception in creating process?





In my opinion, it shouldn't, but you can check this by yourself.











I want to say,if i my funciton is a non-deterministic function.But i

define then function with deterministic option.



for example:



-

create function test()

 return int

 DETERNINISTIC



 routine_body

--



In the example,routine_body is non-deterministic.But the function

defined  DETERNINISTIC.Do mysql throw a exception in creating process?











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




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



Re: CPU 100% + crashes ...

2005-12-16 Thread Dilipan Sebastiampillai


can you please post the complete .err log that also contains 
information about the crashes. If there are stack traces, please 
resolve them.


- 


.err
- 


mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help 
diagnose
the problem, but since we have already crashed, something is definitely 
wrong

and this may fail.

key_buffer_size=8388608
read_buffer_size=520192
max_used_connections=148
max_connections=1000
threads_connected=21
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections 
= 1540184 K

bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x6f405da0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x1978f88, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x80f7893
0x6b4d96
0x82ab930
0x8158a17
0x82302c1
0x819f373
0x815d4e2
0x8105657
0x810868d
0x8103321
0x8102eb8
0x810280d
0x6afe51
0x51e06a
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://www.mysql.com/doc/en/Using_stack_trace.html and 
follow instructions on how to resolve the stack trace. Resolved

stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd-query at 0xa633050 = SHOW INNODB STATUS
thd-thread_id=6289685
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
051214 19:09:08  InnoDB: Database was not shut down normally.
InnoDB: Starting recovery from log files...
InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 1 2404815205
InnoDB: Doing recovery: scanned up to log sequence number 1 2410057728
InnoDB: Doing recovery: scanned up to log sequence number 1 2415300608
InnoDB: Doing recovery: scanned up to log sequence number 1 2420543488
InnoDB: Doing recovery: scanned up to log sequence number 1 2425786368
InnoDB: Doing recovery: scanned up to log sequence number 1 2431029248
InnoDB: Doing recovery: scanned up to log sequence number 1 2436272128
InnoDB: Doing recovery: scanned up to log sequence number 1 2441515008
InnoDB: Doing recovery: scanned up to log sequence number 1 2446757888
InnoDB: Doing recovery: scanned up to log sequence number 1 2452000768
InnoDB: Doing recovery: scanned up to log sequence number 1 2457243648
InnoDB: Doing recovery: scanned up to log sequence number 1 2462486528
InnoDB: Doing recovery: scanned up to log sequence number 1 2463763843
051214 19:09:10  InnoDB: Starting an apply batch of log records to the 
database...
InnoDB: Progress in percents: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 
90 91 92 93 94 95 96 97 98 99

InnoDB: Apply batch completed
051214 19:09:17  InnoDB: Flushing modified pages from the buffer pool...
051214 19:09:18  InnoDB: Started
/var/lib/mysql/MySQL4.0.18/libexec/mysqld: ready for connections.
Version: '4.0.18-log'  socket: 
'/var/lib/mysql/MySQL4.0.18/var/mysql4.0.18.sock'  port: 3306

051215  8:40:46  /var/lib/mysql/MySQL4.0.18/libexec/mysqld: Normal shutdown

051215  8:40:47  InnoDB: Starting shutdown...
051215  8:40:50  InnoDB: Shutdown completed
051215  8:40:50  /var/lib/mysql/MySQL4.0.18/libexec/mysqld: Shutdown 
Complete


051215  8:40:52  InnoDB: Started
/var/lib/mysql/MySQL4.0.18/libexec/mysqld: ready for connections.
Version: '4.0.18-log'  socket: 
'/var/lib/mysql/MySQL4.0.18/var/mysql4.0.18.sock'  port: 3306



- 


resolved stack traces
- 

mysql@:~/MySQL4.0.18/var =resolve_stack_dump -s /tmp/mysqld.sym -n 
mysqld.stack

0x80f7893 handle_segfault + 399
0x6b4d96 (?)
0x82ab930 strnmov + 24
0x8158a17 innobase_mysql_print_thd + 471
0x82302c1 lock_print_info + 1573

GUI (linux X based or web based) for mysql

2005-12-16 Thread Dotan Cohen
I keep a lot of personal information in a MySQL database. I have a few
querys premade for the wife to use, but we have gotten to the point
where we need a solution for her to be able to run her own queries.
She is NOT about to learn SQL, and myPHPadmin is a little too
compicated. I looked at an Access installation the other day and it
seemed to be just what we need- a GUI for non-programmers to use a
database. Is there any such beast for MySQL? Anthing that will run on
Fedora Core 4 would be great. Or even a web-based solution would be
fine- I do have apache on localhost.

Thank you.

Dotan Cohen
http://technology-sleuth.com/question/why_are_internet_greeting_cards_dangerous.html


Problema with left join

2005-12-16 Thread serrano . neves

Hi,

i have a problem, with my one query, this query is OK, in mysql 3.23, 
but i update my database to mysql 5.0 and one query having a error


SELECT count( p.products_id )  AS total
FROM products_description pd, products p, products_to_categories p2c
LEFT  JOIN manufacturers m
USING ( p.manufacturers_id = m.manufacturers_id )
LEFT  JOIN specials s
USING ( p.products_id = s.products_id )
WHERE p.products_status = '1'
AND p.products_id = p2c.products_id
AND pd.products_id = p2c.products_id
AND pd.language_id = '4'
AND p2c.categories_id = '16'

the error

#1064 - You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near '.manufacturers_id = m.manufacturers_id )

 LEFT JOIN specials s
 USING ( p.produc' at line 4

What's the error in the query?!!?

Thanks

Eduardo Jorge (aka etho)

Re: Problema with left join

2005-12-16 Thread Jigal van Hemert

[EMAIL PROTECTED] wrote:
#1064 - You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near '.manufacturers_id = m.manufacturers_id )

 LEFT JOIN specials s
 USING ( p.produc' at line 4

What's the error in the query?!!?


USING ( list_of_column_names )
versus
ON  expression

AFAIK it would be:
USING (products_id)
or
ON p.products_id = s.products_id
etc.

Regards, Jigal.


smime.p7s
Description: S/MIME Cryptographic Signature


BladeCenter of IBM and MySQL

2005-12-16 Thread Yariv Graf

Hi all
The company that I'm work for use very intensive MySQL dB on 32 bit 
platform.
because of the limitation of Innodb on linux 32bit (kernel2.6) we've 
decided to buy a bladecenter of IBM with 14 blades to replace the 
current configuration.
we thought of buying 64 bit Opteron dual core dual CPU each blade with 
8GB of DDR RAM,or

64  bit dual POWER based CPU with 8GB RAM

Does anyone have any experience with MySQL + Linux + POWER based CPU? is 
it better deal than AMD 64 Opteron based CPU?


Thanks in advance

Yariv


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



Re: CPU 100% + crashes ...

2005-12-16 Thread Heikki Tuuri

Dilipan,

thank you.

I think there indeed is a slight unprotected access in:

 0x8158a17 innobase_mysql_print_thd + 471

We will investigate if it has been fixed in 4.1.xx.

Again, SHOW INNODB STATUS\G shows a very light load inside InnoDB. You 
would get more informative output if you would wait 20 seconds before 
printing each SHOW INNODB STATUS\G. Now it says:


 Per second averages calculated from the last 0 seconds

But the high load hardly can be inside InnoDB. Please post SHOW 
PROCESSLIST during typical high load.


Best regards,

Heikki

Oracle Corp./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


Dilipan Sebastiampillai wrote:


can you please post the complete .err log that also contains 
information about the crashes. If there are stack traces, please 
resolve them.


- 


.err
- 


mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help 
diagnose
the problem, but since we have already crashed, something is definitely 
wrong

and this may fail.

key_buffer_size=8388608
read_buffer_size=520192
max_used_connections=148
max_connections=1000
threads_connected=21
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections 
= 1540184 K

bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

thd=0x6f405da0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Cannot determine thread, fp=0x1978f88, backtrace may not be correct.
Stack range sanity check OK, backtrace follows:
0x80f7893
0x6b4d96
0x82ab930
0x8158a17
0x82302c1
0x819f373
0x815d4e2
0x8105657
0x810868d
0x8103321
0x8102eb8
0x810280d
0x6afe51
0x51e06a
New value of fp=(nil) failed sanity check, terminating stack trace!
Please read http://www.mysql.com/doc/en/Using_stack_trace.html and 
follow instructions on how to resolve the stack trace. Resolved

stack trace is much more helpful in diagnosing the problem, so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...
thd-query at 0xa633050 = SHOW INNODB STATUS
thd-thread_id=6289685
The manual page at http://www.mysql.com/doc/en/Crashing.html contains
information that should help you find out what is causing the crash.
051214 19:09:08  InnoDB: Database was not shut down normally.
InnoDB: Starting recovery from log files...
InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 1 2404815205
InnoDB: Doing recovery: scanned up to log sequence number 1 2410057728
InnoDB: Doing recovery: scanned up to log sequence number 1 2415300608
InnoDB: Doing recovery: scanned up to log sequence number 1 2420543488
InnoDB: Doing recovery: scanned up to log sequence number 1 2425786368
InnoDB: Doing recovery: scanned up to log sequence number 1 2431029248
InnoDB: Doing recovery: scanned up to log sequence number 1 2436272128
InnoDB: Doing recovery: scanned up to log sequence number 1 2441515008
InnoDB: Doing recovery: scanned up to log sequence number 1 2446757888
InnoDB: Doing recovery: scanned up to log sequence number 1 2452000768
InnoDB: Doing recovery: scanned up to log sequence number 1 2457243648
InnoDB: Doing recovery: scanned up to log sequence number 1 2462486528
InnoDB: Doing recovery: scanned up to log sequence number 1 2463763843
051214 19:09:10  InnoDB: Starting an apply batch of log records to the 
database...
InnoDB: Progress in percents: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 
90 91 92 93 94 95 96 97 98 99

InnoDB: Apply batch completed
051214 19:09:17  InnoDB: Flushing modified pages from the buffer pool...
051214 19:09:18  InnoDB: Started
/var/lib/mysql/MySQL4.0.18/libexec/mysqld: ready for connections.
Version: '4.0.18-log'  socket: 
'/var/lib/mysql/MySQL4.0.18/var/mysql4.0.18.sock'  port: 3306

051215  8:40:46  /var/lib/mysql/MySQL4.0.18/libexec/mysqld: Normal shutdown

051215  8:40:47  InnoDB: Starting shutdown...
051215  8:40:50  InnoDB: Shutdown completed
051215  8:40:50  

Re: Problema with left join

2005-12-16 Thread serrano . neves

Hi,

I resolve my problem...

select count(p.products_id) as total from products_description pd, 
products p left join manufacturers m using (manufacturers_id), 
products_to_categories p2c left join specials s using (products_id) 
where p.products_status = '1' and p.products_id = p2c.products_id and 
pd.products_id = p2c.products_id and pd.language_id = '4' and 
p2c.categories_id = '16'


that`s ok :)

Thanks

Em 16/12/2005, às 11:40, Jigal van Hemert escreveu:


[EMAIL PROTECTED] wrote:
#1064 - You have an error in your SQL syntax; check the manual that 
corresponds to your MySQL server version for the right syntax to use 
near '.manufacturers_id = m.manufacturers_id )

 LEFT JOIN specials s
 USING ( p.produc' at line 4
What's the error in the query?!!?


USING ( list_of_column_names )
versus
ON  expression

AFAIK it would be:
USING (products_id)
or
ON p.products_id = s.products_id
etc.

Regards, Jigal.



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



Re: Problema with left join

2005-12-16 Thread Jigal van Hemert

[EMAIL PROTECTED] wrote:


Hi,

I resolve my problem...

select count(p.products_id) as total from products_description pd, 
products p left join manufacturers m using (manufacturers_id), 
products_to_categories p2c left join specials s using (products_id) 
where p.products_status = '1' and p.products_id = p2c.products_id and 
pd.products_id = p2c.products_id and pd.language_id = '4' and 
p2c.categories_id = '16'




Read:
http://dev.mysql.com/doc/refman/5.0/en/join.html
especially the part starting with: Before MySQL 5.0.12, the comma 
operator (,) and JOIN both had the same precedence (...).


It may be wiser to replace the comma-operator by an explicit JOIN to 
prevent any problems with precedence, using aliases before they are 
declared, etc.
This part of the manual explains the changes made in MySQL regarding the 
handling of joins in MySQL 5.


Regards, Jigal.


smime.p7s
Description: S/MIME Cryptographic Signature


Incorrect key file for table '%-.64s'

2005-12-16 Thread Daniel Martinez
Hello list,

After running my mysql server 4.1.14  with replication over some
months without any problem, suddenly the slave's sql thread crashes.

The error log says:
051215 17:29:49 [ERROR] Slave: Query caused different errors on master
and slave. Error on master: 'Incorrect key file for table '%-.64s';
try to repair it' (1034), Error on slave: 'no error' (0)

My question is... what is that %-.64s table? How can i fix?

Thanks in advance.
Daniel

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



Re: is there any BEEP command ?

2005-12-16 Thread Rhino
I've never noticed anything like a BEEP command in MySQL but I've never 
looked either :-)


If you don't find a facility like that in MySQL, may I suggest an 
alternative that will give you more than a mere Beep: it will play any .wav 
file you like.


I use Ant for most of my scripting needs. You may not be familiar with Ant 
so here is a link to its home page: http://ant.apache.org/. You can access 
the manual for the current version of Ant on this page. One of the many 
optional tasks within Ant is the 'sound' task. It is capable of playing one 
sound file if a script fails and a different one if a script succeeds. Or, 
if you like, it will choose one sound file at random from an entire 
directory if a script fails and one sound file from an entire directory if a 
script succeeds.


I've taken advantage of this to write a bit of common code that goes into 
all of my Ant scripts. The code identifies the directory that contains my 
'success' files and the directory that contains my 'failure' files. If the 
script succeeds, one of the files in the 'success' directory is played and 
if the script fails, one of the files in the 'fail' directory is played. 
Just for the fun of it, my 'success' and 'failure' files are all fragments 
from famous movies or TV programs. For instance, I have 'failure' files for 
the robot on Lost in Space saying That does not compute! or Homer Simpson 
saying D'oh! and I have similar 'success' files that have a more positive 
message.


Of course, this is approach is excessive if you really just want a Beep 
sound! My suggestion won't even be practical for you if you don't have a 
sound card in your computer.


However, if you do have a sound card and don't mind using it for something 
like this, you can use this approach to play an appropriate audio file 
whether the script succeeds or fails. You also get the huge added bonus of 
being able to use Ant for your scripts! And, depending on what sound files 
you select for your 'success' and 'failure' folders, you can entertain 
yourself and the others around you when your scripts run; one of my friends 
howled in laughter when he heard the sound file I played at the completion 
of one of my scripts. :-)


[Sorry for top-posting; I was going to intersperse my reply but my email 
client (Outlook Express) isn't marking your remarks with  the way it 
should.]


- Original Message - 
From: C.R.Vegelin [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Friday, December 16, 2005 9:23 AM
Subject: is there any BEEP command ?


I use various script files with queries to update a MySQL base periodically.
These scripts are run from the mysql line with the \. command.
I would like to have a BEEP command at the end of the script to get a signal 
that processing the script is finished. Looked in the manual, but couldn't 
find it. Does such a command exist ?

My version is 5.0.15 under Windows XP Pro.
Regards, Cor





No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/204 - Release Date: 15/12/2005



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/204 - Release Date: 15/12/2005


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



Re: GUI (linux X based or web based) for mysql

2005-12-16 Thread Greg Maruszeczka

Dotan Cohen wrote:

I keep a lot of personal information in a MySQL database. I have a few
querys premade for the wife to use, but we have gotten to the point
where we need a solution for her to be able to run her own queries.
She is NOT about to learn SQL, and myPHPadmin is a little too
compicated. I looked at an Access installation the other day and it
seemed to be just what we need- a GUI for non-programmers to use a
database. Is there any such beast for MySQL? Anthing that will run on
Fedora Core 4 would be great. Or even a web-based solution would be
fine- I do have apache on localhost.



Check out Open Office 2.0 and its Base app, available in windows and 
*nix versions. I think it can use MySQL through either ODBC or JDBC 
connectors, though I haven't played with it much (yet) to evaluate it.


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



Re: GUI (linux X based or web based) for mysql

2005-12-16 Thread Dotan Cohen
On 12/16/05, Greg Maruszeczka [EMAIL PROTECTED] wrote:
 Dotan Cohen wrote:
  I keep a lot of personal information in a MySQL database. I have a few
  querys premade for the wife to use, but we have gotten to the point
  where we need a solution for her to be able to run her own queries.
  She is NOT about to learn SQL, and myPHPadmin is a little too
  compicated. I looked at an Access installation the other day and it
  seemed to be just what we need- a GUI for non-programmers to use a
  database. Is there any such beast for MySQL? Anthing that will run on
  Fedora Core 4 would be great. Or even a web-based solution would be
  fine- I do have apache on localhost.
 

 Check out Open Office 2.0 and its Base app, available in windows and
 *nix versions. I think it can use MySQL through either ODBC or JDBC
 connectors, though I haven't played with it much (yet) to evaluate it.


Thanks, I will take a look at it. I thought that Base uses it's own
database backend- otherwise whoever wants to install a complete OO
package must then also install mysql. We already use OO apps (Writer
and Calc), so this is not a problem.

Dotan
http://technology-sleuth.com/technical_answer/what_are_the_advantages_of_lcd_monitors.html
:


Re: is there any BEEP command ?

2005-12-16 Thread Harrison Fisk

Hi,

On Dec 16, 2005, at 9:23 AM, C.R.Vegelin wrote:

I use various script files with queries to update a MySQL base  
periodically.

These scripts are run from the mysql line with the \. command.
I would like to have a BEEP command at the end of the script to get  
a signal that processing the script is finished. Looked in the  
manual, but couldn't find it. Does such a command exist ?

My version is 5.0.15 under Windows XP Pro.
Regards, Cor


While there is no beep command, you can possibly get it to beep by  
selecting the character code for a terminal beep (this is what the  
mysql client uses internally)


Try out:

SELECT char(7);

And see if it makes a beep for you.  It should if the mysql client  
can make the beep on a syntax error.


Regards,

Harrison

--
Harrison C. Fisk, Trainer and Consultant
MySQL AB, www.mysql.com

Get a jumpstart on MySQL Cluster -- http://www.mysql.com/consulting/ 
packaged/cluster.html




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



Re: is there any BEEP command ?

2005-12-16 Thread James Harvard
Well it works on Mac OS X!

While there is no beep command, you can possibly get it to beep by selecting 
the character code for a terminal beep (this is what the mysql client uses 
internally)

Try out:

SELECT char(7);

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



Re: is there any BEEP command ?

2005-12-16 Thread SGreen
Harrison Fisk [EMAIL PROTECTED] wrote on 12/16/2005 11:54:01 AM:

 Hi,
 
 On Dec 16, 2005, at 9:23 AM, C.R.Vegelin wrote:
 
  I use various script files with queries to update a MySQL base 
  periodically.
  These scripts are run from the mysql line with the \. command.
  I would like to have a BEEP command at the end of the script to get 
  a signal that processing the script is finished. Looked in the 
  manual, but couldn't find it. Does such a command exist ?
  My version is 5.0.15 under Windows XP Pro.
  Regards, Cor
 
 While there is no beep command, you can possibly get it to beep by 
 selecting the character code for a terminal beep (this is what the 
 mysql client uses internally)
 
 Try out:
 
 SELECT char(7);
 
 And see if it makes a beep for you.  It should if the mysql client 
 can make the beep on a syntax error.
 
 Regards,
 
 Harrison
 
 -- 
 Harrison C. Fisk, Trainer and Consultant
 MySQL AB, www.mysql.com
 
 Get a jumpstart on MySQL Cluster -- http://www.mysql.com/consulting/ 
 packaged/cluster.html
 

It worked for me! (win2K on 4.1.16 client). Great idea!

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Re: sequential id

2005-12-16 Thread Joseph Alotta

Greetings,

Thank you Dahl and Xiaobo.  Here it is working for all to see.  I  
particularly like that it doesn't try to use a key again once it is  
deleted.



Joe.




mysql use names;
Database changed
mysql create table people ( id mediumint unsigned not null  
auto_increment,

- first char(20),
- last char(20),
- primary key (id) );
Query OK, 0 rows affected (0.20 sec)

mysql describe people;
+---+---+--+-+- 
++
| Field | Type  | Null | Key | Default |  
Extra  |
+---+---+--+-+- 
++
| id| mediumint(8) unsigned |  | PRI | NULL|  
auto_increment |
| first | char(20)  | YES  | | NULL 
||
| last  | char(20)  | YES  | | NULL 
||
+---+---+--+-+- 
++

3 rows in set (0.02 sec)

mysql insert into people (first, last) values (john, smith);
Query OK, 1 row affected (0.00 sec)

mysql insert into people (first, last) values (bob, jones);
Query OK, 1 row affected (0.13 sec)

mysql insert into people (first, last) values (brad, pitt);
Query OK, 1 row affected (0.00 sec)

mysql select * from people;
++---+---+
| id | first | last  |
++---+---+
|  1 | john  | smith |
|  2 | bob   | jones |
|  3 | brad  | pitt  |
++---+---+
3 rows in set (0.02 sec)

mysql delete from people where last = 'smith';
Query OK, 1 row affected (0.00 sec)

mysql select * from people;
++---+---+
| id | first | last  |
++---+---+
|  2 | bob   | jones |
|  3 | brad  | pitt  |
++---+---+
2 rows in set (0.00 sec)

mysql insert into people (first, last) values (john, smith);
Query OK, 1 row affected (0.06 sec)

mysql select * from people;
++---+---+
| id | first | last  |
++---+---+
|  4 | john  | smith |
|  2 | bob   | jones |
|  3 | brad  | pitt  |
++---+---+
3 rows in set (0.21 sec)

mysql

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



Re: is there any BEEP command ?

2005-12-16 Thread Nestor
it work on xp :-)

On 12/16/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Harrison Fisk [EMAIL PROTECTED] wrote on 12/16/2005 11:54:01 AM:

  Hi,
 
  On Dec 16, 2005, at 9:23 AM, C.R.Vegelin wrote:
 
   I use various script files with queries to update a MySQL base
   periodically.
   These scripts are run from the mysql line with the \. command.
   I would like to have a BEEP command at the end of the script to get
   a signal that processing the script is finished. Looked in the
   manual, but couldn't find it. Does such a command exist ?
   My version is 5.0.15 under Windows XP Pro.
   Regards, Cor
 
  While there is no beep command, you can possibly get it to beep by
  selecting the character code for a terminal beep (this is what the
  mysql client uses internally)
 
  Try out:
 
  SELECT char(7);
 
  And see if it makes a beep for you.  It should if the mysql client
  can make the beep on a syntax error.
 
  Regards,
 
  Harrison
 
  --
  Harrison C. Fisk, Trainer and Consultant
  MySQL AB, www.mysql.com
 
  Get a jumpstart on MySQL Cluster -- http://www.mysql.com/consulting/
  packaged/cluster.html
 

 It worked for me! (win2K on 4.1.16 client). Great idea!

 Shawn Green
 Database Administrator
 Unimin Corporation - Spruce Pine


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



Re: is there any BEEP command ?

2005-12-16 Thread Rhino


- Original Message - 
From: Harrison Fisk [EMAIL PROTECTED]

To: C.R.Vegelin [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Friday, December 16, 2005 11:54 AM
Subject: Re: is there any BEEP command ?



Hi,

On Dec 16, 2005, at 9:23 AM, C.R.Vegelin wrote:

I use various script files with queries to update a MySQL base 
periodically.

These scripts are run from the mysql line with the \. command.
I would like to have a BEEP command at the end of the script to get  a 
signal that processing the script is finished. Looked in the  manual, but 
couldn't find it. Does such a command exist ?

My version is 5.0.15 under Windows XP Pro.
Regards, Cor


While there is no beep command, you can possibly get it to beep by 
selecting the character code for a terminal beep (this is what the  mysql 
client uses internally)


Try out:

SELECT char(7);

And see if it makes a beep for you.  It should if the mysql client  can 
make the beep on a syntax error.


This technique works in my Windows XP client (PuTTY) which is accessing our 
MySQL service on a remote Linux Mandrake server.


Rhino 




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.1/204 - Release Date: 15/12/2005


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



Can foreign keys reference tables in another database?

2005-12-16 Thread Scott Plumlee
I am trying to maintain one master list of countries and the states 
within those countries.  I'd like to keep this info in a common 
database, to be used by 2 or three other databases on the same host, 
using foreign keys to make sure that all the country/state data matches 
up to the master list.


If I can't use foreign keys, should I just run regular updates to sync 
the data between duplicate tables of countries and states in each 
database, or is there an better method that I'm not seeing?


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



Re: Can foreign keys reference tables in another database?

2005-12-16 Thread Scott Plumlee

sol beach wrote:

Why in the world are you trying to keep multiple copies of the data?

Why can't you just access the 'master database'?

On 12/16/05, Scott Plumlee [EMAIL PROTECTED] wrote:


I am trying to maintain one master list of countries and the states
within those countries.  I'd like to keep this info in a common
database, to be used by 2 or three other databases on the same host,
using foreign keys to make sure that all the country/state data matches
up to the master list.

If I can't use foreign keys, should I just run regular updates to sync
the data between duplicate tables of countries and states in each
database, or is there an better method that I'm not seeing?



Sorry, I didn't explain very well.

I have a db I'll call Common.  In there, I'd like to keep two tables, 
tblCountry and tblState.  Then I've got another database, called 
Application, with a table called tblAddress.


In the Application database, I'd like to reference tblCountry and 
tblStateProvince.  When someone fills out form info that is going to be 
stored in tblAddress, I want the choices to be pulled from tblCountry 
and tblStateProvince.


When I've done this inside only one database, I've always used foreign 
keys between the Address.State field and the tblState.State fields.


My goal IS to only keep one set of country and state data for multiple 
databases.  But I don't know if I can do that using foreign keys when 
things are in two different databases - it doesn't appear that I can.


So my question is am I better off NOT using foreign keys but doing 
everything else the same or using foreign keys and having to jerryrig 
some sort of syncing?



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



Re: Can foreign keys reference tables in another database?

2005-12-16 Thread JamesDR

Scott Plumlee wrote:

sol beach wrote:


Why in the world are you trying to keep multiple copies of the data?

Why can't you just access the 'master database'?

On 12/16/05, Scott Plumlee [EMAIL PROTECTED] wrote:


I am trying to maintain one master list of countries and the states
within those countries.  I'd like to keep this info in a common
database, to be used by 2 or three other databases on the same host,
using foreign keys to make sure that all the country/state data matches
up to the master list.

If I can't use foreign keys, should I just run regular updates to sync
the data between duplicate tables of countries and states in each
database, or is there an better method that I'm not seeing?



Sorry, I didn't explain very well.

I have a db I'll call Common.  In there, I'd like to keep two tables, 
tblCountry and tblState.  Then I've got another database, called 
Application, with a table called tblAddress.


In the Application database, I'd like to reference tblCountry and 
tblStateProvince.  When someone fills out form info that is going to be 
stored in tblAddress, I want the choices to be pulled from tblCountry 
and tblStateProvince.


When I've done this inside only one database, I've always used foreign 
keys between the Address.State field and the tblState.State fields.


My goal IS to only keep one set of country and state data for multiple 
databases.  But I don't know if I can do that using foreign keys when 
things are in two different databases - it doesn't appear that I can.


So my question is am I better off NOT using foreign keys but doing 
everything else the same or using foreign keys and having to jerryrig 
some sort of syncing?





If your app is just selecting data and inserting it into fields. Then 
have it do something like:

SELECT `ID`,`Stateabv` FROM `Common`.`states` ORDER BY `Stateabv`;

Fields, then when the user saves the data, the ID is written to the 
other DB, no syncing needed. I've done something like this in another 
app. I'm not sure how foreign keys will work (if they will) but I 
*think* you can do a join on this -- tho now we are beyond the scope of 
my knowledge :-D



--
Thanks,
James


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



Best way to search all columns for any occurance of criteria

2005-12-16 Thread Dave Ariens
I've got a table on a mysql server (4.1.10a-nt) that I want to query 
against some search criteria.  The table contains approx. 9, 000 
records, and will eventually grow to hundreds of thousands.


Here are the fields in the table...

id int(unsigned) auto_increment
firstName varchar(30)
lastName varchar(30)
email varchar(75)
campus varchar(75)
year varchar(4)

When the user enters search criteria I want all records where there is 
an identical match within any portion of the field.


i.e.

Searching for 'ave' returns all firstName's (dave), lastName's 
(Shaverson), email's ([EMAIL PROTECTED]), etc...


Here's some php code to illustrate how I've implemented it...

if (strlen($searchCriteria)  0)
{
   $searchClause =  AND (;
   $searchClause.= firstName LIKE '%.$searchCriteria.%' OR ;
   $searchClause.= lastName LIKE '%.$searchCriteria.%' OR ;
   $searchClause.= email LIKE '%.$searchCriteria.%' OR ;
   $searchClause.= CONCAT(firstName, ' ', lastName) LIKE 
'%.$searchCriteria.%' OR ;

   $searchClause.= campus LIKE '%.$searchCriteria.%' OR ;
   $searchClause.= year LIKE '%.$searchCriteria.%' OR ;
   $searchClause.= email LIKE '%.$searchCriteria.%'); 
}


Now let's say the user enters 'ave 2004'.  In my applications current 
state, no records are returned because none of the records have ave 
2004 anywhere. I'd prefer to have each word treated seperately, as well 
as a full phrase.  Such that only records that contain 'ave' somewhere 
in any of the 5 varchar fields, *AND* '2004' somewhere in any of the 5 
varchar fields are returned. For instance, all Dave's and Shaversons 
who's year is 2004, or whose email address is [EMAIL PROTECTED] (for 
example).


Full text searches will allow me to do this, however I'd prefer to be 
able to query against even a single character, and I'm not sure what's 
the most efficient method.  Should I use something like


#Check against occurances of the full string first...

$searchClause =  AND (;

$searchClause.= firstName LIKE '%.$searchCriteria.%' OR ;
$searchClause.= lastName LIKE '%.$searchCriteria.%' OR ;
$searchClause.= email LIKE '%.$searchCriteria.%' OR ;
$searchClause.= CONCAT(firstName, ' ', lastName) LIKE 
'%.$searchCriteria.%' OR ;

$searchClause.= campus LIKE '%.$searchCriteria.%' OR ;
$searchClause.= year LIKE '%.$searchCriteria.%' OR ;
$searchClause.= email LIKE '%.$searchCriteria.%';


//Now again for each individual word in the search criteria.

$criteriaArray = split( , $searchCriteria);
foreach ($cirteriaArray as $searchKeyword)
{
   $searchClause.= OR firstName LIKE '%.$searchKeyword.%' ;
   $searchClause.= OR lastName LIKE '%.$searchKeyword.%' ;
   $searchClause.= OR email LIKE '%.$searchKeyword.%' ;
   $searchClause.= OR CONCAT(firstName, ' ', lastName) LIKE 
'%.$searchKeyword.%' ;

   $searchClause.= OR campus LIKE '%.$searchKeyword.%' ;
   $searchClause.= OR year LIKE '%.$searchKeyword.%' ;
   $searchClause.= OR email LIKE '%.$searchKeyword.%';
}


$searchClause.= );

The results table is paginated, sortable, and pulled via Javascript 
XmlHttpRequest.  The search textbox is right above the table and the 
results (number of pages, prev/next page buttons, total # records, 
etc..) are all updated for every character added to the search text box.


With almost 10, 000 records, displaying 25 per page is *INCREDIBLY* 
fast.  And because it's all AJAX it needs to be. 

My question is, should I use fulltext searches, or the above illustrated 
method that'll generate one helluva long ass query string?



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



Report tool - Mysql

2005-12-16 Thread Darryl Hoar
Greetings,
I need to get a tool to create reports using mysql databases.  It would be
great if the resultant reports could be run by themselves (not inside the
report development environment).

Anybody have any recommendations ?

thanks,
Darryl


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



Re: Can foreign keys reference tables in another database?

2005-12-16 Thread Eric Grau

JamesDR wrote:


Scott Plumlee wrote:


sol beach wrote:


Why in the world are you trying to keep multiple copies of the data?

Why can't you just access the 'master database'?

On 12/16/05, Scott Plumlee [EMAIL PROTECTED] wrote:


I am trying to maintain one master list of countries and the states
within those countries.  I'd like to keep this info in a common
database, to be used by 2 or three other databases on the same host,
using foreign keys to make sure that all the country/state data 
matches

up to the master list.

If I can't use foreign keys, should I just run regular updates to sync
the data between duplicate tables of countries and states in each
database, or is there an better method that I'm not seeing?



Sorry, I didn't explain very well.

I have a db I'll call Common.  In there, I'd like to keep two tables, 
tblCountry and tblState.  Then I've got another database, called 
Application, with a table called tblAddress.


In the Application database, I'd like to reference tblCountry and 
tblStateProvince.  When someone fills out form info that is going to 
be stored in tblAddress, I want the choices to be pulled from 
tblCountry and tblStateProvince.


When I've done this inside only one database, I've always used 
foreign keys between the Address.State field and the tblState.State 
fields.


My goal IS to only keep one set of country and state data for 
multiple databases.  But I don't know if I can do that using foreign 
keys when things are in two different databases - it doesn't appear 
that I can.


So my question is am I better off NOT using foreign keys but doing 
everything else the same or using foreign keys and having to jerryrig 
some sort of syncing?





If your app is just selecting data and inserting it into fields. Then 
have it do something like:

SELECT `ID`,`Stateabv` FROM `Common`.`states` ORDER BY `Stateabv`;

Fields, then when the user saves the data, the ID is written to the 
other DB, no syncing needed. I've done something like this in another 
app. I'm not sure how foreign keys will work (if they will) but I 
*think* you can do a join on this -- tho now we are beyond the scope 
of my knowledge :-D





I just did a quick test on my database server and it looks like you can 
have a foreign key that references tables in another database.


Using your example databases and tables, you can create the foreign key 
by specifying the database name in the REFERENCES clause like this:

ALTER TABLE Application.tblAddress
ADD FOREIGN KEY (State) REFERENCES *Common*.tblState (State);

Eric



RE: Report tool - Mysql

2005-12-16 Thread Jimmy Guerrero
Hello,

Depending the level of sophistication you require, you might want to take a
look at:

- JasperSoft (Open Source)
- Crystal Reports
- If you're running Microsoft Reporting Services somewhere in your shop, I
think you can use it to plug into any JDBC compliant DB, but I might be
wrong.

If it's reports/documentation about your DB you are after you might want to
check out Embarcadero's ERStudio, which is imho the best ERD tool on the
market.

Thanks,

Jimmy Guerrero, Senior Product Manager
MySQL Inc, www.mysql.com
Houston, TX USA




-Original Message-
From: Darryl Hoar [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 16, 2005 2:59 PM
To: mysql@lists.mysql.com
Subject: Report tool - Mysql


Greetings,
I need to get a tool to create reports using mysql databases.  It would be
great if the resultant reports could be run by themselves (not inside the
report development environment).

Anybody have any recommendations ?

thanks,
Darryl


-- 
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: Can foreign keys reference tables in another database?

2005-12-16 Thread Eric Grau

Eric Grau wrote:


JamesDR wrote:


Scott Plumlee wrote:


sol beach wrote:


Why in the world are you trying to keep multiple copies of the data?

Why can't you just access the 'master database'?

On 12/16/05, Scott Plumlee [EMAIL PROTECTED] wrote:


I am trying to maintain one master list of countries and the states
within those countries.  I'd like to keep this info in a common
database, to be used by 2 or three other databases on the same host,
using foreign keys to make sure that all the country/state data 
matches

up to the master list.

If I can't use foreign keys, should I just run regular updates to 
sync

the data between duplicate tables of countries and states in each
database, or is there an better method that I'm not seeing?



Sorry, I didn't explain very well.

I have a db I'll call Common.  In there, I'd like to keep two 
tables, tblCountry and tblState.  Then I've got another database, 
called Application, with a table called tblAddress.


In the Application database, I'd like to reference tblCountry and 
tblStateProvince.  When someone fills out form info that is going to 
be stored in tblAddress, I want the choices to be pulled from 
tblCountry and tblStateProvince.


When I've done this inside only one database, I've always used 
foreign keys between the Address.State field and the tblState.State 
fields.


My goal IS to only keep one set of country and state data for 
multiple databases.  But I don't know if I can do that using foreign 
keys when things are in two different databases - it doesn't appear 
that I can.


So my question is am I better off NOT using foreign keys but doing 
everything else the same or using foreign keys and having to 
jerryrig some sort of syncing?





If your app is just selecting data and inserting it into fields. Then 
have it do something like:

SELECT `ID`,`Stateabv` FROM `Common`.`states` ORDER BY `Stateabv`;

Fields, then when the user saves the data, the ID is written to the 
other DB, no syncing needed. I've done something like this in another 
app. I'm not sure how foreign keys will work (if they will) but I 
*think* you can do a join on this -- tho now we are beyond the scope 
of my knowledge :-D





I just did a quick test on my database server and it looks like you 
can have a foreign key that references tables in another database.


Using your example databases and tables, you can create the foreign 
key by specifying the database name in the REFERENCES clause like this:

ALTER TABLE Application.tblAddress
ADD FOREIGN KEY (State) REFERENCES *Common*.tblState (State);

Eric




Of course without the *.  I was trying to make it bold and didn't 
realize the mailing list would add them.


Hope this helps,
Eric


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



Merging two tables

2005-12-16 Thread Scott Haneda
I need to do this just once...

I have table zip_codes and table hardiness_zones
In this case, the key will be the actual zip codes.

hardiness_zones has two fields, zone_start and zone_end, these are all empty
in the zip_codes table.  I just need to move the data over, where the zip
codes are ==.

4.0.18-standard-log

UPDATE zip_codes, hardiness_zones
SET zip_codes.zone_start=hardiness_zones.zone_start,
zip_codes.zone_end=hardiness_zones.zone_end;

Is that correct, and how can I test this before I do the real thing, aside
from working on a copy of the table, is there something where I can run it
and have it not really do anything, kinda like EXPLAIN, but not exactly.
-- 
-
Scott HanedaTel: 415.898.2602
http://www.newgeo.com Novato, CA U.S.A.



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



Re: Merging two tables

2005-12-16 Thread SGreen
Scott Haneda [EMAIL PROTECTED] wrote on 12/16/2005 08:46:29 PM:

 I need to do this just once...
 
 I have table zip_codes and table hardiness_zones
 In this case, the key will be the actual zip codes.
 
 hardiness_zones has two fields, zone_start and zone_end, these are all 
empty
 in the zip_codes table.  I just need to move the data over, where the 
zip
 codes are ==.
 
 4.0.18-standard-log
 
 UPDATE zip_codes, hardiness_zones
 SET zip_codes.zone_start=hardiness_zones.zone_start,
 zip_codes.zone_end=hardiness_zones.zone_end;
 
 Is that correct, and how can I test this before I do the real thing, 
aside
 from working on a copy of the table, is there something where I can run 
it
 and have it not really do anything, kinda like EXPLAIN, but not exactly.
 -- 
 -
 Scott HanedaTel: 415.898.2602
 http://www.newgeo.com Novato, CA U.S.A.
 
 

When joining tables, you need to specify the conditions on which the two 
tables are supposed to match. If you do not, you get a Cartesian product 
of the two tables. I don't see your matching condition. Here is how I 
would write it (using an explicit JOIN)

UPDATE zip_codes zc
INNER JOIN hardiness_zones hz
  ON  hz.zip_code = zc.zipcode
SET zc.zone_start = hz.zone_start
  ,zc.zone_end = hz.zone_end;

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine




Error 1013

2005-12-16 Thread Karl Krelove
I'm trying to import a large amount of data from an Access database containing 
information about 9,000+ students in a school system. I've created a table 
'student_list' to hold the data and issued the following command:

LOAD DATA INFILE 'home/karl/Student_List.csv' into table student_list FIELDS 
TERMINATED BY ',' ENCLOSED BY '' LINES TERMINATED BY '\n';

In response I get: ERROR 13 (HY000): Can't get stat of 
'/var/lib/mysql/home/karl/Student_List.csv' (Errcode: 2)

I've looked up the error on the MySQL website and found the error listed as 
Error 1013 in the listing of server errors for MySQL 4.1, but I can't find an 
explanation.

1st question - the obvious one - does anyone know what is triggering the 
error?

2nd question - why does MySQL only list the errors? I could already read what 
it said in the CLI client. Is there a place on the web site that actually 
explains what specific errors mean?

Thanks in advance for any input.

Karl Krelove

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



Re: Transactions (not rolling back on error)

2005-12-16 Thread Cory @ SkyVantage
I think it might have something to do with the fact that I'm running the 
NDB engine.   I'm not sure...  It doesn't seem to have the same problem 
on Inno  (another transaction-safe engine)


I think I need to send MySQL some info so they can try to duplicate it.

I'm wondering if anyone else running cluster has had any issues with 
transactions???   Anyone? I'd _really_ like to get this working 
since my work-around is in my web application until I can get it working...


Good to see you on this list too James!  :)

Cory.

James Harvard wrote:


Hi Cory - nice to see a fellow Lasso user here!

I've not use transactions myself but I think you might be having a problem with 
autocommit.
http://dev.mysql.com/doc/refman/5.0/en/commit.html

HTH,
James Harvard

At 12:44 am -0700 15/12/05, Cory @ SkyVantage wrote:
 


I have a transaction that is very simple, I need to create records in multiple 
tables that are related.  If any one insert statement fails or throws an error 
I want to rollback the ENTIRE transaction.

I thought that this was the default functionality, but apparently that's not 
the case here.

I'm running MySQL-Cluster 5.0.something.
   



 




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