The MU forums have moved to WordPress.org

WordPress database error ... wp_2_options doesn't exist (24 posts)

  1. modifiedcontent
    Member
    Posted 15 years ago #

    I've just switched from Nucleus CMS after three years to Wordpress.

    The installation seems to have gone OK, apart from this database error when I create a new blog:

    WordPress database error: [Table 'mydatabase.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'blogname' LIMIT 1

    WordPress database error: [Table 'mydatabase.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'siteurl' LIMIT 1

    WordPress database error: [Table 'mydatabase.wp_2_options' doesn't exist]
    SELECT option_value FROM wp_2_options WHERE option_name = 'post_count' LIMIT 1

    I think I saw the same database error after install, but with wp1_options. The second blog I tried to create had this error with wp_3_options, etc.

    There are tables named wp_1_options etc. in mydatabase now and the created blogs seem to work fine.

    What's going on? How can I get rid of the ugly error messages?

  2. kuopassa
    Member
    Posted 15 years ago #

    I have exactly the same problem. Blogs can be created, but that above-mentioned error message appears. Blogs are created in sub-directorys (like "http://domain.com/blogname").

  3. modifiedcontent
    Member
    Posted 15 years ago #

    I chose the sub-directories option as well. Am I being punished for that? ;-)

  4. mkoerner
    Member
    Posted 15 years ago #

    I got this too. Anyone got a fix for this. And when I try yo login I get a page cannot be displayed error.

  5. modifiedcontent
    Member
    Posted 15 years ago #

    And when I try yo login I get a page cannot be displayed error.

    Not 100% sure what you mean. I see no problems logging in.

  6. mkoerner
    Member
    Posted 15 years ago #

    Its when I try to log on as admin.

  7. mkoerner
    Member
    Posted 15 years ago #

    When I try to login as admin it takes me to this page. http://xboxshogun.com/wp-login.php and I get a page cannot be displayed.

  8. modifiedcontent
    Member
    Posted 15 years ago #

    I have the same link, but it works fine. Even your link works fine on my computer. Not sure what the problem is, but it has nothing to do with the original subject of this thread.

  9. mkoerner
    Member
    Posted 15 years ago #

    Well i got that same error when I installed it on my server.

  10. modifiedcontent
    Member
    Posted 15 years ago #

    I posted a question about a database error. kuopassa had 'exactly the same problem'. That's the problem I hope to find a solution to.

    I'm not sure what went wrong in your case, but it works fine on my computer, both my installation and yours. I don't want that problem to hijack/confuse this thread.

  11. modifiedcontent
    Member
    Posted 15 years ago #

    I tried reinstalling with the subdomain option, but I got the same result:

    WordPress database error: [Table 'mysdatabase.wp_1_options' doesn't exist]
    INSERT INTO wp_1_options (option_name, option_value, option_description, autoload) VALUES ('template', 'default', '', 'yes')

    WordPress database error: [Table 'mysdatabase.wp_1_options' doesn't exist]
    INSERT INTO wp_1_options (option_name, option_value, option_description, autoload) VALUES ('stylesheet', 'default', '', 'yes')

    Does this have anything to do with "mod_rewrite" that needs to be enabled? What the hell is that anyway? That requires more explanation imho...

  12. kahless
    Member
    Posted 15 years ago #

    mod_rewrite is an Apache module. It can be activated by finding your httpd.conf file and looking for mod_rewrite (there may be two occurrences depending on Apache version I think) if it has # in front remove the # and restart Apache. If there is no # then it is already installed. If you have a webhost then they most likely have mod_rewrite enabled already.

  13. modifiedcontent
    Member
    Posted 15 years ago #

    Thanks kahless. I have a webhost and do expect them to have it enabled, but I tried this in an info.php file on the server:

    <?php phpinfo(); ?>

    ...and I didn't see mod_rewrite anywhere.

    Can I eliminate it as possible cause for the database error?

    Does anyone have any clue what causes that error? I'm stuck if I can't find a solution and I'm not the only one who reported it...

  14. kuopassa
    Member
    Posted 15 years ago #

    I too deleted previous WordPress Multi -installation and reinstalled whole system, and now... Everything seems to work just fine! No more error messages nor misssing database tables.

    Don't know accurately what happened, so that might not help modifiedcontent much. In my case blogs are still created in subdirectories and database tables' prefix is wp_.

  15. modifiedcontent
    Member
    Posted 15 years ago #

    Thanks for the info kuopassa.

    I don't use a database tables prefix, because I don't need one. But that can't be it, can it?

    I'll just try deleting/reinstalling a couple of times and see what happens...

  16. drmike
    Member
    Posted 15 years ago #

    Modified, your best bet would be to contact your webhost and flat out ask them. That's what they are there for and we're just wasting time (no offense) playing guessing games here.

    Please also check and list here what your MySQL and PHP versions are.

  17. andrea_r
    Moderator
    Posted 15 years ago #

    And when you reinstal, do it clean: drop all db tables, nuke the wp-config file.

    Also? Try the latest version.

  18. modifiedcontent
    Member
    Posted 15 years ago #

    I reinstalled with the latest version and everything works fine now. Thanks everyone! :-)

  19. pchristmann
    Member
    Posted 15 years ago #

    I'm still encountering this problem. I've done a clean install of Wordpress 2.0.3 on a W2K server; I've just upgraded MySQL to 4.1.20 (latest GA of the 4.1 branch); I've upgraded to PHP 5.1.4. So, I'm as up-to-date as I can possibly be. I've tried enabling and disabling mod_rewrite (though I don't know why that would affect anything).

    I've changed the database name and prefix several times. I can log in as the wordpress user and manually create database tables, so I don't think there is a permissions problem.

    I've found many posts describing this problem (dating back to 2004!), but no post (yet) offering a resolution to it (short of one that put the blame on ioncube php accelerator, which I don't appear to have installed).

    Anyone have any ideas what the root cause is?

    Thanks,

  20. pchristmann
    Member
    Posted 15 years ago #

    I've learned a little more, that I think is relevant. The errors are coming from the get_setting function in wp-include/function.php. This method attempts to query the database looking for settings. But, during the installation process, the database doesn't exist yet. So the actual db query stuff is surrounded by hide_error/show_error if WP_INSTALLING is defined.

    The very first line of wp-admin/install.php defines WP_INSTALLING. But, that line never appears to get invoked. If I stick a die("foobar") just before it, I don't reach that line. Apparently, some other php script is getting invoked that drags in wp-config/wp-settings which in turn invokes the get_settings method. And, importantly, WP_INSTALLING isn't defined.

    (In fact, if I remove all of install.php and replace it with just a simple phpinfo() method, I get the same behavior.)

    So - any ideas how/what php is getting invoked?

  21. pchristmann
    Member
    Posted 15 years ago #

    Finally found an answer!

    I needed to include these in my apache configuration file:

    <Directory WORDPRESS_HOME>
    DirectoryIndex index.php
    </Directory>

    <Directory WORDPRESS_HOME/wp-admin>
    DirectoryIndex index.php
    </Directory>

    I'm not sure what is going on (and if anyone can offer a clue, please chime in), but with that change (adding DirectoryIndex), I was finally able to configure WordPress appropriately.

  22. GGravett
    Member
    Posted 15 years ago #

    I'm having the same problem with wpmu v1
    The options table are not being created for new blogs

    It works fine with a nightly (wpmu-2006-10-04) on the my server.

  23. kenburcham
    Member
    Posted 14 years ago #

    I had this same problem. I fixed it by editing wp-includes/wpmu-functions.php and inserting:

    define( "WP_INSTALLING", true ); 

    on line 1182.

  24. drmike
    Member
    Posted 14 years ago #

    http://trac.mu.wordpress.org/changeset/952

    And please keep your WPMU install up to date.

About this Topic

  • Started 15 years ago by modifiedcontent
  • Latest reply from drmike