Re: how to Get file modified time and date of file by using builtin function or procedure in sql?

2008-07-24 Thread Sivasakthi
Ananda Kumar wrote: which file are u talking about. regards anandkl Ordinary temp file.. say example in C:\output.txt Actually i have given that file as input to some procedure, based on that modification time we have calculate some details. -- MySQL General Mailing List For list

Re: how to Get file modified time and date of file by using builtin function or procedure in sql?

2008-07-24 Thread Ananda Kumar
you can do that using OS command, any specific reason u want to use stored proc to get this information. On 7/24/08, Sivasakthi [EMAIL PROTECTED] wrote: Ananda Kumar wrote: which file are u talking about. regards anandkl Ordinary temp file.. say example in C:\output.txt Actually i

Re: how to Get file modified time and date of file by using builtin function or procedure in sql?

2008-07-24 Thread Sivasakthi
Ananda Kumar wrote: you can do that using OS command, any specific reason u want to use stored proc to get this information. OS Command? could you explain with examples? because, I have more # of input files.. thats why iam going to procedure.. -- MySQL General Mailing List For list

Re: how to Get file modified time and date of file by using builtin function or procedure in sql?

2008-07-24 Thread Ananda Kumar
file_name ls -ltr abc.txt -rw-r--r-- 1 root root 34296 Jul 23 15:07 abc.txt Is this what your looking at? On 7/24/08, Sivasakthi [EMAIL PROTECTED] wrote: Ananda Kumar wrote: you can do that using OS command, any specific reason u want to use stored proc to get this information. OS Command

Re: how to Get file modified time and date of file by using builtin function or procedure in sql?

2008-07-24 Thread Peter Brawley
how to Get file modified time and date of file by using builtin function or procedure in sql? On Codd's rules, it oughtn't to be possible---it'd be a backdoor. If there is a need to know the datetime of the last mod to a table, that info ought to be in a column in a table. PB -- MySQL

Re: how to Get file modified time and date of file by using builtin function or procedure in sql?

2008-07-24 Thread John Hicks
are using a procedural language to call MySQL. Why don't you use that language to obtain the file info? -John -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: how to Get file modified time and date of file by using builtin function or procedure in sql?

2008-07-24 Thread Kevin Spencer
On Thu, Jul 24, 2008 at 1:17 AM, Sivasakthi [EMAIL PROTECTED] wrote: Hi All, how to Get file modified time and date of file by using builtin function or procedure in sql? In a related thread from earlier today you were advised that any interaction with the filesystem should be done via

force row to appear at top of results using order by

2008-07-01 Thread Andrew Martin
| |9 | Online demos| +--+-+ Is this possible without using a subquery or union? Many thanks, Andy -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: force row to appear at top of results using order by

2008-07-01 Thread Andrew Martin
Many thanks for the quick replies! This solution appears the most elegant: -- Forwarded message -- From: Markus Grossrieder [EMAIL PROTECTED] Date: 2008/7/1 Subject: Re: force row to appear at top of results using order by To: Andrew Martin [EMAIL PROTECTED] Andrew, something

RE: force row to appear at top of results using order by

2008-07-01 Thread Rolando Edwards
of results using order by Hello, I have an order by question... This is the raw data... mysql SELECT events_groups_id, events_groups_name FROM events_groups; +--+-+ | events_groups_id | events_groups_name

RE: force row to appear at top of results using order by

