Category Archives: mysql

MySQL – The Name of the Table

Beware when renaming a table if there are other tables around that have foreign keys on the renamed table. Following case: we want to exchange some table against a better structured one but for some reason do not want to … Continue reading

Posted in howto, mysql | Leave a comment

MySQL hates you …

… if it is badly treated This post will show something about MySQL locks, transactions and autocommit. Before we start, here’s some useful stuff to know: You get the MySQL connection id with SELECT CONNECTION_ID(); You get information about use … Continue reading

Posted in howto, mysql | Leave a comment

MySQL partitions

Have a short look at mysql partitioning. Useful to handle large databases, you can even store partitions on different devices. I want to partition data on a (presumed to be) large table by timestamp, more precise I want a partition … Continue reading

Posted in mysql | Leave a comment

MySQL event scheduler

Pretty cool thing, the mysql event scheduler. Cron jobs inside MySQL. The MySQL event scheduler is off by default, you can switch it on by calling SET GLOBAL event_scheduler = ON; You could event do some automatic drop table if … Continue reading

Posted in mysql | Leave a comment

Fun with MySQL autoincrement

Imagine the following scenario: you have a table with an autoincrement primary key. Let’s name it id and assume it is an UNSIGNED INT. See http://dev.mysql.com/doc/refman/5.0/en/numeric-type-overview.html for details.  id can have values between 0 and 4294967295. Let’s set up some … Continue reading

Posted in mysql | Tagged , | Leave a comment