Posts

Restore single MySQL table from a full mysqldump backup file

If you need to restore a single table from a full MySQL backup, you may find yourself wondering “how do I do that?”. There are a few steps required, I outline them here for you to restore the contents of just one table back into the database from the mysqldump using Bash.

Read more

How to optimize your WordPress hosting – 9+ practical tips

Isn’t it true that, when you (start to) develop WordPress websites for clients, and you host them yourself, you find yourself in a situation where you need to know a lot about “stuff” other than WordPress development? In this optimizing WordPress hosting post, I provide 9+ practical tips for you, to improve WordPress hosting performance. Especially useful if you plan to develop and host WordPress websites yourself.

Read more

MySQL InnoDB performance improvement: InnoDB buffer pool instances – Updated!

Are you running into MySQL load problems? Learn how how I tuned my MySQL servers for a heavy InnoDB workload, by configuring innodb_buffer_pool_instances. Dividing the InnoDB buffer pool into multiple instances improves Disk I/O. By doing so, you run your database and website more efficiently and faster. Here is a little help for you.

Read more

MySQL DoS in the Procedure Analyse Function – CVE-2015-4870

Sri Lankan Security researcher Osanda Malith discovered a DoS -or crash- vulnerability in MySQL’s Procedure Analyse Function. The vulnerability crashes MySQL versions up to 5.5.45.

Read more

Optimize WordPress MySQL tables through Cron, behind the scenes

To regularly optimize my WordPress database tables, I created a small plugin that utilizes the WordPress Cron feature. This comes in handy to perform database optimization for WordPress on a regular basis, without forgetting about it. Just activate and enjoy. And here is the plugin code …

Read more

Vevida Optimizer WordPress plugin

Installing WordPress is one thing, keeping it up to date is something else. Each week brings new bugs or potential attack scenarios that will make a WordPress website vulnerable to hacks. Enabling automatic updates for all or at least most parts of WordPress solves a large number of problems with irregularly maintained WordPress websites.

Read more

PHP, MySQL and IPv6: still slow

Years ago, I noticed that PHP connections to MySQL were significantly slower over IPV6 (where a hostname has an IPv6 address or AAAA record), when no MySQL service is listening on that address. The connection is refused, and PHP has to fallback to IPv4. The fallback takes a significant amount of time. Too much time if you’d asked me. Unfortunately this fallback to IPv4 is still slow today…

Read more

Migrate PHP ext/mysql to MySQLi

Convert ext/mysql to MySQLi how-to. This post will show you how to convert your old PHP mysql extension functions to PHP MySQLi extension. Migrating away from ext/mysql to MySQLi – or PHP Data Object (PDO) – is important, because the ext/mysql functions are deprecated as of PHP 5.5.0. If you do not update your PHP code, your website will fail soon!

Read more

How to restore a deleted Open-Xchange context?

How to restore, or recover, an accidentally deleted OX context. If you’ve accidentally deleted an Open-Xchange context (contextid), then that is bad… Here is how to recover a deleted OX context and filestore… Assuming you make backups of course.

Read more

How to disable WordPress comments

The WordPress comment system can be a bless for your blog, because of the user interaction. However, when the WordPress comment option is abused by spammers, it becomes a real pain in the “@ss”. With tens- or hundreds of thousands spam reactions, disabling WordPress comments – and removing – is the only way to go. Here is how to disable WordPress comments in both the WordPress Dashboard interface and in your MySQL database.

Read more

How to string replace on all WordPress posts in MySQL

Learn how to replace content in your MySQL database in bulk with MySQL REPLACE. Sometimes it’s useful to know how to bulk edit content in your WordPress MySQL database, using MySQL’s REPLACE() function. Here is how to string replace content in WordPress wp_posts table to bulk edit WordPress posts through MySQL.

Read more

MySQL sleep() attacks

MySQL sleep() command injection attacks: how not validating your PHP user input can lead to Denial of Service (DoS) attacks against websites and back-end database servers. Simply by putting “AND sleep(3)” in the address bar… Happy SQL injection!

Read more

MySQL database optimization with indices

Why MySQL indices are so important? At Vevida, we like to help our customers as much as possible. Even with optimizing a MySQL database when they don’t ask for it, or when a customer doesn’t know performance can be improved. For example by adding an index because we spotted a slow query in our slow-query log.

Read more

Convert MySQL MyISAM tables to InnoDB

In the earlier days of MySQL, the default storage engine for your database was MyISAM. This is also why you still encounter a lot of examples with engine=MyISAM online. Nowadays, the default storage engine is InnoDB, and MyISAM is no longer actively developed. Therefore, all MySQL performance optimizations are for InnoDB, and it’s recommended to switch to this as your table storage engine.

Read more

How to flush MySQL query cache from time to time

How to flush MySQL query_cache, to prevent fragmentation of free query cache memory space? Here is a how to for clearing MySQL’s cache unattended using a cronjob, and manually on the mysql shell.

Read more