Showing entries 41466 to 41475 of 44049
« 10 Newer Entries | 10 Older Entries »
Foreign key constraints, DB for real

Now that I am a happy user of PHP5 and MySQL5 and using that for writing a new application, which fortunately involves using the newest technologies, I am finally able to solve one of the biggest issues I always had had with DB-driven applications: foreign key contraints.

Constraints and transactions
I am using InnoDB (I know those contraints had been possible before MySQL5) for that and the first time I am also using the foreign key constraints InnoDB provides. And it does make me happier :-). I don’t have to take care of updating and deleting all the referenced table rows myself, the DB’s storage engine does that for me, as I always had wanted it.

I had started out using MyISAM tables and triggers, but when I realized that I am programming the application using transactions I had to switch to InnoDB …

[Read more]
How to understand key length limitations in MySQL

Suppose I try to create a table with a primary key that’s varchar(500), and MySQL complains the key length is longer than the maximum of 1000 bytes. 500 is less than 1000. What’s happening? In this article I’ll explain why I, not MySQL, am wrong. Plus, I’ll show you a tasty (yet apparently harmless) bug in MySQL. Here’s a statement that will fail on my server: create table test(c varchar(250), d varchar(250), primary key(c,d)); ERROR 1071 (42000): Specified key was too long; max key length is 1000 bytes Why does it fail?

Personal status report: Crazy, but not stupid.. anymore

That's right, I'm a bit crazy, but not insane and also trying not to be stupid anymore! Have done that before, not again!

One year I have been with MySQL AB and it's great to have some normal working habits. Although, I'm learning quite a few things with me now specializing on MySQL Cluster, I have to be careful I'm not hooking myself into it to much. I rather keep my options open and look at other technology to work on too.

Meanwhile at home things are getting into place. I'm rather happy with how my life is now. I found out for myself it doesn't really matter to much where I live in this world: it's all good and the same shit. Dealing with the environment and making the most of it is what I do best I guess.

There are a few things I like to keep constant in my life.. These constants are slowly taking shape. But having hit the stone to often, I go easier on these things.

Till next status …

[Read more]
SQL Easter egg

There is a tentative Obfuscated SQL contest with one entry by Kai Voigt.

SELECT CONCAT(CONV(536,8,20), LPAD(EXPORT_SET(1,'Y','N','',1), 3, "P"), CHAR(32), HEX(234), UNHEX(594939469*POW(3,2)))

Not bad, but ... SQL without data ? Doesn't sound right.
Here's my take (requires MySQL 4.1 or later):

drop table if exists complex;
drop table if exists simple;
CREATE TABLE complex ( simple char(2), complex char(1)) ;
CREATE TABLE simple ( complex char(2), simple char(1));

INSERT INTO complex VALUES ('0','7'),('1','6'),('2','6'),('3','6'),('4','2'),
('5','7'),('6','7'),('7','7'),('8','6'),('10','7'),('11','7'),('12','2'), …
[Read more]
Sysadmin style hack: versioned database backup

Really Versioned Database Backup...
...Or abusing a version control system

I've always liked to keep my /etc configuration files in a source control system, since it both helps me document changes, as well as quickly roll back to an earlier date.

Then, I implemented some systems, such as web hosting and email configurations to reside inside a MySQL database, not to mention also some TikiWiki? sites.

Now, I wanted to have a versioned backup of the database... something that I could just dial to an arbitrary date, as well as see the changes.

How about mysqldump combined with p4 (Perforce) — Yes, I know subversion, cvs and bitkeeper might be polically more correct — but while I use all of them, I'm still fastest with p4, and it is available for free for up to 2 users and 5 clients.

So, here's a really simple script (use …

[Read more]
Sysadmin style hack: versioned database backup

Really Versioned Database Backup...
...Or abusing a version control system

I've always liked to keep my /etc configuration files in a source control system, since it both helps me document changes, as well as quickly roll back to an earlier date.

Then, I implemented some systems, such as web hosting and email configurations to reside inside a MySQL database, not to mention also some TikiWiki? sites.

Now, I wanted to have a versioned backup of the database... something that I could just dial to an arbitrary date, as well as see the changes.

How about mysqldump combined with p4 (Perforce) — Yes, I know subversion, cvs and bitkeeper might be polically more correct — but while I use all of them, I'm still fastest with p4, and it is available for free for up to 2 users and 5 clients.

So, here's a really simple script (use …

[Read more]
Sysadmin style hack: versioned database backup

Really Versioned Database Backup...
...Or abusing a version control system

I've always liked to keep my /etc configuration files in a source control system, since it both helps me document changes, as well as quickly roll back to an earlier date.

Then, I implemented some systems, such as web hosting and email configurations to reside inside a MySQL database, not to mention also some TikiWiki? sites.

Now, I wanted to have a versioned backup of the database... something that I could just dial to an arbitrary date, as well as see the changes.

How about mysqldump combined with p4 (Perforce) — Yes, I know subversion, cvs and bitkeeper might be polically more correct — but while I use all of them, I'm still fastest with p4, and it is available for free for up to 2 users and 5 clients.

So, here's a really simple script (use …

[Read more]
Sysadmin style hack: versioned database backup

Really Versioned Database Backup...
...Or abusing a version control system

I've always liked to keep my /etc configuration files in a source control system, since it both helps me document changes, as well as quickly roll back to an earlier date.

Then, I implemented some systems, such as web hosting and email configurations to reside inside a MySQL database, not to mention also some TikiWiki? sites.

Now, I wanted to have a versioned backup of the database... something that I could just dial to an arbitrary date, as well as see the changes.

How about mysqldump combined with p4 (Perforce) — Yes, I know subversion, cvs and bitkeeper might be polically more correct — but while I use all of them, I'm still fastest with p4, and it is available for free for up to 2 users and 5 clients.

[Read more]
Obfuscated SQL Contest

Try to evaluate this yourself first

I think Kai wins this one, hands down.

final prep on UC presentation (and new toy)

I bought a new toy yesterday (and about time I did). A Logitech presentation clicker thingy:

It has the laser pointer, the forward and backwards slide buttons and, arguably most interestingly, a built-in timer with vibrate alert.

What’s annoying is that the forward/back is done by page up and page down - and this doesn’t work for the “appear on click” thing for OO.org. Luckily for me, I just about never use that “feature” as the in version of OOo that Ubuntu ships in their stable release (5.04) is just too darn buggy in that area. I do sometimes wonder if people use the stable release of their product for any real work.

But it’s a nice little device and seems to be an improvement of the using the remote control feature of my phone to do the same thing (if you didn’t do …

[Read more]
Showing entries 41466 to 41475 of 44049
« 10 Newer Entries | 10 Older Entries »