Been trying to import a WordPress database using the command line on a FreeBSD server:

uname -a   
FreeBSD host.com 8.3-i386-20120831 FreeBSD 8.3-i386-20120831 #0: Fri Aug 31 10:36:09 UTC 2012     root@domain.com:/usr/obj/i386/usr/src/sys/SERVER8-I386  i386

as I had to many time-outs using PHPMyAdmin as it is a large file I guess . Importing using the CLI command

mysql -u user_wp -p -h subdomain.mysql.host.com database --default_character_set utf8 < betazone.sql

I got

ERROR 1064 (42000) at line 38316: 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

There I have:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

Any ideas how I can get around this error. Earlier dump using WP DB Backup got imported, but it mangled Russian and some special characters and an import with --default utf8 did not work so I tried a PHPMyAdmin dump and then I had this odd error.

Any ideas how to fix this?


Looks like this is not a dump, or something prepend it. Let us take a look to head betazone.sql

  • Yeah, there seems to be HTML in it. Here is as you asked: head betazone.sql -- phpMyAdmin SQL Dump -- version -- phpmyadmin.net -- -- Host: sub.mysql.domain.com -- Generation Time: Jan 14, 2013 at 12:56 PM -- Server version: 5.0.95 -- PHP Version: 5.3.3 Making and trying a new dump now just in case – rhand Jan 14 '13 at 10:14
  • New import was of correct size. Other missed data and therefore did not work. All seems to be OK now and encoding is OK as well. – rhand Jan 14 '13 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.