MyBB Community Forums

Full Version: sql error when trying to import a backup through phpmyadmin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
when trying to run an import of a mybb database, I receive this error:


ERROR: Unknown Punctuation String @ 379
STR: </
SQL: 
	<style type="text/css">
		#mybb_error_content { border: 1px solid #B60101; background: #fff; }
		#mybb_error_content h2 { font-size: 12px; padding: 4px; background: #B60101; color: #fff; margin: 0; }
		#mybb_error_error { padding: 6px; }
		#mybb_error_footer { font-size: 11px; border-top: 1px solid #ccc; padding-top: 10px; }
		#mybb_error_content dt { font-weight: bold; }
	</style>
	<div id="mybb_error_content">
		<h2>MyBB SQL Error</h2>
		<div id="mybb_error_error">
		<p>MyBB has experienced an internal SQL error and cannot continue.</p><dl>
<dt>SQL Error:</dt>
<dd>2006 - MySQL server has gone away</dd>
<dt>Query:</dt>
<dd>OPTIMIZE TABLE mybb_privatemessages</dd>
</dl>

			<p id="mybb_error_footer">Please contact the <a href="http://mybb.com">MyBB Group</a> for support.</p>
		</div>
	</div>


SQL query:

<style type="text/css"> #mybb_error_content { border: 1px solid #B60101; background: #fff; } #mybb_error_content h2 { font-size: 12px; padding: 4px; background: #B60101; color: #fff; margin: 0; } #mybb_error_error { padding: 6px; } #mybb_error_footer { font-size: 11px; border-top: 1px solid #ccc; padding-top: 10px; } #mybb_error_content dt { font-weight: bold; } </style> <div id="mybb_error_content"> <h2>MyBB SQL Error</h2> <div id="mybb_error_error"> <p>MyBB has experienced an internal SQL error and cannot continue.</p><dl> <dt>SQL Error:</dt> <dd>2006 - MySQL server has gone away</dd> <dt>Query:</dt> <dd>OPTIMIZE TABLE mybb_privatemessages</dd> </dl> <p id="mybb_error_footer">Please contact the <a href="http://mybb.com">MyBB Group</a> for support.</p> </div> </div>

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 '&lt;style type=&quot;text/css&quot;&gt;
        #mybb_error_content { border: 1px solid #B60101; backg' at line 1 

here's a screenshot:
[attachment=23490]
MySQL server has gone away, that clearly shows that its your host issue. You'll need to ask about your host.
(2011-07-24, 03:14 AM)Yaldaram Wrote: [ -> ]MySQL server has gone away, that clearly shows that its your host issue. You'll need to ask about your host.

thanks, just opened a ticket a few minutes ago with my host. what's usually the cause of that error, if I may ask?
Its there host issue. They are probably upgrading their servers or doing routine maintenance.
(2011-07-24, 03:26 AM)Yaldaram Wrote: [ -> ]Its there host issue. They are probably upgrading their servers or doing routine maintenance.

I see. I'll await for their response.
Note that that backup is also broken past the privatemessages table, there won't be anything after that now, so you'll need a new backup.
It seems the error happened at the time the backup was made and made it into the backup file verbatim. As such the backup file itself is incomplete and broken.

If that is your only backup and you have no way of making a new / good one, and if you must restore the broken one no matter what, it might be possible. Since the error at privatemessages table, the posts table might be included and intact, whereas users and threads will be missing. I wrote a converter some time ago that can extrapolate users and threads from the posts table. I used it to fix someone else's broken backup some time ago: http://www.mybbcoder.info/thema-4546.html - please note that this was a quick job and never supposed to be end user friendly.

(Users still have to be given new passwords manually, though, as that information is lost).
this was a backup from a forum I just converted from phpbb to mybb. what I did was convert the phpbb forum with the mybb on the same server (not my server) then I was going to run the backup mybb database on my box since I didn't have the mysql server hostname during the initial conversion.

the only way I can currently get backups is through the mybb backend. is there an sql query I can run to fix the privatemessages table? I know there's mybb plugins where I can run sql queries in the backend.

I wanted to add that during the conversion, the server where the forum resides kept blacklisting me, so after every few operations, the server would boot me out for a few hours and then let me come back and rerun a few operations and then do the same thing. I contacted the host and they put my IP in the whitelist on their firewall. should I just rerun the converter again? I'm thinking maybe some of the conversion is corrupt.
(2011-07-24, 06:21 PM)Shemo Wrote: [ -> ]the only way I can currently get backups is through the mybb backend. is there an sql query I can run to fix the privatemessages table? I know there's mybb plugins where I can run sql queries in the backend.

The MyBB backup goes through the tables alphabetically, I think. So since it errored out on privatemessages for you, all other tables afterwards will be missing to.

