mysql> create table t1 (id integer primary key auto_increment, name varchar(32) unique) engine=innodb;
b> select * from t1;
a> insert into t1 values(null, 'oldag');
b> insert into t1 values(null, 'oldag) on duplicate key update id=LAST_INSERT_ID(id);
(b is released)
Query OK, 0 rows affected (0.00 sec)
b> select * from t1;
Empty set (0.00 sec)
I was running an import script today taken from a mysqldump from another user, when I saw an error that looked like this:
ERROR 1005 (HY000) at line 123: Cant create table (errno: 150)
This is caused by a mysqldump or export process exporting tables in alphabetical order and not in the order in which they rely on one another. My tables had foreign keys which fail on import if the other table doesn't exist when you create the table with the key. In this case I was only importing six or eight tables so I simply opened the script in a text editor and re-ordered the import blocks. On a bigger scale a more technical solution might be required!
Lorna is an independent web development consultant, writer and trainer, open source project lead and community evangelist. This post was originally published at LornaJane
BusinessWeek reports MySQL continuing with their IPO preparations. As a long-time user (about ten years now), and almost as long-time customer (in many companies, obviously currently and most significantly Sulake and Habbo), I wish you guys the best of luck on that road. Don't lose your sight of the ballgame while doing that -- we need you to continue to do better with the product itself while the distractions of investor communications will be great.
I'm sure we can all name a few nuisances in every software product we use, and I certainly have a few of those of the MySQL database, but what I really admire the guys for is their approach to innovating in the sales and[Read more...]
In a decade, on-demand virtualized utility computing will be an invisible utility, part of the vital infrastructure of the technological economy.
People will mostly have forgotten what an enormous pain in the ass provisioning computation was today. Today, we don't truly feel that pain, because it seems "normal", everyone has to suffer it together.
The situation right now is, if you have a delivery van, you have to make your own gasoline. And you have to hire and pay for your own mechanics. Seems stupid, doesn't it? It's amazing that there are any delivery vans at all …
Think of the internet itself, what it did to telecoms.
Twenty-five years ago, if you wanted a high speed data connection to a computer in San Francisco, it was a pain. You'd have to come up with a pile of money, and wait a couple of months, at best. Hardware would be dedicated and provisioned, and[Read more...]