sql-info.de

MySQL Notes

1 | 2 | 3 | 4 | Index

December 1, 2004

MySQL | TIMESTAMP DEFAULT NOW()

A common problem in MySQL is the comparatively simple act of defining a TIMESTAMP column which has as its default value the timestamp at the time the record is created. In most databases this is simply a case of appending DEFAULT NOW() to the timestamp column.

Beginning with version 4.1.2 MySQL now supports this, albeit as an overlay to the slightly eccentric TIMESTAMP functionality, making life just that little bit easier.

Posted at 8:40 PM

The most prominent new feature of MySQL 4.1 is the introduction of subqueries (also known as subselects), a very welcome addition which brings MySQL's feature set a little closer to that of other databases.

Posted at 10:10 PM

It's possible to modify the way in which MySQL interprets certain parts of SQL, useful when porting queries from other databases. For example, the option PIPES_AS_CONCAT will persuade it to accept || as a concatenation operator rather than as a synonym for OR (see also gotcha 1.12). In 4.1 this facility has been extended considerably.

Posted at 8:52 PM

October 30, 2004

MySQL | MySQL 4.1 released

After a long testing period MySQL 4.1 has finally been declared production ready and is available for download. Representing a further incremental step in MySQL's steady advancement towards fully-fledged RDBMS-dom, it provides several sorely-missed features including sub-SELECTs.

Posted at 12:23 PM

October 25, 2004

MySQL | New forums at mysql.com

It looks like MySQL are moving their mailing lists to a forum-based solution, currently in beta-testing. Whether these will completely replace the lists, or provided an alternative web-based interface, isn't yet clear.

Posted at 6:40 PM

Having recently debugged a MySQL replication setup, I was having a hard time keeping track of which database was open in which mysql command line client, as since before the start of time the prompt has been a very terse  mysql> , giving no visual clue to which database is currently the default.

Fortunately, beginning with release 4.0.2 MySQL now provides a little-known option to set the prompt in a manner similar to that used in UNIX shells.

Posted at 7:07 AM

September 23, 2004

MySQL | SERIAL

While browsing the online documentation I came across this snippet:

From MySQL 4.1.0, the attribute SERIAL can be used as an alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE. This is compatibility feature.
Posted at 8:06 PM

September 10, 2004

MySQL | --i-am-a-dummy

I thought it was a joke when I first heard about it, but the MySQL command line client has this option where you can actually tell it you're stupid:

 mysql --i-am-a-dummy -uroot test
Posted at 9:09 PM

1 | 2 | 3 | 4 | Index