Migration of DB from MySQL 4.0.20 to 4.0.24
I have a dump from a database in a FreeBSD box with MySQL version 4.0.20 and I am trying to import this dump to a mysql DB server which runs gentoo and a MySQL version of 4.0.24 but when I tried to do mysql dbname < dbname.mysql I get this error: ERROR 1060 at line 574: Duplicate column name 'dealer_type_id' Any clues? I was able to import this dump to a MySQL 4.0.24 in a box with Ubuntu. Thanks for your help
Re: Migration of DB from MySQL 4.0.20 to 4.0.24
My fault about not replying to the list. What is the cause of this extra line? is this a mysqldump bug in that older version of MySQL? how come I was able to export and import this DB in the same version but different platform? Any ideas? Thanks, cybm On 1/17/06, Gleb Paharenko <[EMAIL PROTECTED]> wrote: > > Hello. > > Sorry for such a late reply. The problem is in the duplicate line > `dealer_type_name`. Remove one of these lines. Please, always send > a copy of the message to the list. Most probably somebody whould have > suggest you the same, if you had posted you mail to the list as well. > > > > > Kuai > cybermalandro cybermalandro wrote: > > Sorry about that > > > > -- > > -- Table structure for table `dealer_type` > > -- > > > > CREATE TABLE `dealer_type` ( > > `dealer_type_id` int(11) NOT NULL auto_increment, > > `dealer_type_type` varchar(40) NOT NULL default '', > > `dealer_type_name` varchar(40) NOT NULL default '', > > PRIMARY KEY (`dealer_type_id`,`dealer_type_id`) > > ) TYPE=MyISAM PACK_KEYS=1; > > > > > > Here it is, thanks a lot for your help. > > > > Kuai > > > > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/[EMAIL PROTECTED] > >
update statements problem
I am trying to update a table with a file that has more than one update statements like this: UPDATE products set products_price="22.00" WHERE products_model="5217-01" OR products_model="521701" AND products_um="CS"; UPDATE products set products_price="3" WHERE products_model="5217-01" OR products_model="521701" AND products_um="PK"; UPDATE products set products_price="0.25" WHERE products_model="5217-01" OR products_model="521701" AND products_um="EA"; In the products table the only record that exist with product_model="5217-01" has a products_um="CS" not "EA" but when my which contains the update statements is executed the last statement is the one that actually makes the change therefore resulting in the record to be products_price=0.25 instead of 22. Any ideas why this is happening? Shouldn't this statements just match the record and make the update? is there another way to do this? Thanks!
Re: update statements problem
Hey guys! thanks a bunch that really fixed my problem. Thanks for your prompt response. cybm On 3/20/06, Johan Höök <[EMAIL PROTECTED]> wrote: > > Hi, > I think your problem is that OR and AND do not > have the same precedence, AND binds tighter. > So what you need is probably: > (products_model="5217-01" OR products_model="5217-01") AND > products_um="CS" and the same for "PK" and "EA". > > The way you have you'll get an update as soon as > products_model="5217-01" > > /Johan > > cybermalandro cybermalandro wrote: > > I am trying to update a table with a file that has more than one update > > statements like this: > > > > > > UPDATE products set products_price="22.00" WHERE > products_model="5217-01" > > OR products_model="521701" AND products_um="CS"; > > UPDATE products set products_price="3" WHERE products_model="5217-01" > OR > > products_model="521701" AND products_um="PK"; > > UPDATE products set products_price="0.25" WHERE > products_model="5217-01" OR > > products_model="521701" AND products_um="EA"; > > > > In the products table the only record that exist with > > product_model="5217-01" has a products_um="CS" not "EA" but when my > which > > contains the update statements is executed the last statement is the one > > that actually makes the change therefore resulting in the record to be > > products_price=0.25 instead of 22. Any ideas why this is happening? > > Shouldn't this statements just match the record and make the update? is > > there another way to do this? > > > > Thanks! > > > > > > > > > > > > No virus found in this incoming message. > > Checked by AVG Free Edition. > > Version: 7.1.385 / Virus Database: 268.2.5/284 - Release Date: > 2006-03-17 > > >
another update error
Ok now I am running this statement UPDATE products INNER JOIN products_ums ON products.products_id = products_ums.products_id SET products_ums.products_ums_price="552" WHERE ( products.products_model="2420-01" OR products.products_model="242001") AND products_ums.products_ums_um="EA"; and I am getting a 1064 error I am lost at this point. Your help would be appreciate it. Thanks, Kuai