WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
NextGEN Gallery : Tables could not created, please check your database settings (42 posts)

  1. IestynR
    Member
    Posted 3 years ago #

    Hey - there seems to be quite a number of posts about this online, but none of them with a solution. Has anyone got any advice for a newbie here on how to use this awesome looking plug-in?

    After activating the plug-in, all I get is: NextGEN Gallery : Tables could not created, please check your database settings at the top, and my gallery wont work.

    I'm using WordPress version 3.0.1, and NextGEN 1.5.5. Any help would be much appreciated.
    Thank you
    - Iestyn

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. IestynR
    Member
    Posted 3 years ago #

    Anyone got anything on this? ANy help would be super awesome.

  3. DariusKM
    Member
    Posted 3 years ago #

    Experiencing the same issue.

    I'm using WordPress version 3.0.1, and NextGEN 1.6.0

    Couldn't find any solid answer to this so far :(

    Any thoughts would be appreciated
    Thanks,
    Darius.

  4. DariusKM
    Member
    Posted 3 years ago #

    To be exact, I have downloaded and installed nextgen-gallery 1.6.2 on my first wordpress installation on this machine, and it worked fine.

    Tried to install the plugin on my second wp website on the same machine. After activating I get the following message:

    "Please update the database of NextGEN Gallery. Click here to proceed."

    "NextGEN Gallery : Tables could not created, please check your database settings"

    when I click on the link I get the below message:

    "The script detect that you upgrade from a older version. Your database tables for NextGEN Gallery is out-of-date, and must be upgraded before you can continue. If you would like to downgrade later, please make first a complete backup of your database and the images.

    The upgrade process may take a while, so please be patient.

    Start upgrade now..."

    When click on "Start upgrade now..." it goes to next error message as below:

    Could not find NextGEN Gallery database tables, upgrade failed !

    Upgrade finished...

    I am hosting both versions locally (local.site.v1 $ local.site.v2)
    they have separate databases (wordpres £ mysiteV4)
    table_prefix for wordpres database is wp_
    table_prefix for mysiteV4 database is wpV4_

    ------------- ------------- ------------- -------------

    So far....

    I have deactivated the plugin on both sites and activated it on the second one only; didn't work!

    Tried also deleting and manually recreating the database tables as some suggested in following threads:

    http://wordpress.org/support/topic/nextgen-gallery-tables-could-not-created-please-check-your-database-settings-3?replies=9

    http://wordpress.org/support/topic/nextgen-gallery-tables-could-not-created-please-check-your-database-settings-1?replies=10

    also tried changing the database charset to latin1 and utf8 and back with no joy.

    ...and next I will probably plan banging my head against a solid wall :/

    thoughts would still be highly appreciated...

  5. Alex Rabe
    Member
    Posted 3 years ago #

    test if it only works for the prefix "wp_" normally I used the correct code, but this could be oone idea (maybe)

  6. DariusKM
    Member
    Posted 3 years ago #

    Thanks for the reply Alex,

    Here is what I did based on your suggestion:

    • Deactivated the plugin on both sites.
    • Manually created 3 database tables, with wp_ prefix based on the code in install.php for version 1.6.2 as follow:
      CREATE TABLE wp_ngg_gallery (
              gid BIGINT(20) NOT NULL AUTO_INCREMENT ,
              name VARCHAR(255) NOT NULL ,
              path MEDIUMTEXT NULL ,
              title MEDIUMTEXT NULL ,
              galdesc MEDIUMTEXT NULL ,
              pageid BIGINT(20) DEFAULT '0' NOT NULL ,
              previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
              author BIGINT(20) DEFAULT '0' NOT NULL  ,
              PRIMARY KEY gid (gid)
              );
      
      CREATE TABLE wp_ngg_album (
              id BIGINT(20) NOT NULL AUTO_INCREMENT ,
              name VARCHAR(255) NOT NULL ,
              previewpic BIGINT(20) DEFAULT '0' NOT NULL ,
              albumdesc MEDIUMTEXT NULL ,
              sortorder LONGTEXT NOT NULL,
              pageid BIGINT(20) DEFAULT '0' NOT NULL,
              PRIMARY KEY id (id)
              );
      
      CREATE TABLE wp_ngg_pictures (
              pid BIGINT(20) NOT NULL AUTO_INCREMENT ,
              post_id BIGINT(20) DEFAULT '0' NOT NULL ,
              galleryid BIGINT(20) DEFAULT '0' NOT NULL ,
              filename VARCHAR(255) NOT NULL ,
              description MEDIUMTEXT NULL ,
              alttext MEDIUMTEXT NULL ,
              imagedate DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
              exclude TINYINT NULL DEFAULT '0' ,
              sortorder BIGINT(20) DEFAULT '0' NOT NULL ,
              meta_data LONGTEXT,
              PRIMARY KEY pid (pid),
              KEY post_id (post_id)
              );
    • after tables were successfully created, activated the plugin on my local.site.v2 but still experiencing the exact same issue.
    • Next, i tried to find the code that leads to "Please update the database of NextGEN Gallery... " error.
    • Found the code in install.php as follow and commented it out (out of curiosity ;)
      // check one table again, to be sure
          if($wpdb->get_var("show tables like '$nggpictures'")!= $nggpictures) {
              update_option( "ngg_init_check", __('NextGEN Gallery : Tables could not created, please check your database settings',"nggallery") );
              return;
          }
    • ...And the plugin works! :)
    • I deleted the new tables with wp_ prefix, and the plugin still works!
    • Alex, thanks for the reply and most importantly thanks for writing such wonderful plugin.

      I am new to weordpress and php and I am already enjoying it very much :)

  7. IestynR
    Member
    Posted 3 years ago #

    Dang, this looks very complicated. Do you think you've got time to create a wee breakdown of everything you did Darius?

  8. DariusKM
    Member
    Posted 3 years ago #

    IestynR, in my case none of the above worked unfortunately, except the hacky bit.

    I would suggest try commenting out the below code in nextgen-gallery instal.php and see if it works for you too.

    // check one table again, to be sure
        if($wpdb->get_var("show tables like '$nggpictures'")!= $nggpictures) {
            update_option( "ngg_init_check", __('NextGEN Gallery : Tables could not created, please check your database settings',"nggallery") );
            return;
        }

    You can find this code in:

    wp-content / plugins / nextgen-gallery / admin / install.php

    I am sure this is not the best way to tackle this issue and hopefully alexrabe or another expert would come up with a proper solution.

    Best,
    Darius.

  9. Alex Rabe
    Member
    Posted 3 years ago #

    please note that such a workaround would causes problems for future versions

  10. Alex Rabe
    Member
    Posted 3 years ago #

    I offer to look into this issue if someone setup a testblog and contact me by mail

  11. Hniilo
    Member
    Posted 3 years ago #

    commenting the suggested part dos'nt work for me. :(
    Using WP 3.01. and Next-Gen 1.6.2

  12. odassis
    Member
    Posted 3 years ago #

    I think the problem has to do with case-sensitive comparison using "!=". My suggested "fix" would be:

    //if($wpdb->get_var("show tables like '$nggpictures'")!= $nggpictures) {
    	if(strcasecmp($wpdb->get_var("show tables like '$nggpictures'"),$nggpictures)!=0) {
  13. Alex Rabe
    Member
    Posted 3 years ago #

    Didn't understand the fix, what do you get in phpmyadmin if you request via SQL :

    SHOW TABLES LIKE 'wp_ngg_pictures'

  14. odassis
    Member
    Posted 3 years ago #

    I´m using a custom prefix "am" in wp tables (i'm running multiple blogs with custom prefixes). For me, the query returns "am_ngg_pictures", but variable $nggpictures contains "AM_ngg_pictures" and that´s the reason why the original comparison was failling. I don´t know if it's really a "fix", but it's working for me at the moment. Tell me if you want me to try something else or if you need more details about my wp configuration.

  15. Alex Rabe
    Member
    Posted 3 years ago #

    This means you define in the wp-config.php :

    $table_prefix = 'AM_';

    instead

    $table_prefix = 'am_';

  16. odassis
    Member
    Posted 3 years ago #

    Yes, it's defined in uppercase.

  17. Alex Rabe
    Member
    Posted 3 years ago #

    Ok, dig deeper into the MySQL settings and found out that this could be a real issue if you define a prefix with Case sensitive letters, the check will fail :

    http://dev.mysql.com/doc/refman/5.1/en/identifier-case-sensitivity.html

    Here is the patch for this case :

    http://code.google.com/p/nextgen-gallery/source/detail?r=823

  18. Alex Rabe
    Member
    Posted 3 years ago #

    @odassis
    Thanks for the hint, now I can reproduce it in the same way here.

  19. odassis
    Member
    Posted 3 years ago #

    Thanks for this great plugin.

  20. Hniilo
    Member
    Posted 3 years ago #

    Thanks for the fix :)

  21. DariusKM
    Member
    Posted 3 years ago #

    Thanks guys,
    All work fine now :)

  22. Alex Rabe
    Member
    Posted 3 years ago #

    Thanks for your feedback, I reworked the check a little bit, but it should do the same :

    http://code.google.com/p/nextgen-gallery/source/detail?r=824

  23. interzis
    Member
    Posted 3 years ago #

    hello,

    just for the records, I solved this issue by setting Auto-activating on and Mass activate

    these options are available through Plugin commander mod and I'm running in network mode

    hope will help,
    regards

  24. Darth NiN
    Member
    Posted 3 years ago #

    Nope...the fix didn't fix it...at least not for me...

    Lemme just check if I get it right. Updating "install.php" and "upgrade.php" to latest versions (the ones that u declare here) should do it...right? I've done so, but still get the "Tables could not created, please check your database settings"-error. Am I missing something here? Am I supposed to do something else?

    Thanks!

    ...eager to get this plugin to work as it seems like a VERY nice one! :)

  25. farmer paul
    Member
    Posted 3 years ago #

    I also updated install.php and upgrade.php with a patch I generated from r824, and tried the table upgrade again. Like Darth NiN, I got the same message - "Tables could not created, please check your database settings".

    We're using this plugin on a large number of WordPress sites and they all need to be upgraded...

  26. markb1439
    Member
    Posted 3 years ago #

    Hi,

    I am having a similar issue on multisite. NextGEN works fine on the main site and on any sub-sites that existed when the plugin was installed.

    But, on any newly-created site (with NextGEN set to activate automatically, via a plugin manager), users get:

    "Please update the database of NextGEN Gallery. Click here to proceed."

    They "click here" and nothing happens. There is no error message of any kind.

    I had originally used a mixed-case table prefix. But, I have since created an entirely new installation with only lower-case letters. And I still experience this.

    Please help if you can!

    Thanks!!!

    Mark

  27. Alex Rabe
    Member
    Posted 3 years ago #

    This topic describe a problem which happend when you use a mixed-case table prefix in a single setup (not multisite !)

    If you still have problems AND a multisite setup, please open a new thread as it's not related to this request. Thanks

  28. Kerdk
    Member
    Posted 3 years ago #

  29. judahstevenson
    Member
    Posted 3 years ago #

    Thanks for the fix, replacing the install.php and the upgrade.php files did the trick. I ran the upgrade but still received an error about the tables not being created. So I deactivated and re-activated the plugin and everything is working.

  30. sklena
    Member
    Posted 3 years ago #

    judahstevenson,

    please, could you send me your install.php and upgrade.php? I need fix it surely

    Thank´s a lot ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic