WordPress.org

Forums

[resolved] SQL Error Trying To Import Posts (7 posts)

  1. GatoGordo
    Member
    Posted 2 years ago #

    I'm relatively new to the platform, trying to export and import (via phpMyAdmin) a WordPress site on BlueHost's servers for local development. All the database tables seem to be exporting fine except _wp-posts_, which generates this MySQL error:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="icon" href="./favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" /> <title>phpMyAdmin</title> <link rel="stylesheet" type="text/css" href="phpmyadmin.css.php?server=1&token=6c15efb9727c32996dd34552f7011e4c&js_frame=right&nocache=5388229951" /> <link rel="stylesheet" type="text/css" href="print.css" media="print" /> <link rel="stylesheet" type="text/css" href="./themes/pmahomme/jquery/jquery-ui-1.8.custom.css" /> <meta name="robots" content="noindex,nofollow" /> <script src="./js/cross_framing_protection.js?ts=1344778698" type="text/javascript"></script> <script src="./js/jquery/jquery-1.4.4.js?ts=1344778[...]

    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 '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w' at line 1

    Any thoughts on what the right fix is?

  2. vtxyzzy
    Member
    Posted 2 years ago #

    What you show is not an sql export, it is an HTML document. You should try the export again.

  3. GatoGordo
    Member
    Posted 2 years ago #

    Thanks, re-exporting and importing the table structured it correctly and produced no errors.

    The locally hosted version of the site is still broken (can't access anything beyond front-page content), but that seems to be a separate problem and will call for a different support thread..

  4. vtxyzzy
    Member
    Posted 2 years ago #

    That was probably caused by embedded links and paths in the database. Here is an article with the steps that I use to migrate a site:
    http://wordpress.mcdspot.com/2012/08/22/migrating-a-wordpress-site-step-by-step/

  5. GatoGordo
    Member
    Posted 2 years ago #

    Thanks for your comment and link.

    I had run this script to try to take care of that potential problem:

    http://interconnectit.com/124/search-and-replace-for-wordpress-databases/

    Will try the Migrate DB Plugin.

  6. pk2516
    Member
    Posted 2 years ago #

    i have same problem after try to import MySQL database file
    and I got this messages

    ERROR: Unknown Punctuation String @ 1
    STR: <?
    SQL: <?php
    /**
    * The base configurations of the WordPress.
    *
    * This file has the following configurations: MySQL settings, Table Prefix,
    * Secret Keys, WordPress Language, and ABSPATH. You can find more information
    * by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
    * wp-config.php} Codex page. You can get the MySQL settings from your web host.
    *
    * This file is used by the wp-config.php creation script during the
    * installation. You don't have to use the web site, you can just copy this file
    * to "wp-config.php" and fill in the values.
    *
    * @package WordPress
    */

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define('DB_NAME', 'wrd_dm2gggaijo');

    SQL query:

    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 '<?php

    // ** MySQL settings - You can get this info from your web host ** //' at line 1

    If check from server information MySQL version is 4.1.22
    but if look from Cpanel system settings MySQL version is 5.0.91
    what can i do with this, I am very new to this stuff please someone help me
    thanks for any help

  7. esmi
    Forum Moderator
    Posted 2 years ago #

    Please post your own topic. Your problem - despite any similarity in symptoms - is likely to be completely different.

Topic Closed

This topic has been closed to new replies.

About this Topic