Re: Can I create a index on a column of Type datetime?

2007-04-11 Thread wangxu
No,I am just asking for a solution to speed up my queries. Martijn Tonies wrote: > >> I will very often do query like this: >> >> select * from mytable where create_date >='...' and create_date <='' >> >> can I create a index on the column create_date? >> > > Have you tried it? > > >

Re: Can I create a index on a column of Type datetime?

2007-04-11 Thread wangxu
Thank you, what 's the meaning of "using a datetime field unless it's the last field in the index."? the below is the desc result;Should I create an index on (source_url,create_date)? for these two fields are to be often queried by. +---+--+--+-+-+-

Re: import fails: error 13

2007-04-11 Thread Chris
mysql> LOAD DATA INFILE '/home/thufir/abc.txt' INTO TABLE delta.abc; ERROR 13 (HY000): Can't get stat of '/home/thufir/abc.txt' (Errcode: 13) '13' means permission denied. That is - mysql (which is running as user 'mysql' most likely), can't read the /path/to/abc.txt file. Place the file i

Re: when rebuilding keys?

2007-04-11 Thread wangxu
yes. - Original Message - From: "Martijn Tonies" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Sent: Thursday, April 12, 2007 1:43 AM Subject: Re: when rebuilding keys? > > > >> before load data. > > You want to rebuild the indices after loading data, > correct? > > Martijn Tonies >

Re: dumpfile question

2007-04-11 Thread wangxu
no, please use "load data infile" function. - Original Message - From: "Wm Mussatto" <[EMAIL PROTECTED]> To: Sent: Thursday, April 12, 2007 12:44 AM Subject: Re: dumpfile question > On Tue, April 10, 2007 19:45, Paul DuBois said: >> At 10:15 AM +0800 4/11/07, wangxu wrote: >>>follow is

Re: import fails: error 13

2007-04-11 Thread Mogens Melander
You need a LOCAL in your LOAD statement. LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' [REPLACE | IGNORE] INTO TABLE tbl_name [FIELDS [TERMINATED BY 'string'] [[OPTIONALLY] ENCLOSED BY 'char'] [ESCAPED BY 'char'] ] [LINES [STAR

import fails: error 13

2007-04-11 Thread Thufir
[EMAIL PROTECTED] ~]$ [EMAIL PROTECTED] ~]$ cat abc.txt -n 1 "A1","B1","C1" 2 "A2","B2","C2" 3 "A3","B3","C3" [EMAIL PROTECTED] ~]$ [EMAIL PROTECTED] ~]$ mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 21 to server version: 5.0

RSS import

2007-04-11 Thread Thufir
I'd like to import an RSS feed into mysql using and was curious as to whether others have done similarly. thanks, Thufir -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTE

Re: Revoking Privileges

2007-04-11 Thread Baron Schwartz
Al Sparks wrote: The version I'm using is: Your MySQL connection id is 6 to server version: 4.1.22 I log on as root. I then: mysql> show grants for 'WP_INT_BASEBALL'@'localhost'; +

PHP 4.X with 64-Bit Integers From MySQL

2007-04-11 Thread David T. Ashley
I have a box where I'm forced to use PHP before 64-bit integers became standard ... If I run a MySQL query where one of the fields returned is 64-bit integer, how do I get this into PHP as a string? My recollection is that in the PHP result sets it "auto types" so that it is an integer, and 64-b

Re: Tips for migration

2007-04-11 Thread Dan Buettner
Hi Schalk - Having just done this, it was not too hard. We used Ruby on Rails (RoR) to create a schema file from the MSSQL database, in order to recreate it in MySQL. If your database is simple enough and/or you have all the SQL used to create tables views etc., you don't need to do this. Make

Tips for migration

2007-04-11 Thread Schalk Neethling
HI All, Can anyone give me some pointers, help, point me to articles with regards to transfering a MSSQL database to MySQL? Thanks! Schalk Neethling -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Revoking Privileges

2007-04-11 Thread Al Sparks
The version I'm using is: Your MySQL connection id is 6 to server version: 4.1.22 I log on as root. I then: mysql> show grants for 'WP_INT_BASEBALL'@'localhost'; ++ | Grants

