WordPress with SQLite

WordPress with SQLite

WordPress is a free open source CMS (Content Management System) written in PHP and uses MySQL, WordPress is one of the most popular CMS, It does not support any other database other than MySQL, Due to a lack of support for any other Database, It sometimes turns into a problem when the user wants to have WordPress installed but does not have MySQL database for various reasons sometimes the Web Server is not powerful enough to handle MySQL or the hosting service does not offer MySQL in certain plans. Certain hosting service runs the MySQL database in a separate data center which can sometimes be slow to fetch the data or might slow the WordPress system completely on higher traffic.

Also read bout, My experience with WordPress SQLite.

How do we achieve this?

However, a WordPress plugin developer kjmtsh developed a plugin SQLite Integration which lets you run WordPress with SQLite, a file based alternative to MySQL which is faster, consumes lesser system resource. So now you can run WordPress with SQLite. _I have tried this plugin with a fresh WordPress install and did not try to migrate an existing MySQL based WordPress install. So I don’t recommend trying it on an existing WordPress install with MySQL.

Getting started

Get WordPress.

First, grab a copy of WordPress from here and expand the files in into Webroot or wherever your website source is stored.

Get the SQLite plugin

Update: Original author is no longer maintaining this plugin, you can get it from this GitHub repo or click this link here, to download the zip archive of the git repo.

Now get the SQLite integration plugin from here and expand the files.

Setting up and activating the plugin

Now place the SQLite Integration plugin folder in your wp-content/plugins directory.

Copy the db.php file found in the sqlite-integration folder to wordpress/wp-content folder.

Rename wordpress/wp-config-sample.php to wordpress/wp-config.php.

You can use these parameters to configure what the database should be named and where it should be located, by default the database is named .ht.sqlite stored in wp-content/database/

Extra setting options

SQLite database file name settings.

define('DB_FILE', 'your_database_name');  

Database storage directory

define('DB_DIR', '/home/youraccount/database_directory/');  

Visit your WordPress install and you should be greeted with a setup page.

You can enable the SQLite plugin on the plugins page and visit the Miscellaneous page and optimize the database every time there is a new plugin installed/removed or there is a need to do a database cleanup.

optimize will drop the size of the database by only keeping the required content of posts, pages, and plugins, this will improve the performance of WordPress overall.

Now you have WordPress running on SQLite installed on your system.

If you require patches or issue tracking visit here.

Leave a Reply

Your email address will not be published.