Archiv für den Monat November, 2011

Waiting for table metadata lock and PECL/mysqlnd_ms

Tuesday, November 29th, 2011

The MySQL administration SQL command SHOW PROCESSLIST may read "Waiting for table metadata lock" in its "State" column for a statement. The statement in question is waiting for another transaction to release a metadata lock. Its a state that may appear when using the global transaction ID injection feature of PECL/mysqlnd_ms 1.2.0-alpha. But only […]

PECL/mysqlnd_ms global transaction ID injection status

Tuesday, November 29th, 2011

Baby PECL/mysqlnd_ms 1.2.0-alpha, the PHP MySQL replication and load balancing plugin for mysqlnd, has done its first steps into the direction of global transaction id injection: injection happens, IDs can be queried. A simulated global transaction ids can be described as a transaction counter in a table on a MySQL replication master. Slaves connected to […]

Global transaction ID support for PECL/mysqlnd_ms

Wednesday, November 16th, 2011

The catchy theme/motto of the PECL/mysqlnd_ms 1.2 release will be Global Transaction ID support. Hidden behind the buzzword are two features. We will allow users to request a certain level of service from the replication cluster (keyword: consistency) and we will do basic global transaction ID injection to help with master failover. Failover refers […]

Consistency, cloud and the PHP mysqlnd replication plugin

Thursday, November 10th, 2011

Elastic, fantastic: click here to add a MySQL replication database cluster to your cloud configuration. Click - yes, we can! Just one little thing, you need to update your application: consistency model changed. Plan for it. Some thoughts for PECL/mysqlnd_ms 1.x, the PHP mysqlnd replication plugin.

Problem: C as in ACID is no more

A MySQL […]

Executing MySQL queries with PHP mysqli

Wednesday, November 9th, 2011

The mysqli quickstart series is coming to an end. Today, the post is about non-prepared statements. You may also want to check out the following related blog posts:

Using MySQL prepared statements with PHP mysqli
Using MySQL multiple statements with PHP mysqli
Using MySQL stored procedures with PHP mysqli

Using mysqli to execute statements

Statements can be executed by […]

Using MySQL with PHP mysqli: Connections, Options, Pooling

Tuesday, November 8th, 2011

Opening a database connection is a boring tasks. But do you know how defaults are determined, if values are omitted? Or, did you know there are two flavours of persistent connections in mysqli? Of course you, as a german reader, know it. I blogged about it in 2009 over at phphatesme.com (Nimmer Ärger mit den […]

Using MySQL multiple statements with PHP mysqli

Monday, November 7th, 2011

The series Using X with PHP mysqli continues. After notes on calling stored procedures and using prepared statements, its time for a multiple statement quickstart. A mighty tool, if used with care…

Using Multiple Statements with mysqli

MySQL optionally allows having multiple statements in one statement string. Sending multiple statements at once reduces client-server round trips […]

1.1.2-*stable* release of the replication and load balancing plugin for PHP!

Friday, November 4th, 2011

PECL/mysqlnd 1.1.2-stable has been released. The mysqlnd replication and load balancing plugin for PHP 5.3/5.4 finally got the download label it deserves: stable, ready for production use! PECL/mysqlnd_ms makes using any kind of MySQL database cluster easier.

Download PECL/mysqlnd from pecl.php.net
Documentation at the PHP Reference Manual

Key features

The release motto of the 1.1 series is “cover MySQL […]

Using MySQL prepared statements with PHP mysqli

Friday, November 4th, 2011

Starting with PHP mysqli is easy, if one has some SQL and PHP skills. To get started one needs to know about the specifics of MySQL and a few code snippets. Using MySQL stored procedures with PHP mysqli has found enough readers to begin with a “quickstart” or “how-to” series. Take this post with a […]

Using MySQL stored procedures with PHP mysqli

Thursday, November 3rd, 2011

A couple of weeks ago a friend of mine asked me how to use MySQL stored procedures with PHP’s mysqli API. Out of curiosity I asked another friend, a team lead, how things where going with their PHP MySQL project, for which they had planned to have most of their business logic in stored […]