2008-07-01 Thread Jerry Schwartz
-Original Message- From: Andrew Martin [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 01, 2008 9:20 AM To: mysql@lists.mysql.com Subject: force row to appear at top of results using order by Hello, I have an order by question... This is the raw data... mysql SELECT events_groups_id

Re: MySQL using only 1 CPU

2008-06-21 Thread Per Jessen
Eber Duarte wrote: I noticed that I always have 2 processes runing on Linux doesn't matter the amount of concurrent connections that is running on MySQL. Due to that, MySQL is using only 1 CPU instead of using 8 CPUs that exist on this machine: Do you have enough concurrent load to occupy 8

Re: MySQL using only 1 CPU

2008-06-21 Thread Moon's Father
to that, MySQL is using only 1 CPU instead of using 8 CPUs that exist on this machine: Do you have enough concurrent load to occupy 8 CPUs? Here's a sample 'top' from one of my machines (also 8-way): top - 18:12:58 up 12 days, 23:22, 6 users, load average: 2.95, 3.02, 3.53 Tasks: 177

MySQL using only 1 CPU

2008-06-20 Thread Eber Duarte
that is running on MySQL. Due to that, MySQL is using only 1 CPU instead of using 8 CPUs that exist on this machine: linux$ ps aux | grep mysql root 20327  0.0  0.0  64048  1272 ?    S    10:05   0:00 /bin/sh ./bin/mysqld_safe --defaults-extra-file=/mysql/my.cnf --datadir=/mysql/data

Can I dump procedures with mysqldump using --tabs?

2008-06-12 Thread Jim Lyons
I usually use the --tabs option on mysqldump. However, if a table has a function, procedure, or trigger, the code is not written to a file but rather to standard out. Is this the only way to dump them using the --tabs option? I thought of trying to use the Information Schema database somehow

Re: Usefulness of mysql logs when using innodb?

2008-05-20 Thread Moon's Father
You should keep it on in my opinion. On Tue, May 13, 2008 at 6:04 PM, Nico Sabbi [EMAIL PROTECTED] wrote: Hi, I guess that when I'm using only Innodb and no replication I can safely disable mysql's (bin-) log files (that grow to no end) because Innodb has its own log files. Is it correct

BETWEEN, IN, , .... not using index with floats

2008-05-16 Thread Nacho Garcia
NULL NULL NULL 108 Using where thanks in advance

Usefulness of mysql logs when using innodb?

2008-05-13 Thread Nico Sabbi
Hi, I guess that when I'm using only Innodb and no replication I can safely disable mysql's (bin-) log files (that grow to no end) because Innodb has its own log files. Is it correct? Thanks, Nico -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql

how to escape new lines using select * into outfile

2008-05-13 Thread Saravanan
Hi all, I want to export the values based on the condition. I export them as csv. select * into outfile 'filename.csv' from table; the problem is one field in table has many lines, means with \n. I couldn't import the values into the xls sheet. any ideas how to escape the new line

RE: how to escape new lines using select * into outfile

2008-05-13 Thread Jerry Schwartz
new lines using select * into outfile Hi all, I want to export the values based on the condition. I export them as csv. select * into outfile 'filename.csv' from table; the problem is one field in table has many lines, means with \n. I couldn't import the values into the xls sheet. any ideas

Re: how to escape new lines using select * into outfile

2008-05-13 Thread Velen
Try using: select * into outfile 'filename.csv' fields enclosed by '' terminated by ',' lines terminated by '\n' from table Regards, Velen - Original Message - From: Saravanan [EMAIL PROTECTED] To: mysql mysql@lists.mysql.com Sent: Tuesday, May 13, 2008 9:26 PM Subject: how to escape

Re: how to escape new lines using select * into outfile

2008-05-13 Thread Saravanan
thanks velen. But I want to escape the newlines in the fields. It is annoying and new lines moves the values in separate line of excel sheet. Thanks, Saravanan --- On Wed, 5/14/08, Velen [EMAIL PROTECTED] wrote: From: Velen [EMAIL PROTECTED] Subject: Re: how to escape new lines using select

Re: Using Date Functions in Where Clause

2008-04-19 Thread Baron Schwartz
Hi, On Mon, Apr 14, 2008 at 1:54 PM, Jamie Madill [EMAIL PROTECTED] wrote: Hello, Basically I want to know if this is a good query for indexing. I have the following query: select count(1) as count from session where last = DATE_SUB(NOW(), INTERVAL :from SECOND) Is it

Using Date Functions in Where Clause

2008-04-14 Thread Jamie Madill
Hello, Basically I want to know if this is a good query for indexing. I have the following query: select count(1) as count from session where last = DATE_SUB(NOW(), INTERVAL :from SECOND) Is it safe to assume that the expression calling the function DATE_SUB is evaluated just once to a

Help with ORDER BY using two colomns

2008-04-08 Thread Richard
Hello, I've got a table which containes two date colomns. The first one is called `date` and the second `update` In the first one I put the ticket creation date, and on update I add or change the update value. So the update colomn does not contain a value until the first update has been done. I

Re: Help with ORDER BY using two colomns

2008-04-08 Thread Kristian Myllymäki
mysql version? http://dev.mysql.com/doc/refman/5.0/en/case-statement.html order by case when updated is not null then updated else created end desc; /Kristian On Tue, Apr 8, 2008 at 1:04 PM, Richard [EMAIL PROTECTED] wrote: Hello, I've got a table which containes two date colomns. The

Re: Help with ORDER BY using two colomns

2008-04-08 Thread Richard
Hello I've tried the following with mysql 4.1.11 SELECT * FROM quick_contact WHERE (`status` = '0') OR (`status` = '2' AND `update` '.(time()-864000).') CASE WHEN `update` = '' THEN ORDER BY `date` DESC ELSE ORDER BY `update` DESC END CASE; It does not work but, is it my code that is wrong

Re: Help with ORDER BY using two colomns

2008-04-08 Thread Rafael Barbolo Lopes
Can't you do Something like: ORDER BY (update,date) The major column of ordering would be update and the second date. I'm not sure about this solution On Tue, Apr 8, 2008 at 8:54 AM, Richard [EMAIL PROTECTED] wrote: Hello I've tried the following with mysql 4.1.11 SELECT * FROM

Re: Help with ORDER BY using two colomns

2008-04-08 Thread Richard
Thanks, I think that your solution will be sufficient for my needs, however I would still like to know for my personal knowledge how to manage correctly this kind of need. And to make it more complicated I've just rearlised that there is another element to take into account, I would need to

Re: Help with ORDER BY using two colomns

2008-04-08 Thread Ben Clewett
A modification to my last email, try: SELECT *, IF(update != '', update + 10, date) AS o FROM my_table ORDER BY o DESC; +-+--++--+ | num | date | update | o| +-+--++--+ | 5 | 40 | 90 | 100 | | 2 | 10 | 60 | 70 | | 6 | 50 |

Re: Help with ORDER BY using two colomns

2008-04-08 Thread Ben Clewett
I think the easiest is to create a new logical column with the correct ordering, something like: SELECT *, IF(update != '', update, date) AS o FROM my_table ORDER BY o DESC; I note that both 'update' and 'date' are reserved works :) Also worth noting that this cannot be assigned an index

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Richard
Thanks, it works like a charm :) Ben Clewett a écrit : A modification to my last email, try: SELECT *, IF(update != '', update + 10, date) AS o FROM my_table ORDER BY o DESC; +-+--++--+ | num | date | update | o| +-+--++--+ | 5 | 40 | 90

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Ben Clewett
Richard, No problem, glad it works. But note: this is not scalable. If you have more than a few hundred rows, you may want to think about a better solution, like storing the order field permanetly and giving it an index :) Ben Richard wrote: Thanks, it works like a charm :) Ben Clewett

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Richard
Thanks, This is for the unanswered list of questions, so the output list (not the list stored in the mysql database) should never go over 100. by scalable, do you mean alot of ressources being used or a long wait for the answer? Because I belive I Could just use a simple limit if I needed

