WordPress.org

Ready to get started?Download WordPress

Forums

BackUpWordPress
Error on database restore (7 posts)

  1. Pewit
    Member
    Posted 2 years ago #

    I tried to import the data backup into an existing WP database and received the error below. I also received the same error when I imported into a new database.

    The rest of the database seems to import OK. Any suggestions?

    MySQL Version 5.1.63-cll
    PHP version 5.2.17
    WordPress 3.4.1.

    SQL query:
    #
    # Data contents of table wp_eom_dates (1 records)
    #
    INSERT INTO wp_eom_dates
    VALUES ( 1, 1, 2012 -07 -1505 :52 :18, '2014-08-09 14:00:00', '2014-08-16 16:00:00' ) ;

    MySQL said: Documentation
    #1064 - 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 '05:52:18, '2014-08-09 14:00:00', '2014-08-16 16:00:00')' at line 5

    http://wordpress.org/extend/plugins/backupwordpress/

  2. Pewit
    Member
    Posted 2 years ago #

    The full SQL statement in the SQL backup file is

    #INSERT INTO wp_eom_dates VALUES (1, 1, 2012-07-15 05:52:18, '2014-08-09 14:00:00', '2014-08-16 16:00:00')

    There is a space between the date and time (2012-07-15 05:52:18) and yet somehow these are being interpreted as being one string in the import, hence (2012 -07 -1505 :52 :18) with no space between 15 and 05.

    What delimiter should be there or is there a workaround by removing the time and leaving the date alone?

    Or is there another error?

  3. Pewit
    Member
    Posted 2 years ago #

    The problem is some of the dates don't have single quotes around them.
    Now fixed and website back up.

    Is this an error caused by the backup process or by errors in the database?

  4. Tom Willmot
    Human Made
    Plugin Author

    Posted 2 years ago #

    Hmm, I'm not sure to be honest.

    Those are custom tables that I assume came from a plugin.

    Could you look at the plugin and see if it's create table syntax is correct?

    You could also try manually doing a database dump from the server and see if that has the same issues.

  5. fwchapman
    Member
    Posted 1 year ago #

    I am having exactly the same problem, and it is because the MySQL database dump created by BackUpWordPress does not enclose DATETIME values in delimiters. Every other site backup or site export method I've tried lately (cPanel, the Duplicator plugin for WordPress, the DesktopServer Premium development environment) quotes DATETIME values.

    Tom, can you please update BackUpWordPress to do the same? Based on what other backup software does, this seems to be standard practice.

    Thank you,

    Fred Chapman

  6. fwchapman
    Member
    Posted 1 year ago #

    CORRECTION

    I mistakenly assumed that datetime and timestamp values were treated the same way by this plugin, but that's not the case. I just double-checked a database backup which I created with this plugin, and datetime values are enclosed in quotes. It's timestamp values which are not enclosed in quotes, and that's what causes the syntax error when I try to import a database backup in phpMyAdmin.

  7. fwchapman
    Member
    Posted 1 year ago #

    WORKAROUND

    I developed a workaround for the unquoted timestamp problem and posted it here:

    http://wordpress.org/support/topic/workaround-importing-unquoted-timestamp-values

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic