Re: Update queries

2007-02-02 Thread ViSolve DB Team
Try using CONCAT() ; mysql> update inventory_items set image_location=concat(item_number,'-1.jpg'); Thanks ViSolve DB Team. - Original Message - From: "Jerry Jones" <[EMAIL PROTECTED]> To: Sent: Saturday, February 03, 2007 12:00 PM Subject: Update queries I need to run a query th

Update queries

2007-02-02 Thread Jerry Jones
I need to run a query that will take the data from item_number field, add "-1.jpg" to the end of it, and store it in image_location I have tried update inventory_items set image_location = item_number + "-1.jpg"; but that just places the item number into the field, without the text in quotes. How

Re: How to SELECT rows closest to lat/lng -- USING SPATIAL FUNCTIONS

2007-02-02 Thread M5
Thanks for the reply... It returns results, but not exactly what I am hoping for--basically, I get the nearest latitudes (but not near longitude), and nearest longitude (but not near latitudes). In other words, it doesn't return the closest lat/lng pair... Also, the query takes about 8 seco

Repairing a table

2007-02-02 Thread Ian Barnes
Hi, Im having another problem with a large db. I have a 160Gig drive dedicated to the database partition and I have on database in particular that is taking up the space. My .MYD is 78Gig and my .MYI is 34 gig. Thats fine i have a couple of gig left, but whenever i try and do anything on it, the

Re: Update query question

2007-02-02 Thread ViSolve DB Team
Hi,, The Update query of yours will do fine.. otherwise try using string functions [instr()] like mysql> update inventory_items set name='necklace' where instr(description,'necklace')>0; Thanks ViSolve DB Team. - Original Message - From: "Jerry Jones" <[EMAIL PROTECTED]> To: Sent:

Re: How to SELECT rows closest to value