Re: Help with ORDER BY using two colomns

2008-04-08 Thread Tim McDaniel
On Tue, 8 Apr 2008, Richard [EMAIL PROTECTED] wrote: Kristian Myllym?ki a ?crit : mysql version? http://dev.mysql.com/doc/refman/5.0/en/case-statement.html order by case when updated is not null then updated else created end desc; Hello I've tried the following with mysql 4.1.11 SELECT *

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Andy Wallace
Not sure, but perhaps an even simpler method would be to consider the initial insert an update as well... so the update column would always have a value. Then the sort would (I believe) always be in the order you want, and if you need to differentiate between rows that are new vs rows that are

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Ben Clewett
Richard, The query I gave you required the column 'o' to be calculated for each row at the time of gathering the data. When all rows have been gathered, the data will be stored and sorted in a temporary table. This temporary table will be in memory or on disk depending on the setting of

Re: Help with ORDER BY using two colomns [ solved thankyou :) ]

2008-04-08 Thread Richard
Yes that would be easier, except that I would still have to create a tempory table to add 10 days onto the ones which have a status waiting for answer from customer and have not been answered for more than 10 days. This system is for customers who do not have an account yet to contact me. And

Re: Using MySQL with its data files on a CD-R (recordable CD)

2008-03-05 Thread Thufir
On Wed, 05 Mar 2008 00:13:56 -0500, Michael Hemer wrote: I have been researching to see if it's possible to have a MySQL database with it's data files on a cd-rom, but could use some help to determine if I have found out the full truth of what's possible. I would appreciate any additional

