The MU forums have moved to WordPress.org

Every new blog created causes a "Wordpress Database Error " (16 posts)

  1. suburbia
    Member
    Posted 17 years ago #

    Hey all, I have found many other users experiencing this problem, but no fix.. I am running version 1.0, and when I create a new blog I receive:

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

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

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

    Despite the error, the tables, etc are created, but very confusing for users, etc..

    Any ideas?

  2. plan-r
    Member
    Posted 17 years ago #

    Hey there,

    I'm having the same problem, but ONLY if I create a new blog through "Site Admin"-Backend.

    The problem does not appear if creating a new blog through the frontend as a "normal"/new user.

    Thx in advance for any ideas.

  3. suburbia
    Member
    Posted 17 years ago #

    Yes, I am experiencing the same.. no errors when a user creates one, just when I do in the backend

  4. andrea_r
    Moderator
    Posted 17 years ago #

    Known issue. :) Not sure if someone flagged it in trac or if the latest build fixes it.

  5. suburbia
    Member
    Posted 17 years ago #

    andrea: do you know if this is something fixed in the most recent nightly build or not? I will upgrade to it, but like the supposed *solid* public release,

    Nick

  6. andrea_r
    Moderator
    Posted 17 years ago #

    I just said I wasn't sure.

    I went and checked the trac and there is an open ticket on it.

  7. ovgray
    Member
    Posted 17 years ago #

    Look for the following at lines 179 and 180 of wpmu-functions.php:

    $wpdb->hide_errors();
    switch_to_blog($id);

    Change the order of those lines to

    switch_to_blog($id);
    $wpdb->hide_errors();

  8. raymond3402
    Member
    Posted 17 years ago #

    Well I tried that and still get same error. This is the error I receive with every new user account. Was hoping the fix would work :(

    WordPress database error: [Field 'category_description' doesn't have a default value]
    INSERT INTO wp_3_categories (cat_ID, cat_name, category_nicename, category_count) VALUES ('0', 'Uncategorized', 'uncategorized', 1)

    WordPress database error: [Field 'category_description' doesn't have a default value]
    INSERT INTO wp_3_categories (cat_ID, cat_name, category_nicename, link_count) VALUES ('2', 'Blogroll', 'blogroll', 2)

    WordPress database error: [Out of range value adjusted for column 'lang_id' at row 1]
    UPDATE wp_blogs SET lang_id = 'en', last_updated = NOW() WHERE blog_id = '3'

    Raymond....

  9. ovgray
    Member
    Posted 17 years ago #

    Raymond -

    The first two errors are odd. In wpmu 1.0, at least, the category_description field is defined as longtext. Text type fields cannot be assigned a default value in mysql, so I don't understand why mysql would be complaining that the field has no default value.

    As a matter of interest, how is the category_description field defined in your database?

  10. raymond3402
    Member
    Posted 17 years ago #

    First of all I am using mysql server 5.0 not sure if that has any bearing or not.

    In looking at the category_description field, all I can tell you is that TYPE is listed as LONGTEXT and length and values are not specified. Also it is set as NOT NULL and Collation is listed as UTF8_general_ci

    Hope that helps

    Raymond

  11. ovgray
    Member
    Posted 17 years ago #

    I'm not using mysql 5 yet. Perhaps the meaning of the error message is not that the column ought to have a specified default value (which it can't) but that it is a column without a default value that was not explicitly assigned a value in the INSERT statement.

    Section 13.2.4 of the online manual for mysql 5.0 says it will generate an error message in those circumstances if mysql is running in "strict mode."

    You might want to report that as a bug at trac.

    It appears from trac that the third of your error messages, the one about lang_id, is a known issue that was reported about a month ago: see ticket #178.

  12. raymond3402
    Member
    Posted 17 years ago #

    ok I really appreciate the help... hmm wonder if I should install a dif version of mysql then. Maybe I can turn off strict mode perhaps to see what would happen then as well. Well I changed it to where it is not in strict mode and still generated the error. I am wondering if I need to recreate the tables after this change or reinstall the software.

    Raymond

  13. ovgray
    Member
    Posted 17 years ago #

    You could downgrade mysql - I'm running WordpressMU on a test server with mysql 3.23.58 and it does not throw those errors.

    Otherwise, you could fix the bugs yourself (by revising the database and rewriting the pertinent queries) or you could wait for the bugs to be fixed.

  14. raymond3402
    Member
    Posted 17 years ago #

    Ya probably... I posted another topic about getting sql errors on posts as well but I noticed the error only showed up on one skin. So I think it was just the skin. I know this is off topic but I noticed on some skins the rss links are weird like they will show feed:http://blog.example.com/feed/ when it should be
    http://blog.example.com/feed/ Im not sure if this is a setting or if I need to modify the templates that cause this. Again I appreciate all your input. Thanks!

    Raymond

  15. andrea_r
    Moderator
    Posted 17 years ago #

    feed:http://blog.example.com/feed/ is in there on purpose. It's all web 2.0 enterprisey and stuff. Really newer broswers support it, for everyone else it just causes confusion. Feel free to edit those links in those themes.

  16. zappoman
    Member
    Posted 17 years ago #

    I've noticed this problem too. It's clearly related to MySQL 5.0. I have implemented a fix in my local copy of wpmu-functions.php as follows:

    Added category_description to the INSERT INTO calls on lines 1198 and 1204...

    So basically....


    $wpdb->query("INSERT INTO $wpdb->categories (cat_ID, cat_name, category_nicename, category_count, category_description) VALUES ('0', '".addslashes(__('Uncategorized'))."', '".sanitize_title(__('Uncategorized'))."', 1, '')");

    Notice I just set the description to ''.

    I looked at the solution suggested in trac, which essentially hides the error message. The problem with this is that it doesn't actually insert the default categories for the blog and then things get a little messy down the road. Users just see no categories and they may get confused.

    I haven't yet found a fix for the lang_id problem... that error may be "hideable" if you aren't supporting multi-language blogs.

About this Topic

  • Started 17 years ago by suburbia
  • Latest reply from zappoman