Re: Help with formatting of 1:n relationship

2009-01-27 Thread Claudio Nanni
I think what you are looking for is something like this: - SELECT CONCAT(A.FIELD1,',',GROUP_CONCAT(B.FIELD2)) FROM TABLE1 A LEFT JOIN TABLE2 B ON A.ID=B.ID_TABLE1

Re: Help with formatting of 1:n relationship

2009-01-27 Thread Walter Heck
I don't think so unfortunately. He says in his first mail: I'm using an excel library that accepts a SELECT as input and generates an XLS file with the records as output. So, probably csv is not going to help him, which is a shame :) Walter OlinData: Professional services for MySQL Support

UPDATE ... where max(datecolumn)

2009-01-27 Thread Adria Stembridge
I have a table like this: ID PRODUCT DATEORDERED 152005-02-18 222008-03-13 322008-11-21 462009-01-21 A field has been added for current order to this table: ID PRODUCT DATEORDERED FLAGCURRENT I need to update

Broken Database issue - tables vanishing

2009-01-27 Thread revDAVE
Newbie question Something - or maybe me is breaking my database. this happened before with the same DB - so,using phpMyAdmin, I just rebuilt the structure again and all was fine for a few minutes - then I created a basic user with Privileges for the db and within a few minutes the DB broke

Autoconf --basedir

2009-01-27 Thread Alex Katebi
Anyone knows how to figure out the mysql basedir string using Autoconf and then pass it to Automake for an embedded application? Thanks in advance, -Alex

Mysqld fails to start

2009-01-27 Thread JD
Hello List, mysqld fails to start, and emits the following error messages in /var/log/mysqld.log 090127 10:00:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql /usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist 090127 10:00:30 [ERROR] Can't open the mysql.plugin

Re: Mysqld fails to start

2009-01-27 Thread Baron Schwartz
Hello JD, You need to look beyond the first error messages: /usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist 090127 10:00:30 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. but keep reading: 090127 10:00:30 InnoDB: Operating system error number 13

Re: Mysqld fails to start

2009-01-27 Thread Andy Shellam
Hi JD, I believe the error about mysql.plugin is a red herring - it needs fixing, but it's not the reason MySQL isn't starting. The second error is the one about InnoDB not having access rights to the directory. Check that /var/lib/mysql is writeable by the MySQL user (usually MySQL.)

Re: Mysqld fails to start

2009-01-27 Thread Mark Goodge
JD wrote: Hello List, mysqld fails to start, and emits the following error messages in /var/log/mysqld.log 090127 10:00:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql /usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist 090127 10:00:30 [ERROR] Can't open the

Re: Mysqld fails to start

2009-01-27 Thread JD
I am running as root. I dont understand what rights or permissions mysqld needs beyond those of root. Also, ./ibdata1 is relative to what path? I get this message no matter what dir is my current working dir. I searched in my home dir and in /root home dir. There is no such file or directory

Re: Mysqld fails to start

2009-01-27 Thread JD
Deamon runs as root. ls -ld /var/lib/mysql/ drwxr-xr-x 5 mysql mysql 4096 2009-01-27 10:00 /var/lib/mysql/ So what other perms does root need? Andy Shellam wrote: Hi JD, I believe the error about mysql.plugin is a red herring - it needs fixing, but it's not the reason MySQL isn't

Re: Mysqld fails to start

2009-01-27 Thread Claudio Nanni
JD, please post the ouput from: ls -altr /var/lib/mysql thanks Claudio JD wrote: Deamon runs as root. ls -ld /var/lib/mysql/ drwxr-xr-x 5 mysql mysql 4096 2009-01-27 10:00 /var/lib/mysql/ So what other perms does root need? Andy Shellam wrote: Hi JD, I believe the error about

Help with a query.

2009-01-27 Thread Micah Stevens
Hi, I'm somewhat stumped by how to set up a single query that does the following. Currently I'm accomplishing this through multiple queries and some PHP 'glue' logic, but it should be possible in a single query I think, and it's bugging me that I can't figure it out. If anyone has any ideas,

Setting the value for the EDITOR variable

2009-01-27 Thread Xristos Karvouneas
Dear All, I would like to be able to do that from the cnf file, as I want to have a different editor for MySQL commands than the one I use when writing shell scripts. When I put the following in the .my.cnf file, [shell] EDITOR=/usr/local/bin/pico export EDITOR I get no error messages when

Re: Mysqld fails to start

2009-01-27 Thread JD
ls -altr /var/lib/mysql total 20548K drwxr-xr-x 2 mysql mysql 4096 2007-12-15 15:36 test/ -rw-r--r-- 1 mysql mysql 5242880 2007-12-15 15:36 ib_logfile1 drwxr-xr-x 2 mysql mysql 4096 2007-12-15 16:10 ampache/ -rw-r--r-- 1 mysql mysql 10485760 2007-12-17 00:03 ibdata1 drwxr-xr-x 2

Re: Help with a query.

2009-01-27 Thread Peter Brawley
Micah, each item in `a` has a 1 to 1 relationship to `b`, and each item in `c` has a 1 to 1 relationship with `b`. Sometimes these correspond, i.e. there's a row in `b` that relates to both `a` and `c`, but not always. So in a given b row, the b_id value might match an a.a_id, a c.a_id, or

Re: Mysqld fails to start