Re: Using MySQL with its data files on a CD-R (recordable CD)

2008-03-05 Thread Michael Hemer
I believe that this situation could work with ldap, but it is not what I had imagined. I was picturing a database for retail. The database could hold a list of products for sale and details relating to those products. -Michael Thufir [EMAIL PROTECTED] wrote On Wed, 05 Mar 2008 00:13:56

Re: Using MySQL with its data files on a CD-R (recordable CD)

2008-03-05 Thread Daniel Brown
direct access from a hard drive), as well as the version limitations. If the MySQL databases on the CD are, for example, in MySQL 5.x format, but your end-user is still using MySQL 3.23, it's not going to work. Also, there will need to be some configuration variables modified on each end-user system

Re: Using MySQL with its data files on a CD-R (recordable CD)

2008-03-05 Thread Michael Hemer
will be slower than direct access from a hard drive), as well as the version limitations. If the MySQL databases on the CD are, for example, in MySQL 5.x format, but your end-user is still using MySQL 3.23, it's not going to work. Also, there will need to be some configuration variables modified

Using MySQL with its data files on a CD-R (recordable CD)

2008-03-04 Thread Michael Hemer
not be a problem. An important factor is that the data is stored on a CD-R and the person receiving the data can use it directly from the CD-R without needing to copy it anywhere else. I have found that using MyISAM as the storage engine appears to work, but was wondering if other storage engines could

group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread Richard
Hello, This time I'm rearly not sure if this is possible to do. I've got two queries that I would like to bring together to make only one query ... I've got a list of users And also a login table I would like to list all users and show the number of times they have logged in. So to get

Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread Peter Brawley
Richard, Can I do something like this : SELECT a.username, a.first_name, a.last_name,b.(SELECT COUNT(*) AS count FROM login_table b WHERE a.username = b.username) FROM user_list a Try ... SELECT a.username, a.first_name, a.last_name,COUNT(b.username) AS count FROM user_list a JOIN login_table

Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread Richard
Hi, and thankyou for trying to help me out! I've tried this and it does not work. Here are the problems : 1) If a user has never logged in he doesn't show the user in the list 2) It doesn't count if it is 0 it's not on the liste and if the user has logged in more than once the result is 1

Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread Richard
Sorry it's me again, I made a mistake, it counts the number of logins correctly, but does not show members with 0 logins ! Any idea how to do this? Thanks :) Peter Brawley a écrit : Richard, Can I do something like this : SELECT a.username, a.first_name, a.last_name,b.(SELECT COUNT(*) AS

Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread ddevaudreuil
To [EMAIL PROTECTED], mysql@lists.mysql.com cc Subject Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ? Sorry it's me again, I made a mistake, it counts the number of logins correctly, but does not show members

Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread ddevaudreuil
: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ? Sorry it's me again, I made a mistake, it counts the number of logins correctly, but does not show members with 0 logins ! Any idea how to do this? Thanks :) Peter

Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread David Schneider-Joseph
Try this one: SELECT a.username, a.first_name, a.last_name,COALESCE(COUNT(b.username), 0) AS count FROM user_list a LEFT JOIN login_table b ON a.username = b.username GROUP BY a.username,a.first_name,a.lastname; The LEFT JOIN will ensure you still get a result row even if there are no

Re: group a select * and a select COUNT from 2 different tables using result of first table to do the COUNT ... is it possible ?

