Category Archives: MySQL

Comparing two MySQL databases

When doing development, you’ll often have multiple versions of a database on different environments and sometimes it would be useful to be able to check the differences between the data. Did you know you can use the Toad database tool … Continue reading

Posted in Databases and SQL, MySQL | Tagged | 1 Comment

Inserting large amounts of data into MySQL with LOAD DATA INFILE

Suppose you want to do some performance testing on your application and you want to insert a large number of database records, what is the fastest way to do it? You could write some Java code that creates a PreparedStatement … Continue reading

Posted in MySQL, Performance, Testing | Tagged , , | Leave a comment

Using group by without an aggregate function

It is interesting to find that in MySQL, you can write the following: select * from orders o join order_tender ot on ot.order_id = o.id group by o.id This doesn’t really make sense, since the purpose of “group by” is … Continue reading

Posted in MySQL | Tagged | Leave a comment

varchar and text data types in MySQL

Do you know the difference between the varchar and text types in MySQL? Up until MySQL 5.0.3, the varchar data type could only hold up to 255 characters, but from 5.0.3 onwards, it can store up to 65,535, which means … Continue reading

Posted in MySQL | Tagged | Leave a comment