expanding hierarchies

2007-05-23 Thread tbt
> Hi > > i have a table like this > > id nameparent_id > 1 europe > 2 spain 1 > 3 england 1 > 4 france 1 > 5 london 3 > 6 mayfair 5 > 7 madrid 2 > > in this table each destination is mapped to a parent destination

Grants for mysqldump

2007-05-23 Thread Anand kumar
Hi i am using mysql-4.1.3-beta version in mysq server my concern is that i want to create a user (minimal grant) that should able to take backup using mysqldump ...can any one help me out .. i tried giving the following grants but it is not works grant file,SHOW DATABASES,select,lock tables on *.

Re: How to rewrite SQL query for new MySQL LEFT JOINS

2007-05-23 Thread Gmail User
It worked in 4.x but does not work in the new syntax. How should I rewrite it to get the same result? OK, that was a lie. It works in 5.x as well. I should learn to describe my problem more accurately as well as RTFM :-( The correct description of the query in question would have been: select

Re: Grants for mysqlbackup

2007-05-23 Thread Anand kumar
Hi i am using mysql-4.1.3-beta version in mysq server my concern is that i want to create a user(minimal grant) that should able to take backup using mysqldump ...can any one help me out .. i tried giving the following grants but it is not works grant file,SHOW DATABASES,select,lock tables on *.*

Re: A question about how to debug the error "2013, 'Lost connection to MySQL server during query'"

2007-05-23 Thread Sebastian Mendel
[EMAIL PROTECTED] schrieb: > I am running the 64 bit version of mysql server 5.1.18, and on the > client side I am running python with the mysqldb module. While > running a very large insert query I get the following error : > > 2013, 'Lost connection to MySQL server during query' > > I have --l

Grants for mysqlbackup

2007-05-23 Thread Anand kumar
Hi i am using mysql-4.1.3-beta version in mysq server my concern is that i want to create a user(minimal grant) that should able to take backup using mysqldump ... can any one help me out .. i tried giving the following grants but it is not works grant file,SHOW DATABASES,select,lock tables on *.

Minimal grants for backup

2007-05-23 Thread Anand kumar
Hi i am using mysql-4.1.3-beta version in mysq server my concern is that i want to create a user that should able to take backup using mysqldump ... can any one help me out .. i tried giving the following grants but it is not works grant file,SHOW DATABASES,select,lock tables on *.* to [EMAIL P

How to rewrite SQL query for new MySQL LEFT JOINS

2007-05-23 Thread Gmail User
I hope someone can clue me in what a syntax of query that produces the same would look like for MySQL > 5.0.12 Old query meant to list most recent message from each thread, e.g. select * from messages left join messages as messages_ on messages.thread = messages_.thread and messages.created < me

Re: Upgraded to 5.0.x from 4.1.x and ORDER BY sucks!

2007-05-23 Thread Gmail User
mysqlcheck -h$host -u$user -p$pass --analyze $dbname I wish that was the case! I tried analyze table ... and optimize table ..., which I presume would be the same. It did not help. I also ran mysqlcheck just to see if it will make a difference. Nope! -- MySQL General Mailing List For list arch

Re: Replicating an existing table

2007-05-23 Thread Brent Baisley
create table x like y Creates an exact copy of the table without the data, indexes are included. - Original Message - From: "J Trahair" <[EMAIL PROTECTED]> To: "MySQL General" Sent: Wednesday, May 23, 2007 3:58 PM Subject: Replicating an existing table Hi Everyone Is there a way of

Re: Replicating an existing table

2007-05-23 Thread Michael Dykman
http://dev.mysql.com/doc/refman/5.0/en/create-table.html under MySQL 5.0 you can do this: CREATE TABLE mynewtable LIKE theotherone; -- this will copy the structure as well as add idexes identical to the plan in the original under any earlier 4.x version, this will work too CREATE TABLE mynewtab

Replicating an existing table

2007-05-23 Thread J Trahair
Hi Everyone Is there a way of replicating or cloning the structure of an existing table and giving it a different name? I have a table of items on sale in the shops, I want to create a table of items not yet in the shops but due to be introduced very soon. MySQL 5.0.37 Windows XP. Thanks in a

Re: Help with Migration/Foreign Key

2007-05-23 Thread Baron Schwartz
Hi Chris, Chris Hoover wrote: Here is the error from the show innodb status: 070523 15:39:39 Error in foreign key constraint of table mysql/#sql-d70_22: FOREIGN KEY (tab_id, class) REFERENCES system_tabs(tab_id, class): Cannot find an index in the referenced table where the referenced colum

Re: Help with Migration/Foreign Key

2007-05-23 Thread Chris Hoover
Here is the error from the show innodb status: 070523 15:39:39 Error in foreign key constraint of table mysql/#sql-d70_22: FOREIGN KEY (tab_id, class) REFERENCES system_tabs(tab_id, class): Cannot find an index in the referenced table where the referenced columns appear as the first columns,

Re: Help with Migration/Foreign Key

2007-05-23 Thread Baron Schwartz
Hi Chris, Chris Hoover wrote: I need some help. I am under presure from management to migrate and existing Sybase ASA database to Mysql for a proof of concept. I have done most of the work, but am having an issue creating a foreign key. I keep getting the "Can't create table './mysqk/#sql-d70

Help with Migration/Foreign Key

2007-05-23 Thread Chris Hoover
I need some help. I am under presure from management to migrate and existing Sybase ASA database to Mysql for a proof of concept. I have done most of the work, but am having an issue creating a foreign key. I keep getting the "Can't create table './mysqk/#sql-d70_1f.frm' (errno: 150)" error. I

A question about how to debug the error "2013, 'Lost connection to MySQL server during query'"

2007-05-23 Thread aiton
I am running the 64 bit version of mysql server 5.1.18, and on the client side I am running python with the mysqldb module. While running a very large insert query I get the following error : 2013, 'Lost connection to MySQL server during query' I have --log-warnings set to 3, but I get no corres

Re: design choice - quite many tables

2007-05-23 Thread Wm Mussatto
On Tue, May 22, 2007 23:29, Przemysław Klein said: > Martijn Tonies wrote: >> Hi, >> >> >>> I'm working on quite big database. It consists of about 200 tables. >>> Additionaly about 50 tables are per year (because of annual data). It >>> means every year new 50 tables will have to appear in applic

Re: corruption in db. myisam bad? innodb good?

2007-05-23 Thread Brent Baisley
You would need to find out the reason for the crash to prevent or minimize it. The reason may be external to mysql. Innodb can get really, really slow when tables get physically large if you don't have a similar amount of RAM. MyISAM doesn't support transactions, so no, that wouldn't help. If y

Re: Confusing backslash issues with LIKE

2007-05-23 Thread Yves Goergen
On 23.05.2007 14:49 CE(S)T, Yves Goergen wrote: > [1] > http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html#operator_like Never mind. This very page says why it is like it is. It's definitely too hot in here today. :( -- Yves Goergen "LonelyPixel" <[EMAIL PROTECTED]> Visit my

Re: Database design

2007-05-23 Thread Brent Baisley
Normalization is about using ids to minimize change, which also eliminates repetition. It's fine to have the color "red" repeated throughout your table as long as it will never change. But if you suddenly have two shades of red, you'll need to update all the records that say "red". If you used id

TCPWrappers and database unavailibility

2007-05-23 Thread Tuc at T-B-O-H.NET
Hi, Running 4.1.22 created from FreeBSD ports on FreeBSD 5.5 . I run under TCP Wrappers. Even if 1 foreign machine attempts to contact us on the tcp port, the database becomes incredibly sluggish or unresponsive. phpmyadmin shows " MySQL said: #2003 - The server is not

geometry columns and srid

2007-05-23 Thread Kralidis,Tom [Burlington]
Hi, I have tables to which the mysqlgisimport tool is used to upload spatial data. The current situation is that these tables have geomety but without an srid definition. How does mysqlgisimpoprt work w.r.t. srid? When trying 'select srid(geo) from foo', the value returned is 0, as opposed to

Re: Help on selecting a View with 3 Billions rows !

2007-05-23 Thread Brent Baisley
You can using any language to automate it, a scripting language would probably be the easiest (php, perl, ruby, python, shell, etc). The table type doesn't matter too much. Although if the tables are static, I would use MyISAM. Spatial indexes come across as more for use in geometry, rather th

Re: Help on selecting a View with 3 Billions rows !

2007-05-23 Thread Chris Prakoso
Brent, Thanks for the reply. I knew that MySQL has spatial index, although reading it quickly, I wasn't sure that this is for me. But maybe I'll read it again in more details. On your second suggestion, i.e. to do INSERT a bit at a time, how can I automate this ? Also, does it matter if the

Re: Database design

2007-05-23 Thread John Meyer
Officelink wrote: > Hi everyone, > > I¹m trying to set up a database with information that will be used in a > garment slideshow in flash. > > The information to be included as part of the slideshow would be: > code, optional title, description, colours, sizes, garment image, fabric > swatch image

mysqldump - IF NOT EXISTS

2007-05-23 Thread Johannes Skov Frandsen
Hi Im contructing a build script and would like to dump my dev db with mysqldump so I can run a deploy script on the production server with the update db. I would like to construct the script so that it updates existing tables/fields/posts and add new tables/fields/post if they do not exists. My

Confusing backslash issues with LIKE

2007-05-23 Thread Yves Goergen
Hello, I'm having some trouble with the LIKE operator on MySQL 5.0. Here's my transcript: mysql> select 'abc\\def'; +-+ | abc\def | +-+ | abc\def | +-+ 1 row in set (0.00 sec) mysql> select 'abc\\def' like '%\\%'; ++ | 'abc\\def' like '%\\%' | +---

Database design

2007-05-23 Thread Officelink
Hi everyone, I¹m trying to set up a database with information that will be used in a garment slideshow in flash. The information to be included as part of the slideshow would be: code, optional title, description, colours, sizes, garment image, fabric swatch image Each clothing item to be includ

Re: Help on selecting a View with 3 Billions rows !

2007-05-23 Thread Brent Baisley
I think what you want to do is look into creating a spacial index on the raw data. Then just searching on that index will allow you to judge distances between things. You won't need to create a table with every single possible combination. There are quite a few examples in the manual and online.

Re: mysqldump running out out of memory

2007-05-23 Thread fredrik
> Fredrik Carlsson: >> >> Hi, >> >> Yes I'm using the -q option with mysqldump, but the result is the same. >> >> This is a replicated environment and the master is running FreeBSD and >> the slave NetBSD and on the master which only has InnoDB tables there >> is no problems to run a dump but the m