2008-02-19 Thread Peter Brawley
Richard, 1) If a user has never logged in he doesn't show the user in the list 2) It doesn't count if it is 0 it's not on the liste and if the user has logged in more than once the result is 1 (because of the group by ...). Do you mean by #1 that you want to list all users whether they have

query database using an outside variable

2008-02-14 Thread hemanthap
/query-database-using-an-outside-variable-tp15476487p15476487.html Sent from the MySQL - General mailing list archive at Nabble.com.

CREATING A table using a hash in perl

2008-02-08 Thread POLIVEIRA
Hi How do I create a table inside a perl script using a hash to give table name and mysql statements? thanks. -- View this message in context: http://www.nabble.com/CREATING-A-table-using-a-hash-in-perl-tp15353263p15353263.html Sent from the MySQL - General mailing list archive at Nabble.com

Follow Up : Error in /index.php: Access denied for user 'apache'@'localhost' (using password: NO)

2008-02-04 Thread mikesz
Hello MySQL List, Thanks Ken and HongKong0888 for the advice and suggestions. I hate when these kinds of problems just fade away with no resolution or analysis of the resolved issue. So, with that, here is the explanation for what caused THIS particular problem (can you say user error?). In

Re: Error in /index.php: Access denied for user 'apache'@'localhost' (using password: NO)

2008-02-02 Thread Ken Odoki-Olam
My guess is that you have the privileges set on your local box that allow connections with those credentials but the same privileges are not set up on your clients machines. Although using apache as a user without a password is quite a security risk. And then mailing those details to a public

Error in /index.php: Access denied for user 'apache'@'localhost' (using password: NO)

2008-02-01 Thread mikesz
hundreds of times with no trouble but the last two in a row have required that the permissions be reset. I am just looking at the error messages in the emails I am getting and apparently it is not just the Apache user. It is sending access denied for the site account owner too, I just noticed. I am using

Using Variables in Insert

2008-01-23 Thread Kc9cdt
Dan, Thanks very much for responding to my problem post. I was hoping I was just missing something in the syntax. Looks like I made a very big mistake recommending MySql to my Client. I have hundreds of SQL statements in the code I am converting for them. It is C code in IBM DB/2 running on OS/2

Re: Using Variables in Insert

2008-01-23 Thread Dan Nelson
syntax no matter what underlying database you are using. MySQL didn't even have prepared statements at all until 4.1, and if DCConnect supports them in earlier MySQL versions, it must have done the work itself. I tried another approach... building the SQL statement string with sprintf, still a pain

Need to know how to do INSERTS, using variables for VALUE

2008-01-22 Thread Kc9cdt
Hello, Doing C coding with MSql. What am I missing here? I am needing to do standard INSERT statements using variables for the VALUE fields These fields are changed in the application befre I issue the INSERT. The current proram uses : before the variable to make it work. Like this: INSERT

Re: Need to know how to do INSERTS, using variables for VALUE

2008-01-22 Thread Dan Nelson
In the last episode (Jan 22), [EMAIL PROTECTED] said: Hello, Doing C coding with MSql. What am I missing here? I am needing to do standard INSERT statements using variables for the VALUE fields These fields are changed in the application befre I issue the INSERT. The current proram uses

fast insert/update on partitioned table using hash

2008-01-15 Thread Britske
-on-partitioned-table-using-hash-tp14841410p14841410.html Sent from the MySQL - General mailing list archive at Nabble.com. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Using DROP USER in a stored procedure

2008-01-06 Thread Shawn Green
to use DROP USER with a variable name in a stored procedure? If not, is there some way to drop a bunch of users given a table of usernames? Perhaps this problem has only ever been tackled using a higher level language - but I was hoping to solve it in a little mysql script. Thanks. Hope you have

Re: Using DROP USER in a stored procedure

2008-01-06 Thread Eddie Cornejo
On Jan 7, 2008 2:34 AM, Shawn Green [EMAIL PROTECTED] wrote: Eddie Cornejo wrote: I'm writing a cleanup script to remove database items created by my application. One of the things I would like to remove are all user accounts created through my application... This is proving to be harder

Using DROP USER in a stored procedure