Re: database backup problem, since database over 60mb

2007-04-11 Thread Mogens Melander
Hi, Maybe you will have better luck with a command like: mysqldump -u user -ppassword databasename > backup_date.sql Regarding phpmyadmin, my guess would be, the script is longer than the permitted time to finish. Defaults in php.ini is something like: max_execution_time = 30 ; Maximum execut

Re: database backup problem, since database over 60mb

2007-04-11 Thread Dan Buettner
Richard, there's no inherent problem around 60 MB - I routinely dump data ranging from a few KB to a few GB. One thing I note is that you are using the mysql command, which is the interactive database client. You want to use mysqldump, the client program that dumps data from the database in SQL

database backup problem, since database over 60mb

2007-04-11 Thread Richard
Hello, I've got a problem with mysql 5 on my debian server. I've got a forum on this server and untill the database reached about 60 Mo I could dump the database with either phpmyadmin or with the command : mysql -u user -p'password' databasename > backup_date.sql My last backup that worked w

Re: Can I create a index on a column of Type datetime?

2007-04-11 Thread Martijn Tonies
> I will very often do query like this: > > select * from mytable where create_date >='...' and create_date <='' > > can I create a index on the column create_date? Have you tried it? > what is the best practise? Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, Nexu

Re: when rebuilding keys?

2007-04-11 Thread Martijn Tonies
> before load data. You want to rebuild the indices after loading data, correct? Martijn Tonies Database Workbench - development tool for MySQL, and more! Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! h

Re: dumpfile question

2007-04-11 Thread Wm Mussatto
On Tue, April 10, 2007 19:45, Paul DuBois said: > At 10:15 AM +0800 4/11/07, wangxu wrote: >>follow is my sql: >> >> >> >>select * into dumpfile '/home/wangxu/test4.data' from mytable ; >> >> >> >> >> >>mysql server report: Result consisted of more than one row >> >> >> >>why?how to use the "select

RE: Join & update help

2007-04-11 Thread Jerry Schwartz
I think you want a subquery. Something like UPDATE t1 SET last_login_time = (SELECT MAX(logintime) FROM t2 WHERE t1.userid = t2.userid); would be a good start. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 >

Re: when rebuilding keys?

2007-04-11 Thread wangxu
before load data. - Original Message - From: "Martijn Tonies" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; Sent: Wednesday, April 11, 2007 7:45 PM Subject: Re: when rebuilding keys? > > > >> My table is myisam. >> >> I disable key using "alter table ... disable keys" before load data

Re: triggers

2007-04-11 Thread Andrew Dashin
Hi, ch Probably you should look here http://dev.mysql.com/doc/refman/5.0/en/cursors.html -- Andrew Dashin ch h пишет: In a trigger I need to iterate thru a query result that will consist of more than 1 row. Could someone please give me a general example of how this would be accomplished. For

Can I create a index on a column of Type datetime?

2007-04-11 Thread wangxu
I will very often do query like this: select * from mytable where create_date >='...' and create_date <='' can I create a index on the column create_date? what is the best practise? Thanks, shell. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscrib

Re: when rebuilding keys?

2007-04-11 Thread Martijn Tonies
> My table is myisam. > > I disable key using "alter table ... disable keys" before load data in the table. > > The manual tell me MySQL to stop updating non-unique indexes for a MyISAM table. > > When mysql server updating non-unique index after loading data? When you run ALTER TABLE ... ENABL

triggers

2007-04-11 Thread ch h
In a trigger I need to iterate thru a query result that will consist of more than 1 row. Could someone please give me a general example of how this would be accomplished. For example in php i would just use while($row = $result->fetch_assoc) { ..process the row } I have no

Join & update help

2007-04-11 Thread Ravi Kumar.
Dear All, I have two tables T1 and T2. T1 has these columns: userid, password (userid is primary key) T2 has these columns: sessionid, userid, logintime, logofftime (sessionid is primary key) I wish to add one column in T1 called last_login_time. I want to populate this new column with max(