MyBB Community Forums

Full Version: importing database: mysql query error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I try to import a backup from my forum database in phpMyAdmin I get the following error and the importing stops at the posts table. Anyone know why this is happening? Because right now I am unable to move or restore the database from a backup.

edit
Using latest MyBB software and tried to importing the database on my regular host and on a new host (which I will migrate to somewhere next week).
/edit

Quote:SQL query:

<!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&amp;token=991c03f5f2f5e9722244f903c9097e32&amp;js_frame=right&amp;nocache=5455946794" /> <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.16.custom.css" /> <meta name="robots" content="noindex,nofollow" /> <script src="./js/cross_framing_protection.js?ts=1356015781" type="text/javascript"></script> <script src="./js/jquery/jquery-1.6.2.js?ts=1356[...]

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


Here is a screenshot of the message:

[Image: Zrkjdqv.jpg]
Thanks, checked the topic. I am not trying to import a HTML file though Smile I have been trying to importing the .sql file I retrieved from exporting the database tables in phpmyadmin.

However, I tried it for the 4th time, but this time I used gzip compression on the export job, and this backup file is actually able to import the whole database.

Strange, but it seems to work. Thanks for looking into this Smile
Glad you are able to import the db.
Btw, for the next person, I think I know why it went wrong.

During the importing/upload process via phpMyAdmin (using cPanel) I logged in to a second cPanel account in the same browser with different login credentials. I believe this caused credential issues in which the import was discontinued on the first account and phpMyadmin tried to load the login page again because the credentials had changed and were incorrect.

At least, that's what I think happened, because I had to enter my login details again when this happened.
Good to you see got solution.