If the backup cancels because it is too large, use the table selector in the MyBB backup form. Make a backup of the posts table only (that's probably the largest one), and then another backup of all MyBB tables except the posts table, and then on your other server import both backups to get the complete picture.

Quote:should I just rerun the converter again?

Only if the conversion is incomplete in some way. Your backup problem is not necessarily related to the conversion. It just looks as if the MySQL service on that server is unreliable.

It's a bug in MyBB as well (if the database breaks it should say so, not write the error into the backup file). Worst case someone thinks he has good backups when they are all broken...

(2011-07-24, 06:49 PM)frostschutz Wrote: [ -> ]
(2011-07-24, 06:21 PM)Shemo Wrote: [ -> ]the only way I can currently get backups is through the mybb backend. is there an sql query I can run to fix the privatemessages table? I know there's mybb plugins where I can run sql queries in the backend.

The MyBB backup goes through the tables alphabetically, I think. So since it errored out on privatemessages for you, all other tables afterwards will be missing to.

If the backup cancels because it is too large, use the table selector in the MyBB backup form. Make a backup of the posts table only (that's probably the largest one), and then another backup of all MyBB tables except the posts table, and then on your other server import both backups to get the complete picture.

ok, I'm trying what you said now.

(2011-07-24, 06:49 PM)frostschutz Wrote: [ -> ]
Quote:should I just rerun the converter again?

Only if the conversion is incomplete in some way. Your backup problem is not necessarily related to the conversion. It just looks as if the MySQL service on that server is unreliable.

It's a bug in MyBB as well (if the database breaks it should say so, not write the error into the backup file). Worst case someone thinks he has good backups when they are all broken...

I actually just reran the converter since I shouldn't get interrupted by the firewall anymore (which I didn't). I'm wondering if this edit is causing the problems:
http://dev.mybb.com/issues/1463

found from this thread:
http://community.mybb.com/thread-88588.html

as an aside, I ran the converter without getting interrupted, did a complete backup, and then uploaded it to my server and it's still hanging on the privatemessages table. I'm going to try doing what you mentioned above.

edit, just backed up the posts table and tried to import it into my server and got the following error:

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 379
STR: </
SQL: 
	<style type="text/css">
		#mybb_error_content { border: 1px solid #B60101; background: #fff; }
		#mybb_error_content h2 { font-size: 12px; padding: 4px; background: #B60101; color: #fff; margin: 0; }
		#mybb_error_error { padding: 6px; }
		#mybb_error_footer { font-size: 11px; border-top: 1px solid #ccc; padding-top: 10px; }
		#mybb_error_content dt { font-weight: bold; }
	</style>
	<div id="mybb_error_content">
		<h2>MyBB SQL Error</h2>
		<div id="mybb_error_error">
		<p>MyBB has experienced an internal SQL error and cannot continue.</p><dl>
<dt>SQL Error:</dt>
<dd>2006 - MySQL server has gone away</dd>
<dt>Query:</dt>
<dd>
			INSERT 
			INTO dfsmybb_adminlog (`uid`,`ipaddress`,`dateline`,`module`,`action`,`data`) 
			VALUES ('2','69.249.155.86','1311534794','tools-backupdb','backup','a:1:{i:0;s:8:\"download\";}')
		</dd>
</dl>

			<p id="mybb_error_footer">Please contact the <a href="http://mybb.com">MyBB Group</a> for support.</p>
		</div>
	</div>


SQL query:

<style type="text/css"> #mybb_error_content { border: 1px solid #B60101; background: #fff; } #mybb_error_content h2 { font-size: 12px; padding: 4px; background: #B60101; color: #fff; margin: 0; } #mybb_error_error { padding: 6px; } #mybb_error_footer { font-size: 11px; border-top: 1px solid #ccc; padding-top: 10px; } #mybb_error_content dt { font-weight: bold; } </style> <div id="mybb_error_content"> <h2>MyBB SQL Error</h2> <div id="mybb_error_error"> <p>MyBB has experienced an internal SQL error and cannot continue.</p><dl> <dt>SQL Error:</dt> <dd>2006 - MySQL server has gone away</dd> <dt>Query:</dt> <dd> INSERT INTO dfsmybb_adminlog (`uid`,`ipaddress`,`dateline`,`module`,`action`,`data`) VALUES ('2','69.249.155.86','1311534794','tools-backupdb','backup','a:1:{i:0;s:8:\"download\";}') </dd> </dl> <p id="mybb_error_footer">Please contact the <a href="http://mybb.com">MyBB Group</a> for support.</p> </div> </div>

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 '&lt;style type=&quot;text/css&quot;&gt;
        #mybb_error_content { border: 1px solid #B60101; backg' at line 1

2nd edit- uploading everything except the posts table worked just fine:
Import has been successfully finished, 15078 queries executed.
Pages: 1 2