MySQL Category

MySQL with skip-networking, binding a socket to TCP

In: General, MySQL

Recently I started migrating an old server, which had skip-networking within my.cnf, which is not a dynamic option and requires you to restart the mysql server.
I typically rsync the source code and static data to a new machine. Configure the webserver with the relevant vhosts and change the database connection details to point to the [...]

MySQL: LAST_INSERT_ID()

In: General, MySQL

If you use LAST_INSERT_ID() and insert on the primary key value it will only return the last “insert id” which has not included the primary key

DROP TABLE IF EXISTS `example`;
CREATE TABLE IF NOT EXISTS `example` ( id INT(11) NOT NULL AUTO_INCREMENT, b CHAR(3), PRIMARY KEY(id)) ENGINE=InnoDB;
INSERT INTO example SET id=1;
INSERT INTO example SET id=2;
INSERT INTO [...]

MySQL 5.0.51a-24+lenny2: Broken updates

In: General, MySQL

I have seen a problem with MySQL failing to update tables several times and despite having a valid UPDATE statement and data that should be modified after an update, there were no modifications made (not having any triggers enabled). As a quick example:

mysql> SELECT price_ask, price_bid, price_mid FROM instruments WHERE symbol = ‘A.N’\G
*************************** 1. row [...]

About this blog

Andrew Johnstone is a software engineer / lead developer working at Everlution Software.


Calendar

September 2010
M T W T F S S
« Jul    
 12345
6789101112
13141516171819
20212223242526
27282930