2007-02-02 Thread ViSolve DB Team
Hi, Try like this (SELECT * FROM (SELECT * FROM tab_name ORDER BY latitute ASC, longitude ASC) a WHERE a.latitude<=givenvalue AND a.longitude<=givenvalue LIMIT 0,5) UNION (SELECT * FROM (SELECT * FROM tab_name ORDER BY latitute ASC, longitude ASC) b WHERE b.latitude>givenvalue AND b.long

Re: MySQL to Postgres

2007-02-02 Thread ViSolve DB Team
Hi, From MySQL 4.1, there is a support for mysqldump --compatible option. There is a safe/cool dump for your table: Try lik: shell > mysqldump -u dev -p visolvetestdb credits --compatible=postgresql > /home/test/ps.sql And also, By default tables are dumped in a format optimized for MySQL.

Update query question

2007-02-02 Thread Jerry Jones
I am new to mysql. I am trying to do a simple update query to update a field based on the contents of another field in the same table. Here is what I have. update inventory_items set name = "necklace" where description like "%necklace%"; I am not sure what is wrong. select * from inventory_items w

How to SELECT rows closest to value

2007-02-02 Thread M5
Simply put, I have a table of ~800,000 records containing, among other things, latitude and longitude values. Given a lat/lng pair, I would like to SELECT from this table the 10 rows containing latitude/ longitude values closest to the given lat/lng pair. Possible? ...Rene -- MySQL General

MYSQL on windows -- Max number

2007-02-02 Thread Brown, Charles
Hello All. Is it possible to setup two instances of MySQL under windows? I am wondering because I would like to setup and test replication Thanks Charles This message is intended only for the use of the Addressee and may contain information that i

Re: mysqldump

2007-02-02 Thread Filip Krejci
Hi, add query SET @@foreign_key_checks=0; in the header of SQL dump file. Filip Phil Butterworth napsal(a): Hi, My problem is that when I use mysqldump, and I get the .sql file, If I try to load that into mysql, I usually have to edit the file to switch the create table order, because I

RE: Replication & LOAD DATA INFILE

2007-02-02 Thread Brown, Charles
During Replication the SLAVE reads data from its MASTER's log. Chances are LOAD DATA gets no logging -- I won't be surprised. -Original Message- From: Jesse [mailto:[EMAIL PROTECTED] Sent: Friday, February 02, 2007 9:44 AM To: MySQL List Subject: Replication & LOAD DATA INFILE I've just

max_allowed_packet in my.ini

2007-02-02 Thread abhishek jain
Hi friends, I am using mysql 5.0.23-nt on windows, i have to store large binary data in database, i have used setting like max_allowed_packet=16M in mysqld section of my.ini . Now i have a poblem that i want to create a setup so that the entry gets added itself into the my,ini , reason being i ne

Re: mysqldump

2007-02-02 Thread Kishore Jalleda
For a very fast reload of InnoDB tables you could try this Mysqldump ...>dump.sql Now edit the sql file so that these lines appear at the beginning SET AUTOCOMMIT=0; SET FOREIGN_KEY_CHECKS=0; and add these at the end SET FOREIGN_KEY_CHECKS=1; (re-enabled the checks) COMMIT; (actual

Re: mysqldump

2007-02-02 Thread Felix Geerinckx
[EMAIL PROTECTED] ("Phil Butterworth") wrote in news:[EMAIL PROTECTED]: > Is their a way to disable constraints for the new > tables, then when all the tables are created the FK's are put into > place, so no create table statement errors because of FK's, and no > editing the sql dump? SET FOREIG

RE: Questions about delete and optimize

2007-02-02 Thread Brown, Charles
Re: I can't say that I've tried this, It works like a champ we do every day in Oracle, DB2 and MySQL. It takes less time because you're bypassing logging thus reduce I/O and locking, etc. -Original Message- From: Jerry Schwartz [mailto:[EMAIL PROTECTED] Sent: Thursday, February 01, 20

MySQL to Postgres

2007-02-02 Thread Jim C.
I'm having to move some data from MySQL to Postgres. I used mysqldump --compatible=postgresql, but the compatibility is extremely lacking. I'm actually rather shocked that there doesn't seem to be a common open standard (XML?) in use for this sort of thing. Anyway, I'm having to line by line, tab

Re: SET @var and insert that as cunting var into table with insertselect

2007-02-02 Thread Barry
Dušan Pavlica schrieb: Barry napsal(a): Hello Everyone! I am having a big problem with counting inserting rows. This is my Query: SELECT MAX(id) INTO @maxid FROM table1; // @maxid is now 44 INSERT INTO table2 (orderid, someothervars) SELECT @maxid +1, blahvar FROM table3; try select @ma

Re: SET @var and insert that as cunting var into table with insert select

2007-02-02 Thread Dušan Pavlica
Barry napsal(a): Hello Everyone! I am having a big problem with counting inserting rows. This is my Query: SELECT MAX(id) INTO @maxid FROM table1; // @maxid is now 44 INSERT INTO table2 (orderid, someothervars) SELECT @maxid +1, blahvar FROM table3; try select @maxid:=max(id)-1 from tabl

Replication & LOAD DATA INFILE

2007-02-02 Thread Jesse
I've just performed a LOAD DATA INFILE on the master server, and I've waited a while now, and the data has not shown up in the SLAVE. Does Replication not handle LOAD DATA INFILE? Jesse -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://

RE: Password hash should be a 41-digit hexadecimal number

2007-02-02 Thread Brown, Charles
Try this: GRANT USAGE ON *.* TO 'openpne'@'locahost' IDENTIFIED BY 'openpne' ; Or try this: create user 'openpne'@'localhost' identified by password 'openpne'; - Spell domain correctly - there was a typo - put quote around userid and domain -Original Message- From:

Re: SET @var and insert that as cunting var into table with insert select

2007-02-02 Thread Barry
Barry schrieb: Hello Everyone! i forgot i am using MySQL 4.11 Greetings Barry -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL

SET @var and insert that as cunting var into table with insert select

2007-02-02 Thread Barry
Hello Everyone! I am having a big problem with counting inserting rows. This is my Query: SELECT MAX(id) INTO @maxid FROM table1; // @maxid is now 44 INSERT INTO table2 (orderid, someothervars) SELECT @maxid +1, blahvar FROM table3; Okay my problem is, how do i increase the maxid? like that

Re: rounding digits after decimal sign

2007-02-02 Thread Christian Hammers
On 2007-01-31 [EMAIL PROTECTED] wrote: > Can anyone point me to a section of manual or link how to reduce digits Lookup the manual for "round()" but be sure that you understand it if you use round in financial applications as it might be unexpected for you: mysql> SELECT 25E-1 = 2.5, round(25

Re: Password hash should be a 41-digit hexadecimal number

2007-02-02 Thread Felix Geerinckx
[EMAIL PROTECTED] ("Padmanabhan G") wrote in news:[EMAIL PROTECTED]: > mysql> create user [EMAIL PROTECTED] identified by password 'openpne'; > > Error 1372: Password hash should be a 41-digit hexadecimal number mysql> create user [EMAIL PROTECTED] identified by 'openpne'; -- felix -- MySQ

Password hash should be a 41-digit hexadecimal number

2007-02-02 Thread Padmanabhan G
hi Issuing the grant command yields an error: mysql> create user [EMAIL PROTECTED] identified by password 'openpne'; Error 1372: Password hash should be a 41-digit hexadecimal number -- With Thanks & Regards G. Padmanabhan -- MySQL General Mailing List For list archives: http://lists.mysql.