Temporary In-Memory MySQL Server
Second instance of MySQL server in memory:
-
Modified MySQL init.d script that runs MySQL databases entirely out of tmpfs:
Performance tuning tips for Drupal 7 testing Script -
Ruby script to create MySQL instance in Ramdisk mezis/mrd
-
Bash script to start new MySql server instance into memory »
-
Offical solution: mysqld_multi. The simplest solution for more instances of same version. Using mysqld_multi to Manage Multiple Servers Enabling Multiple Mysql Instances on the Same Server Running multiple MySQL instances on MacOsX
-
MySQL Sandbox: a modern mysqld_multi. Looks great for multiple versions of a server. configuring MySQL Sandbox
Implementation
One time only
Our in-memory server should not expose to network. The only communication should
be socket. Therefore skip-networking
.
Prepare mysqld_multi
for work, but mysqld_multi
was not polished enough, so
I went for solution to write my init script.
Preparation:
To trick unit-tests into using my new MySQL server:
echo "pdo_mysql.default_socket=/tmp/mysql_temp.sock" >/etc/php5/fpm/conf.d/99-mysql_unittest_temp.ini
Setup
Cleanup:
rm -f /etc/php5/fpm/conf.d/99-mysql_unittest_temp.ini