2008-01-01 Thread Eddie Cornejo
with a variable name in a stored procedure? If not, is there some way to drop a bunch of users given a table of usernames? Perhaps this problem has only ever been tackled using a higher level language - but I was hoping to solve it in a little mysql script. Thanks. Hope you have a great 2008! -- Eddie

Slow query not using index

2007-11-14 Thread Ian M. Evans
Bad news: I have a slow query that doesn't appear to be using an index even if I force it. Good news: the forehead shaped dent in my desk is really progressing well. Here's the query: SELECT DISTINCT poster_data.* FROM poster_data, poster_prodcat, poster_categories WHERE

Re: Slow query not using index

2007-11-14 Thread Chris
Ian M. Evans wrote: Bad news: I have a slow query that doesn't appear to be using an index even if I force it. Good news: the forehead shaped dent in my desk is really progressing well. Here's the query: SELECT DISTINCT poster_data.* FROM poster_data, poster_prodcat, poster_categories WHERE

Re: Slow query not using index

2007-11-14 Thread Ian M. Evans
One of the list readers (thanks Brent!) suggested using a full text index on the category names field. Queries dropped from 10-49 seconds down to 0.0085 Thanks for the emails folks! -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http

indexing tables using my owns functions

2007-11-13 Thread Pau Marc Munoz Torres
' and MOLEC=MOL; select P1+P4+P6+P7+P9 into output; return output; end // And it works, now, i would like index a table using this function. The table description is: mysql describe precalc; +---+-+--+-+-++ | Field | Type

Re: indexing tables using my owns functions

2007-11-13 Thread Martijn Tonies
mysql create index AA on precalc (IDR(P1,P4,P6,P7,P9,'HLA-DRB13')); But i Get the following error: ERROR 1064 (42000): 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 ''P1','P4','P6','P7','P9','HLA-DRB13'))'

indexing tables using my owns functions

2007-11-13 Thread Pau Marc Munoz Torres
' and MOLEC=MOL; select P1+P4+P6+P7+P9 into output; return output; end // And it works, now, i would like index a table using this function. The table description is: mysql describe precalc; +---+-+--+-+-++ | Field | Type

Re: indexing tables using my owns functions

2007-11-13 Thread Pau Marc Munoz Torres
, as far as i can see, from mysql 5.0 and upper it is possible create index using functions. http://www.faqs.org/docs/ppbook/r24254.htm But i keep having problems with the exemple from the link. Is there any bug in mysql 5.0.24a-log? 2007/11/13, Martijn Tonies [EMAIL PROTECTED]: mysql

Re: indexing tables using my owns functions

2007-11-13 Thread Martijn Tonies
, as far as i can see, from mysql 5.0 and upper it is possible create index using functions. http://www.faqs.org/docs/ppbook/r24254.htm But i keep having problems with the exemple from the link. Is there any bug in mysql 5.0.24a-log? The above website says: Practical PostgreSQL I cannot

pam and crypt using mysql

2007-11-06 Thread Luca Ferrari
Hello, sorry if this is not the right mailing list to ask this question, hope someone can point me to a better list in the case. My problem is that I'd like to use mysql as database for storing user accounts for different services, and I started using vsftpd. Now, following the instruction

How to grant privileges using REVOKE statement

2007-10-18 Thread Rafal Somla
Hi All! Here is a funny thing I come across when investigating our privilege control system. Consider the following situation: mysql GRANT ALL ON `%o`.* TO rafal; mysql GRANT SELECT ON foo.* TO rafal; The intention is that rafal has all privileges for all objects in databases whose name

Using MySQL date/time

2007-10-08 Thread Tiago Cruz
Hello guys, I would like to get some registers on my database that are older than 90 days, and after delete it because the table is very larger: mysql select count(*) from max_ecardsent; +--+ | count(*) | +--+ | 1172330 | +--+ 1 row in set (0.01 sec) But I'm confusing

using column comment to store metadata

2007-09-17 Thread Ezequiel Panepucci
Hi, I'm thinking of using the COMMENT of columns when creating tables to store some metadata about the column, for instance: valid_range of numbers, validation regexp, etc. I did some tests with including this information as a JSON (JavaScript Object Notation) string which can then be easily

Re: using column comment to store metadata

