Re: Need help to query with timestamp in C++

2008-08-15 Thread Kandy Wong
Hi Saul, I need to use C++ and I'm not writing a web application. Thanks anyway. Kandy I have done queries to the database in PHP with variables like month but easily can select from a range of time and data to produce the same results, the output goes directly to the web so if that is what

ERROR 13 (HY000): Can't get stat of '/var/lib/mysql/e5publishers.txt' (Errcode: 13)

2008-08-15 Thread Mike Spreitzer
I am running MySQL Community edition 5.0.51a-0.rhel4 (on RedHat Enterprise Linux 4). I am unable to load data from a text file; when I try I get the error message in the subject of this email. In the typescript below you will see two tries, with all the necessary file and database

Re: Need help to query with timestamp in C++

2008-08-15 Thread DuĊĦan Pavlica
Hi Kandy, this could be the query you are looking for. It should return record with the closest timestamp to your required time: (SELECT TIMEDIFF('20080815091907', timestamp_column) AS diff, t.* FROM table1 t WHERE timestamp_column = '20080815091907' ORDER BY timestamp_column DESC LIMIT 1 )

Re: another INNODB vs MYISAM question

2008-08-15 Thread Doug Bridgens
if you switch the default engine type any new tables would be created with that new engine type. it does not convert existing tables to your new format. if you have existing innodb tables you need to have the innodb settings active, in my.cnf On 15 Aug 2008, at 06:01, [EMAIL

DROP TABLE IF EXISTS - doesnt??

2008-08-15 Thread roger.maynard
I am finding that DROP TABLE IF EXISTS mytable; Works fine if the table exists - but if it doesn't exist I get an error? Surely it should not error and just not try to drop the table. Is it me?

REGEXP vs LIKE/OR

2008-08-15 Thread Morten Primdahl
Hi, I want to retrieve all records where the field value contains either foo, bar or baz. Like so: SELECT id FROM table WHERE value LIKE '%foo%' OR value LIKE '%bar%' OR value LIKE '%baz%'; But then I stumbled upon REGEXP, and can do the same this way: SELECT id FROM table WHERE value

Re: DROP TABLE IF EXISTS - doesnt??

2008-08-15 Thread Fish Kungfu
Hmmm. It works okay for me, without an error when the tabel doesn't exist. I'm using mysql Server version 5.0.51a-3ubuntu5.1 For example: * mysql use lsldatabase; Reading table information for completion of table and column names You can turn off

Re: Need help to query with timestamp in C++

2008-08-15 Thread walter harms
Kandy Wong wrote: Hi Saul, I need to use C++ and I'm not writing a web application. Thanks anyway. you can do something like: select min(abs(timediff(targettime,timestamp))) from table where condition ; if you use the libmysql you can get the result as strings back (the method i

encode/decode question

2008-08-15 Thread Duzenbury, Rich
Hi, One of our previous developers decided to obfuscate some columns via the mysql encode and decode functions. This was done on a 4.x server. Recently, we converted to a 5.x server, and some of the fields in the rows will not decode correctly, and I cannot figure out why. My first thought

Re: Need help to query with timestamp in C++

2008-08-15 Thread Warren Young
Kandy Wong wrote: And what is the good connector (C++ to MySQL) to use? MySQL++ (http://tangentsoft.net/mysql++/) has native Date, Time, and DateTime data types. You can convert to these types implicitly: mysqlpp::DateTime dt = row[my_column]; Row::operator[] doesn't return

RE: Need help to query with timestamp in C++

2008-08-15 Thread Jerry Schwartz
I'm puzzled by the layout of your table, if that's what you're showing us. Is the timestamp in the table truly associated with the time at which the user put in his approximate time? If, for example, the user types in 04:05:07 at 04:03:02, and then types in 04:02:59 at 04:03:03, what is it

RE: DROP TABLE IF EXISTS - doesnt??

2008-08-15 Thread roger.maynard
I am getting this problem when I am calling this from within a stored procedure and from the command line area but from MySQLQueryBrowser Windows package. I have tried the DROP TABLE IF EXISTS from the mysql DOS-type command line and it doesn't error - I do notice that (also in your example) that

RE: DROP TABLE IF EXISTS - doesnt??

2008-08-15 Thread Martin Gainty
I am certain the SQLBrowser program authors want to hear about this error It may be due to the fact that MYSQL procedures need to have a different delimiter (//) instead of ; e.g. use DBNAME; DROP PROCEDURE IF EXISTS TABLE_NAME; delimiter //; Anyone? Martin

RE: DROP TABLE IF EXISTS - doesnt??

2008-08-15 Thread Fish Kungfu
Maybe what I am seeing in the Query Browser area is in fact a Warning message and not an error!! Ahhh...yes maybe that's it. Just fyi, here is the detail of the warning: mysql drop table if exists recipes; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql SHOW WARNINGS;

PHP Documentation in the MySQL Manual

2008-08-15 Thread Stefan Hinz
PHP Documentation in the MySQL Manual - MySQL can be used with a multitude of programming languages, but PHP is probably the most popular choice. For that reason, we always felt a bit bad about our PHP-related documentation being somewhat sparse, mostly

RE: REGEXP vs LIKE/OR

2008-08-15 Thread emierzwa
It looks like LIKE is only slightly faster(on my XP), hardly worth mentioning. Go with what is easier for you to read or for portability if you need it. IMHO set @a='gfdueruie baz hdhrh';select BENCHMARK(500, (select 1 from dual WHERE @a LIKE '%foo%' OR @a LIKE '%bar%' OR @a LIKE '%baz%')) as

MySQL compatibility with Windows Server 2008

2008-08-15 Thread Jesse
We will be purchasing a server pretty soon with Windows Server 2008 on it. I have heard that MySQL is not compatible with WS2008. Is that true? I've also seen instructions for installing MySQL 5.1 on WS2008. Is 5.1 compatible, but earlier versions are not? We run ASP and ASP.Net

Re: PHP Documentation in the MySQL Manual

2008-08-15 Thread Fish Kungfu
HOORAY!!! Thanks for all of yours and Tony's hard work! CheersFish - ~~Second Life addict~~ -Original Message- From: Stefan Hinz [EMAIL PROTECTED] Sent: Aug 15, 2008 11:09 AM To: mysql@lists.mysql.com Subject: PHP Documentation in the MySQL Manual PHP

Re: Need help to query with timestamp in C++

2008-08-15 Thread Kandy Wong
Hi Dusan, Thank you so much. It works! Kandy Hi Kandy, this could be the query you are looking for. It should return record with the closest timestamp to your required time: (SELECT TIMEDIFF('20080815091907', timestamp_column) AS diff, t.* FROM table1 t WHERE timestamp_column =

Re: MySQL compatibility with Windows Server 2008

2008-08-15 Thread Reggie Burnett
.NET connector is fine. ODBC should be ok but I'm not 100% sure. Jesse wrote: We will be purchasing a server pretty soon with Windows Server 2008 on it. I have heard that MySQL is not compatible with WS2008. Is that true? I've also seen instructions for installing MySQL 5.1 on WS2008. Is

Re: MySQL compatibility with Windows Server 2008

2008-08-15 Thread Jesse
.NET connector is fine. ODBC should be ok but I'm not 100% sure. How about MySQL itself? Thanks, Jesse -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: MySQL compatibility with Windows Server 2008

2008-08-15 Thread Reggie Burnett
It can depend on the version. Earlier versions of MySQL had problems with protocols like shared memory on Vista. Use a recent build of 5.0 or 5.1 and you should be ok. Jesse wrote: .NET connector is fine. ODBC should be ok but I'm not 100% sure. How about MySQL itself? Thanks, Jesse

Re: MYSQL PROCESS

2008-08-15 Thread Paul Choi
Can you give us the output of `uname -a` from your mysql hosts? There's a difference if you are running a 2.4 kernel vs. 2.6 kernel (Linux). In 2.4 kernel, try ps -ef, and in 2.6 kernel, ps -Lef. You may notice that PPID is the same for all PIDs except one, usually. -Paul On Thu, 2008-08-14 at