Tag Archives: mysql

MySQL: Conditional Update

You learn something new every day. Here is a neat little SQL trick that I just learned. As usual, this post is mostly here for my future reference, and of course the overall good of the humankind. I hope someone … Continue reading

4 Comments

MySQL: Find Duplicate Entries in a Table

Here is a little background for this issue. The database used to run on ancient copy of MySQL until very recently we upgraded it to 5.0. Not without some headaches of migrating the database, but it worked. Common problem we … Continue reading

4 Comments

MySQL Admin 1.0.19: libmysqlx.dll Error

I noticed that on one of the servers the MySQL Admin was behaving weird. When you tried to inspect the schema of some tables by double clicking on it’s icon it would generate the following error: Access violation at address … Continue reading

Leave a comment

MySQL: Error 1005 Can’t create table (errno: 150)

This error has been driving me insane all morning. Every time I was trying to create a new InnoDB table with a foreign key constraint I would get the following error: Error 1005 Can’t create table ‘.\mydb\#company.frm’ (errno: 150) My … Continue reading

5 Comments

DST Readines Test for MySQL and PHP

Here is a quick and dirty way to see if the “MP” part of your LAMP or WIMP solution is ready for the DST time change. I tested all the production systems here today, and they seem to be working … Continue reading

3 Comments

MySQL no Longer Provides Free Binaries

This is really sad, but it appears that MySQL will no longer provide free binaries for their Community branch. From what I understand, the Community version will continue to be released as normal, and distributed under GPL, but MySQL will … Continue reading

7 Comments

MySQL: How to get the key of last inerted row in PHP

I like to let MySQL generate unique keys for most of my tables by making them numerical and using the AUTO_INCREMENT feature. It is both an easy and convenient way to deal with primary keys. It has one disadvantage though. … Continue reading

7 Comments

MySQL Performance Tips

I found this list today via Homo-Adminus, and I think it’s really worth sharing: 84 MySQL performance tips. Some of these are common sense (eg. index stuff, but don’t index everything), while other are little nuggets of awesome DBA knowledge … Continue reading

Leave a comment

MySQL: find week start/end given week number

I have a table with some dated records. I wanted to do some weekly reports on this data. MySQL has a nifty function dubbed WEEK() which will return a week number. It allows you to break your data into week … Continue reading

46 Comments

Dump MySQL table into CSV file

I needed to quickly dump bunch of MySQL tables into Excel so that our directors can play around with the data. It does make sense, believe me. It would take me at least a day or two to implement, test, … Continue reading

14 Comments

MINUS query in MySQL

Mysql does not support MINUS operator which is not the end of the world. For most queries you can really care less if it’s implemented or not. My web app never needs to use it to function properly, which makes … Continue reading

8 Comments