by Andrew Johnstone
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 [...]
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 [...]
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 [...]
Andrew Johnstone is a software engineer / lead developer working at Everlution Software.