Note: You are currently viewing documentation for Moodle 2.3. Up-to-date documentation for the latest stable version is available here: SQLite.

SQLite

From MoodleDocs
Revision as of 05:29, 22 October 2012 by Peter Kehl (talk | contribs)

SQLite is a serverless SQL database implementation. Moodle has experimental support for it. It is not recommended for production Moodle sites.

Moodle's SQLite driver requires SQLite PDO driver to be present in PHP. It won't work with native (non-PDO) SQL driver in PHP.

Configuring Moodle for SQLite

In Moodle 2.2.4 (Build: 20120706), you need to set the following parameters. It will work if you don't set the null values, but you'll get notices if you set PHP debug level to high. $CFG->dbtype= 'sqlite3'; $CFG->dblibrary= 'pdo'; $CFG->dbhost= null; $CFG->dbname= null; $CFG->dbuser= null; $CFG->dbpass= null; $CFG->dbprefix= 'mdl_'; $CFG->dboptions= array();

It needs to be fixed in 2.2.4. Whe installing, you get: Fatal error: Class sqlite_sql_generator contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (sql_generator::getCreateTempTableSQL, sql_generator::getDropTempTableSQL) in /var/www/html/elearning/lib/ddl/sqlite_sql_generator.php on line 458 Call Stack

  1. Time Memory Function Location

1 0.1071 318616 {main}( ) ../index.php:0 2 0.3405 17675936 install_core( ???, ??? ) ../index.php:174 3 0.3408 17676856 moodle_database->get_manager( ) ../upgradelib.php:1336

From old documentation: The other database parameters are not used. The database tables are stored in the 'moodledata' file area.

See Also