Title: Cache database not created
Last modified: December 15, 2016

---

# Cache database not created

 *  Resolved [dinel2016](https://wordpress.org/support/users/dinel2016/)
 * (@dinel2016)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/cache-database-not-created/)
 * I installed the plugin on several sites (on 2 different servers) and on none 
   of them the plugin did not create the cache database. I suspect it is due to 
   line
 * `1466 if (this->settings != null)`
 * when I enabled the debugging , I get following error:
 * `MendeleyPlugin::$settings in /home1/dinels/public_html/wp-content/plugins/mendeleyplugin/
   wp-mendeley.php on line 1466.`
 * I can get rid of the error by replacing the line with:
 * `if (isset($this->settings) && $this->settings != null)`
 * I guess the database is not created because of the error in init()
 *     ```
       function init() {
       	$this->getOptions();
       	$this->initializeDatabase();
       	$this->initFileCache();
       	load_plugin_textdomain('wp-mendeley');
       }
       ```
   
 * but I do not know how to force the plugin to create the database after I get 
   rid of the error above. Any idea?
 * Maybe you could add an option to delete and recreate the database for such extreme
   situations.
 * Related to this. How is it possible to contribute to this plugin with patches?
 * Thank you,
 * Constantin

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [kochm](https://wordpress.org/support/users/kochm/)
 * (@kochm)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/cache-database-not-created/#post-8558998)
 * Thanks for the feedback (and for the patch). I included the patch in the newest
   version of the plugin.
 * About your problem: I also included a change in the newest version that recreates
   the database tables when they have been deleted (or not created at all).
 * About contributions: You are highly welcome! There are two possibilities: The
   source code is available in a public GitHub repository – where you can contribute
   patches – I will be notified and will upload the updates to WordPress.org then.
   Or you “just” send your patches to me and I will include them in the next version
   of the plugin.
 *  Thread Starter [dinel2016](https://wordpress.org/support/users/dinel2016/)
 * (@dinel2016)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/cache-database-not-created/#post-8559332)
 * Hello,
 * Thank you for your prompt reply. Now I get an error in the syntax:
 *     ```
       WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARACTER SET=utf8 )' at line 8]
       CREATE TABLE wp_mendeleycache ( id mediumint(9) NOT NULL AUTO_INCREMENT, type mediumint(9) NOT NULL, mid tinytext NOT NULL, content longtext, time bigint(11) DEFAULT '0' NOT NULL, UNIQUE KEY id (id) DEFAULT CHARACTER SET=utf8 )
       ```
   
 * I believe the correct syntax is
 *     ```
       $sql = "CREATE TABLE " . $table_name . " (
         id mediumint(9) NOT NULL AUTO_INCREMENT,
         type mediumint(9) NOT NULL,
         mid tinytext NOT NULL,
         content longtext,
         time bigint(11) DEFAULT '0' NOT NULL,
         UNIQUE KEY id (id))
         DEFAULT CHARACTER SET=utf8
       ;".
       ```
   
 * This works fine on my server and the table gets created.
    -  This reply was modified 9 years, 5 months ago by [dinel2016](https://wordpress.org/support/users/dinel2016/).

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Cache database not created’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/mendeleyplugin.svg)
 * [Mendeley Plugin](https://wordpress.org/plugins/mendeleyplugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mendeleyplugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mendeleyplugin/)
 * [Active Topics](https://wordpress.org/support/plugin/mendeleyplugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mendeleyplugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mendeleyplugin/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [dinel2016](https://wordpress.org/support/users/dinel2016/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/cache-database-not-created/#post-8559332)
 * Status: resolved