2009-01-27 Thread Walter Heck
Ah, try this: chmod ug+rw ibdata1 and the same for your iblogfile0 and iblogfile1 files.. Walter OlinData: Professional services for MySQL Support * Consulting * Administration http://www.olindata.com On Wed, Jan 28, 2009 at 12:48 AM, JD jd1...@gmail.com wrote: ls -altr /var/lib/mysql --

Re: Setting the value for the EDITOR variable

2009-01-27 Thread Paul DuBois
On Jan 27, 2009, at 5:44 PM, Xristos Karvouneas wrote: Dear All, I would like to be able to do that from the cnf file, as I want to have a different editor for MySQL commands than the one I use when writing shell scripts. When I put the following in the .my.cnf file, [shell]

Re: Mysqld fails to start

2009-01-27 Thread Claudio Nanni
Hi JD, just try a simple thing, rm /var/lib/mysql/ib_logfile1 rm /var/lib/mysql/ib_logfile2 to remove the innodb log files, sometimes you can have this problems, did you copy the database between servers? where are the .pid and .err files? Claudio 2009/1/28 JD jd1...@gmail.com ls -altr

Re: Mysqld fails to start

2009-01-27 Thread JD
I did the chmod. Then # ls -latrR /var/lib/mysql /var/lib/mysql: total 20548K drwxrwxr-x 2 mysql mysql 4096 2007-12-15 15:36 test/ -rw-rw-r-- 1 mysql mysql 5242880 2007-12-15 15:36 ib_logfile1 drwxrwxr-x 2 mysql mysql 4096 2007-12-15 16:10 ampache/ drwxrwxr-x 2 mysql mysql 4096

Re: Mysqld fails to start

2009-01-27 Thread JD
I stopped mysqld. I removed those logfiles I did not copy any databe between servers. I only have one machine. I would not even know what to copy, as I know nothing about databases. I have no idea where the .pid and the .err files came from. I restarted the daemon, and this is what it wrote into

Re: Help with a query.

2009-01-27 Thread Micah Stevens
Peter Brawley wrote: Micah, each item in `a` has a 1 to 1 relationship to `b`, and each item in `c` has a 1 to 1 relationship with `b`. Sometimes these correspond, i.e. there's a row in `b` that relates to both `a` and `c`, but not always. So in a given b row, the b_id value might match an

Re: Mysqld fails to start

2009-01-27 Thread JD
OK, I located a weblog on how to change the password and it worked. I then stopped and started the serever, and this is what it belched out in the mysqld.log: 090127 18:17:16 [Note] /usr/libexec/mysqld: Normal shutdown 090127 18:17:16 InnoDB: Starting shutdown... 090127 18:17:17 InnoDB:

Re: Mysqld fails to start

2009-01-27 Thread Walter Heck
mysql.user is a table name, it is in the form of database_name.table_name. Mysql has a system database conveniently called mysql :) 090127 18:17:18 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50045, now running 50130. Please use mysql_upgrade to fix

Re: Mysqld fails to start

2009-01-27 Thread JD
Problem with yum remove mysql is that it will also remove all it's dependents, whereas yum install mysql will not restore the dependents. Also, you are probably right re: 5.0.x and 5.1.x At anywho, I ran: }# mysql_upgrade --user=root --password='theNewPassword' Looking for 'mysql' as: mysql

Re: Mysqld fails to start

2009-01-27 Thread Walter Heck
Actually, just restarting the server should do the trick. It seems like mysql_upgrade did it's job correctly. Can you restart teh server and check the logs? Walter OlinData: Professional services for MySQL Support * Consulting * Administration http://www.olindata.com On Wed, Jan 28, 2009 at

Re: Mysqld fails to start

2009-01-27 Thread JD
Hey... Thanks a *LOT Walter!!!* *It WORKED!!!* The mysqld.log file now says: 090127 19:16:10 [Note] /usr/libexec/mysqld: Normal shutdown 090127 19:16:10 InnoDB: Starting shutdown... 090127 19:16:10 InnoDB: Shutdown completed; log sequence number 0 44044 090127 19:16:10 [Note]

Are dates stored as String? Or Integer?

2009-01-27 Thread mos
Are date columns stored as String or Integer in a MyISAM table? I am trying to squeeze more speed from my application and a date column is used in most of the indexes for my tables. I'm wondering if changing the Date data type to an Integer is going to speed the queries up. I'm using Delphi

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread Michael Dykman
Absolutely, there is a significant speed benefit from using appropriate date/timestamp will speed up your lookups. They are stored not as ints per-se but are binary encoded in a similar manner. Read this carefully before before you undertake any conversions.

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread mos
At 11:43 PM 1/27/2009, Michael Dykman wrote: Absolutely, there is a significant speed benefit from using appropriate date/timestamp will speed up your lookups. They are stored not as ints per-se but are binary encoded in a similar manner. Read this carefully before before you undertake any

Re: Are dates stored as String? Or Integer?

2009-01-27 Thread Michael Dykman
For the DATE type, the comparisons are performed aginst raw binary data as an integer would be. I read your first post too hastily and thought you were proposigng to store dates as string. (don't laugh, I have seen this done by people who should know better). I don't think you are going to

Performances between different filesystems

2009-01-27 Thread Sebastien MORETTI
Hello, I look for updated performances between different file systems. I have only found performances computed between 2003 and 2005, and for x86. Do you have any updated performance tables for XFS, ReiserFS and Ext3 file systems, on linux x86 AND x86_64 ? And with or without raid ? Thanks