WordPress.org

Ready to get started?Download WordPress

Forums

String of non-fatal MySQL errors on wp-install (7 posts)

  1. smowton
    Member
    Posted 8 years ago #

    On running wp-install at http://www.smowton.f2s.com/clara/wp-admin/wp-install.php...

    (Host: Freedom2Surf. Database server: Mine. PHP: 4.2.2. MySQL: 5.0.16.)

    Here are the errors:

    WordPress database error: [Field 'link_notes' doesn't have a default value]
    INSERT INTO wp_links (link_url, link_name, link_category, link_rss) VALUES ('http://blog.carthik.net/index.php', 'Carthik', 1, 'http://blog.carthik.net/feed/');

    WordPress database error: [Field 'link_notes' doesn't have a default value]
    INSERT INTO wp_links (link_url, link_name, link_category, link_rss) VALUES ('http://blogs.linux.ie/xeer/', 'Donncha', 1, 'http://blogs.linux.ie/xeer/feed/');

    WordPress database error: [Field 'link_notes' doesn't have a default value]
    INSERT INTO wp_links (link_url, link_name, link_category, link_rss) VALUES ('http://zengun.org/weblog/', 'Michel', 1, 'http://zengun.org/weblog/feed/');

    WordPress database error: [Field 'link_notes' doesn't have a default value]
    INSERT INTO wp_links (link_url, link_name, link_category, link_rss) VALUES ('http://boren.nu/', 'Ryan', 1, 'http://boren.nu/feed/');

    WordPress database error: [Field 'link_notes' doesn't have a default value]
    INSERT INTO wp_links (link_url, link_name, link_category, link_rss) VALUES ('http://photomatt.net/', 'Matt', 1, 'http://xml.photomatt.net/feed/');

    WordPress database error: [Field 'link_notes' doesn't have a default value]
    INSERT INTO wp_links (link_url, link_name, link_category, link_rss) VALUES ('http://zed1.com/journalized/', 'Mike', 1, 'http://zed1.com/journalized/feed/');

    WordPress database error: [Field 'link_notes' doesn't have a default value]
    INSERT INTO wp_links (link_url, link_name, link_category, link_rss) VALUES ('http://www.alexking.org/', 'Alex', 1, 'http://www.alexking.org/blog/wp-rss2.php');

    WordPress database error: [Field 'link_notes' doesn't have a default value]
    INSERT INTO wp_links (link_url, link_name, link_category, link_rss) VALUES ('http://dougal.gunters.org/', 'Dougal', 1, 'http://dougal.gunters.org/feed/');

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

    WordPress database error: [Field 'post_excerpt' doesn't have a default value]
    INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_title, post_category, post_name, post_modified, post_modified_gmt) VALUES ('1', '2005-12-06 09:34:07', '2005-12-06 09:34:07', 'Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!', 'Hello world!', '0', 'hello-world', '2005-12-06 09:34:07', '2005-12-06 09:34:07')

    Warning: Invalid argument supplied for foreach() in /web/sites/213/smowton/www.smowton.f2s.com/wordpress/wp-admin/upgrade-functions.php on line 30

    When subsequently logging into the admin dashboard, I get an apparently working page preceded by

    Warning: Invalid argument supplied for foreach() in /web/sites/213/smowton/www.smowton.f2s.com/wordpress/wp-includes/functions.php on line 1161

    When logging into the blog proper, I get what you see at http://www.smowton.f2s.com/clara, including the error

    Warning: Invalid argument supplied for foreach() in /web/sites/213/smowton/www.smowton.f2s.com/wordpress/wp-includes/template-functions-category.php on line 311

    No categories

    As well as a remarkable absence of the default test post it looks like the script was trying to install!

    Thanks for any help you can give

    chris

  2. smowton
    Member
    Posted 8 years ago #

    Okay I've fixed some of this by manually mangling the database; the initial post now shows up once I specified values for 'post_excerpt', 'to_ping', 'pinged' and 'post_content_filtered'. Also I added a category using the dashboard, removing most of the errors. However, despite all this I still can't actually post anything! It just says "post saved: view site" and doesn't do a damn thing -- looking at the server, nothing goes into the wp-posts table though the software believes iself successful...

  3. smowton
    Member
    Posted 8 years ago #

    One last note: Looking at the DB command string in post.php for filling in the wp-posts table, it doesn't seem to specify a 'pinged' value. When I was manually entering the Hello World post, this was one of the fields it complained about not having a default value. Could this be the problem?

  4. smowton
    Member
    Posted 8 years ago #

    OK nevermind, fixed it. MySQL5 appears to have a "strict mode" in which it enforces such things. Since MySQL5 is going to become more and more common, shouldn't WordPress really support it?

  5. TheWino
    Member
    Posted 8 years ago #

    how did u fix it?

  6. TheWino
    Member
    Posted 8 years ago #

    im getting the same exact error

  7. RustIndy
    Member
    Posted 8 years ago #

    MySQL 5 strict mode enforces schema integrity. The problem with WordPress (indeed, most OSS written with MySQL in mind) is that it creates a database schema but then fails to adhere to it. In the past, MySQL only generated warnings when this occurred, but in strict mode it acts more like an enterprise database system and throws errors instead of warnings.

    There are three ways to fix this.

    First, do not use strict mode. But as smowton noted, it is far better to use strict mode since it enforces good code. There is, unfortunately, a lot of sloppy database code out there.

    Second, you can modify the database schema either by editing the WP installer/upgrade file, or directly modifying the database after installing.

    Third, and this would be the preferred method I think, you can go through the source and correct the SQL commands that cause the errors.

    So that you know, the current betas of WP 2.0 install just fine in strict mode, although commenting is currently broken due to the same issue (bad INSERT syntax in the WP codebase). HOPEFULLY, this will be fixed in the final 2.0 release, especially since there is already a patch on the trac site that fixes commenting in strict mode.

Topic Closed

This topic has been closed to new replies.

About this Topic