2007-09-17 Thread Martijn Tonies
Hi, I'm thinking of using the COMMENT of columns when creating tables to store some metadata about the column, for instance: valid_range of numbers, validation regexp, etc. I did some tests with including this information as a JSON (JavaScript Object Notation) string which can

Re: using column comment to store metadata

2007-09-17 Thread Ezequiel Panepucci
On 9/17/07, Martijn Tonies [EMAIL PROTECTED] wrote: Do you have any comments about this approach? What could possibly go very bad about relying on this usage of the COMMENT? Yes, in different storage engines, different stuff is returned. For example, in InnoDB, what you get returned from

Re: using column comment to store metadata

2007-09-17 Thread Martijn Tonies
Do you have any comments about this approach? What could possibly go very bad about relying on this usage of the COMMENT? Yes, in different storage engines, different stuff is returned. For example, in InnoDB, what you get returned from SHOW FULL COLUMNS is not what you stored

Re: using column comment to store metadata

2007-09-17 Thread Ezequiel Panepucci
I currently use MyISAM, but I just tried a simple create(InnoDB)/show full columns from/ and it actually does return the JSON strings I put in. Try it on columns with a foreign key constraint. I did and it still works (maybe the behaviour is version dependent?). Here is what I did:

Re: using column comment to store metadata

2007-09-17 Thread Martijn Tonies
I currently use MyISAM, but I just tried a simple create(InnoDB)/show full columns from/ and it actually does return the JSON strings I put in. Try it on columns with a foreign key constraint. I did and it still works (maybe the behaviour is version dependent?). Hmm, could be.

query using connected username

2007-09-14 Thread Peter Teunissen
Hi All, I'd like to restrict queries using the username of the user that issued the query. I know about the available user restrictions in the database, but they seem limited to whole tables and columns. What I need is limiting the access on row level. If I can access the username, I'd

Re: query using connected username

2007-09-14 Thread Baron Schwartz
Peter Teunissen wrote: Hi All, I'd like to restrict queries using the username of the user that issued the query. I know about the available user restrictions in the database, but they seem limited to whole tables and columns. What I need is limiting the access on row level. If I can access

GROUP BY...not using index?

2007-09-13 Thread James Tu
I have an index on `food` and on `active`, how come the result of the EXPLAIN doesn't show the query using an index? I'm concerned that as the query time will grow with the table. My Query: SELECT `food` , COUNT( `food` ) AS 'population' FROM `users` WHERE `active`=1 GROUP BY `food` LIMIT

Re: GROUP BY...not using index?

2007-09-13 Thread Les Fletcher
then be used by the group by. alter table user add index(active, food); This is off the top of my head, hope that it helps. Les James Tu wrote: I have an index on `food` and on `active`, how come the result of the EXPLAIN doesn't show the query using an index? I'm concerned that as the query

Re: GROUP BY...not using index?

2007-09-13 Thread Michael Dykman
then be used by the group by. alter table user add index(active, food); This is off the top of my head, hope that it helps. Les James Tu wrote: I have an index on `food` and on `active`, how come the result of the EXPLAIN doesn't show the query using an index? I'm concerned that as the query

Re: Using MAX function to fetch primary id

2007-09-10 Thread Brent Baisley
You can do it as long as there is only a single record with the max value. If there is more than 1 record with the same max value, there isn't a single record to pull. To do it, you would need to join on the results of the max query, and part of the join condition would be the max value

Using MAX function to fetch primary id

2007-09-07 Thread Cathy Fusko
Hi, I need to select a max value for a group of records and I also need the primary key for that record. I am wondering if this can be done with a single query? e.g Table_x id count cat_id 110 1 220 2 335 2 415 1 with SELECT id, cat_id,

RE: Using MAX function to fetch primary id

2007-09-07 Thread Daevid Vincent
: Erroneus column using MAX() and GROUP BY and Help with subqueries... MAX() and GROUP BY Also these links may help. http://dev.mysql.com/doc/refman/4.1/en/example-maximum-column-group-row.html http://www.xaprb.com/blog/2006/12/07/how-to-select-the-firstleastmax-row-per -group-in-sql

