REPLACE query

2004-04-13 Thread Kevin Carlson
I have a table with four columns, the first three of which are combined into a unique key: create table Test { cid int(9) NOT NULL default '0', sid int(9) NOT NULL default '0', uid int(9) NOT NULL default '0', rating tinyint(1) NOT NULL default '0', UNIQUE KEY csu1

Re: First letter only of a column

2004-04-13 Thread Kevin Carlson
try this: select LEFT(names, 1) from table Tim Johnson wrote: Hello: Is it possible to use mysql to select only the first letter of a string in a column? IOWS select names from table - select first letter of names from table another way of asking my questions would be, Is it possible

Re: How do I determine the row number or key when table has no key fields

2004-04-12 Thread Kevin Carlson
Andy Ford wrote: I thought LIMIT limited you to N number of CONCURRENT record. ie. limit 10 or limit 20 I believe Ross would like to select select 1000 records and then do a sub select of records 1-20 and then 21-40 on this record set LIMIT also allows you to specify a starting record, i.e.

Re: Load Data

2004-03-29 Thread Kevin Carlson
Try this (untested) : update table set column=LEFT(column, LENGTH(column)-1) Andrea Broerman wrote: I have successfully loaded data from a comma separated file (CSV) into a table, but the last field in each record appears to have a little square symbol at the end of the text which I assume is

Re: COMPOSITE PRIMARY KEY?

2004-02-10 Thread Kevin Carlson
Seena Blace wrote: Hi, I want to create a table with composite Primary key.How to do that? create table ipdet (IPaddress varchar (14) not null , hostid varchar (20) not null primary key (ipaddress,hostid), IP_DESC text , MAC text, interface text); Try this: create table ipdet

Re: use mysqldump and mysqlhotcopy together?

2004-02-10 Thread Kevin Carlson
Bing Du wrote: Greetings, I've been looking at the backup/recover related discussions in the list archives for a while. Seems to me most people use either mysqldump or mysqlhotcopy. We don't have a good MySQL backup scheme in place yet. Now I have some questions based on my reading. We use

Re: auto_increment pseudo sequence?

2004-02-09 Thread Kevin Carlson
alter table AUTO_INCREMENT=x Scott Purcell wrote: Hello, I have an application in which I am using auto_increment as a kind of sequence replacement. The only problem I have is trying to get the auto_increment to start at a larger number than 0. Is auto_increment the replacement for sequences?

Re: JOIN types

2004-01-13 Thread Kevin Carlson
Keith Bussey wrote: ... Also, I'm running MySQL 4.0.13-standard, STRAIGHT JOIN doesnt seem to exist for me ;p I think it is actually STRAIGHT_JOIN... -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Formatted index

2003-12-01 Thread Kevin Carlson
Does MySQL support formatted indexes such as in the statement below? alter table DateInfo add index monthYear (DATE_FORMAT(updateDate, '%m/%Y')) If not, does anyone know of any plans to support this in the future? Thanks, Kevin -- MySQL General Mailing List For list archives:

Re: Formatted index

2003-12-01 Thread Kevin Carlson
Keith C. Ivey wrote: On 1 Dec 2003 at 13:41, Kevin Carlson wrote: Does MySQL support formatted indexes such as in the statement below? alter table DateInfo add index monthYear (DATE_FORMAT(updateDate, '%m/%Y')) What sort of queries would that help you with?... This helps with queries

Re: Formatted index

2003-12-01 Thread Kevin Carlson
Keith C. Ivey wrote: On 1 Dec 2003 at 16:32, Kevin Carlson wrote: select * from DateInfo where DATE_FORMAT(updateDate, '%m/%Y') = '03/2003' I have an index on the updateDate column but it does not seem to be used since I am altering the value with the DATE_FORMAT function in the where clause

Re: Security Question

2003-11-26 Thread Kevin Carlson
Curley, Thomas wrote: I am trying to find a solution to the following security issue with MySql DB on linux - Someone copies the DB files to another box, starts a mysql instance, loads the DB and presto - views the 'private' data !!! As all the other posters have mentioned, you should have

Help recovering db

2003-11-24 Thread Kevin Carlson
Using a backup I recreated the /var/lib/mysql directory and when I restart mysqld I am getting the following error: InnoDB: Error: log file /var/lib/mysql/ib_logfile0 is of a different size 0 5238827 byes InnoDB: than specified in the .cnf file 0 5242880 Of course, the database never starts

Re: Having MySQL listen on multiple(2) ports at the same time

2003-11-12 Thread Kevin Carlson
You can emulate this using IPTables and a FORWARD rule. If you are unfamiliar with IPTables see http://www.iptables.com/ for documentation. Misaochankun wrote: Can this be done? No, I do not mean running multiple MySQL servers. I need to have MySQL listen on two separate ports at the same time.

After successful INSERT, no record found

2003-10-30 Thread Kevin Carlson
I am using MySQL version 4.0.11 gamma on Linux 7.1 and have just experienced the following problem: INSERTed a record into a InnoDB table, then used SELECT to retrieve the recordID (auto numbered field) from the same table using a key. The SELECT returned the proper ID. However, when

Re: After successful INSERT, no record found

2003-10-30 Thread Kevin Carlson
gerald_clark wrote: Did you commit the transaction? Yes, the transaction was committed. I was using MyCC at the same time the anomaly occurred, also. Could this have had anything to do with it? Kevin Carlson wrote: I am using MySQL version 4.0.11 gamma on Linux 7.1 and have just

RE: database restore - please help

2002-05-29 Thread Kevin Carlson
You should be able to do this: mysql backup.txt -Original Message- From: Hathaway, Scott L [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 29, 2002 8:49 AM To: Mysql (E-mail) Subject: database restore - please help I deleted my database today by mistake and I have a backup from

Interesting datetime problem

2002-05-28 Thread Kevin Carlson
Hi, I have an interesting problem when updating columns of type DATETIME. It seems that exactly one day is subtracted from the DATETIME value that I submit in an update query. Has anyone encountered this? Any ideas? Kevin

RE: Interesting datetime problem

2002-05-28 Thread Kevin Carlson
Of Benjamin Pflugmann Sent: Tuesday, May 28, 2002 6:19 PM To: Kevin Carlson Cc: Mysql Subject: Re: Interesting datetime problem Hi. Maybe your TZ (timezone) environment variable is set to a strange value? If not, could you provide a full example, so that we can try to reproduce it and see whether

RE: first mysql table; syntax qustion

2002-05-28 Thread Kevin Carlson
How do you reference a column name in another table to avoid repeating the values? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Benjamin Pflugmann Sent: Tuesday, May 28, 2002 6:24 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: first mysql