#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0

    Trying to import a database but getting an error


    Hi

    First post on this forum. I moved a wordpress site to a new server. I've ftp'd all the files and when I tried to import the database via phpmyadmin I get this error:

    SQL query:

    -- phpMyAdmin SQL Dump
    -- version 3.5.8
    --
    --
    -- Host: localhost
    -- Generation Time: Aug 30, 2013 at 09:16 PM
    -- Server version: 5.1.70-cll
    -- PHP Version: 5.3.17
    SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"

    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 '-- phpMyAdmin SQL Dump
    -- version 3.5.8
    --
    --
    -- Ho' at line 1


    any ideas? Thanks.
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,204
    Rep Power
    4279
    looks like it doesn't like the comments

    you can safely remove all those lines
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by r937
    looks like it doesn't like the comments

    you can safely remove all those lines
    Ok. Looking at the database I see there are some very strange looking comments with random website links.... and some russian characters! I went into the admin area of wordpress but I dont see those comments to delete them.
    I just want to be careful editing the database itself. In the database the comments are wrapped in double quotes. Do I simply remove everything between the double quotes?

    By the way, do you think the site's been hacked? Looks like it to me.
  6. #4
  7. Wiser? Not exactly.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2001
    Location
    Bonita Springs, FL
    Posts
    5,953
    Rep Power
    4033
    By comments he is referencing the SQL comments, IE lines beginning with --. It has nothing to do with any comments on your blog posts.

    I'm not well versed in how wordpress handles deleting comments but probably rather than remove the delete comments from the database it just marks them as deleted. This would be why you see those spam comments in the SQL dump but not in the admin area.

    Delete just lines that begin with -- and do not change anything else. Try the import again when complete and see if it works.
    Recycle your old CD's, don't just trash them



    If I helped you out, show some love with some reputation, or tip with Bitcoins to 1N645HfYf63UbcvxajLKiSKpYHAq2Zxud
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by kicken
    By comments he is referencing the SQL comments, IE lines beginning with --. It has nothing to do with any comments on your blog posts.

    I'm not well versed in how wordpress handles deleting comments but probably rather than remove the delete comments from the database it just marks them as deleted. This would be why you see those spam comments in the SQL dump but not in the admin area.

    Delete just lines that begin with -- and do not change anything else. Try the import again when complete and see if it works.
    Thanks. Just one thing: I can see where the comment begins (--). I'm having trouble determining where the line ends. I'm not quite sure how much to remove. Is there something there to tell me "this is the end of the line"? Thanks.
  10. #6
  11. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,204
    Rep Power
    4279
    Originally Posted by Dgriff
    Is there something there to tell me "this is the end of the line"? Thanks.
    i would imagine the standard carriage-return-line-feed characters (hexadecimal 0D0A)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    4
    Rep Power
    0
    Well I sorted it without having to delete any comments. I just put this line at the very top:
    use db_name;

    Thanks for your help though.

IMN logo majestic logo threadwatch logo seochat tools logo