Access denied for GRANT using root yet manual user insertion is fine

2007-09-01 Thread Ed Cradock
The grant flag is enabled on the root account: mysql SELECT Grant_priv FROM user WHERE User='root' AND Host='localhost'; ++ | Grant_priv | ++ | Y | ++ 1 row in set (0.01 sec) mysql SHOW GRANTS FOR 'root'@'localhost'; Grants for [EMAIL PROTECTED]

Access denied for GRANT using root yet manual user insertion is fine

2007-09-01 Thread Ed Cradock
The grant flag is enabled on the root account: mysql SELECT Grant_priv FROM user WHERE User='root' AND Host='localhost'; ++ | Grant_priv | ++ | Y | ++ 1 row in set (0.01 sec) mysql SHOW GRANTS FOR 'root'@'localhost'; Grants for [EMAIL PROTECTED]

Re: Access denied for GRANT using root yet manual user insertion is fine

2007-09-01 Thread Ed Cradock
With assistance from a friend this issue has been rectified. The current GRANT was not sufficient. After executing the new GRANT with 'ALL PRIVILEGES' (using the --init-file switch) the root user can now issue GRANTS. Additionally I apologise for duplicate posts, It was not intentional. On 9/2

Using mysqlbinlog with tables with binary data (blobs)

2007-08-21 Thread Ingvar Hagelund
We have had some cases where we wanted to recover data using the binlogs from some days ago. The database has a lot of binary objects (blobs). The normal way to recover are to restore database files from a consistant point, and then use mysqlbinlog to spool from that point till where we want

Re: MAKE QUERY USING JOIN BY RETRIEVING DATA FROM TWO MYSQL SERVER

2007-08-10 Thread Ananda Kumar
Its not possible in innodb or myisam engine, you can do it using fedrated if i am not wrong. regards anandkl On 8/10/07, krishna chandra prajapati [EMAIL PROTECTED] wrote: Hi All, There are two mysql server. I need to retrive data from two different hosts (mysql server) and by using

MAKE QUERY USING JOIN BY RETRIEVING DATA FROM TWO MYSQL SERVER

2007-08-10 Thread krishna chandra prajapati
Hi All, There are two mysql server. I need to retrive data from two different hosts (mysql server) and by using a join make a query. Is it possible to make a query which can fetch data from two different mysql server using join. -Regards, Krishna

Re: MAKE QUERY USING JOIN BY RETRIEVING DATA FROM TWO MYSQL SERVER

2007-08-10 Thread krishna chandra prajapati
Hi Everybody, If any body knows how to implement federated storage engine and how to setup it. How it works. Please enrich me also. -Regards, Krishna On 8/10/07, Ananda Kumar [EMAIL PROTECTED] wrote: Its not possible in innodb or myisam engine, you can do it using fedrated if i am not wrong

Re: segment fault when using mysql++

2007-08-03 Thread Michael Dykman
, 2007 at 11:04:13AM +0800, wangxu wrote: actually I am using this piece of code,but I replaced fprintf to printf just to simplify the problem. and the field content actually stores string content. Shall this mean some thing different from your explanation? while (r

Re: segment fault when using mysql++

2007-08-03 Thread Warren Young
wangxu wrote: actually I am using this piece of code,but I replaced fprintf to printf just to simplify the problem. Everything I said about printf() applies equally to fprintf(). The %s work-around suggested by Pete Harlan will work, but not for very good reasons. Again: see examples

Re: segment fault when using mysql++

2007-08-02 Thread Pete Harlan
. Otherwise, if your r[content] happens to return a string that contains %s or some other thing that causes fprintf to look for more data on the stack, you'll get output you weren't expecting. --Pete On Thu, Aug 02, 2007 at 11:04:13AM +0800, wangxu wrote: actually I am using this piece of code,but I

segment fault when using mysql++

2007-08-01 Thread wangxu
below is my code;these code works very fine until, the length of the field content exceeds 30, then segment fault happened. how can I avoid this? mysqlpp::Query query = conn.query(); query select content from pages where id=id; mysqlpp::ResUse

<    1   2   3   4   5   6   7   8   9   10   >