Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

uname -a   
FreeBSD 8.3-i386-20120831 FreeBSD 8.3-i386-20120831 #0: Fri Aug 31 10:36:09 UTC 2012  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 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?

share|improve this question
up vote 1 down vote accepted

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

share|improve this answer
Yeah, there seems to be HTML in it. Here is as you asked: head betazone.sql -- phpMyAdmin SQL Dump -- version -- -- -- Host: -- 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 posting your answer, you agree to the privacy policy and terms of service.

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