I made some backups yesterday and something went awry on the site today. That was cool - except the backup can't be restored The error message I get is

user warning: in /path/to/install/includes/database.mysqli.inc on line 134.

...

user warning: in /path/to/install/includes/database.mysqli.inc on line 134.

user warning: 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 '"3' at line 1 query: "3 in /path/to/install/includes/database.mysqli.inc on line 134.

...

user warning: in /path/to/install/includes/database.mysqli.inc on line 134.

user warning: 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 '\!K' at line 1 query: \!K in /path/to/install/includes/database.mysqli.inc on line 134.

...

user warning: in /path/to/install/includes/database.mysqli.inc on line 134.

user warning: 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 'W' at line 1 query: ,W in /path/to/install/includes/database.mysqli.inc on line 134.
...

user warning: in /path/to/install/includes/database.mysqli.inc on line 134.

The backup was made on the same version of B&M that I trying to import with. In previous years I was able to import a B&M file directly into the db using phpMyAdmin but got errors when trying to do that as well. What is the problem? I'm hoping I can still rely on B&M and that it is an issue with something I've done.

Comments

Bricks and Clicks Marketing’s picture

OK - there seems to be something up with B&M exports today. I was able to import successfully but only using the last B&M export from yesterday and phpmyadmin. Restore using B&M is not working at all.

Just now I setup another site and tried to import a B&M export of another site (that I'm trying to make a copy of) and this is the error from phpmyadmin:

Error
There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:
----BEGIN CUT----
eNpzDQryD7JScDZUcDZS8HH1s1IwUDBUsDTkCg4BCstzcTmHBVspqHimWCkUF+YUJBYVpxbp5WQm
6RVkFChYGhuaKxgZGJjpGljoGpopGJpbmRhZGRhGKeSk5loqqHD5VgYH+lgpmOoZ6Jmb6+bkp3OF
Bgcp+AfrKDi6u/qF6CiEuQJt8U1MVgh2dHMM8gSrNDU25QrwdbRSMNKz1DPiCvAIACnT8Q8GGWSk
B7TSJzOvtILLx9HP3UohNU+3tCRN14ILbJN8NwcDGDC/2fuy7I7FJI0/v78Ff3i903hb9ZaC077r
loZuu/M0M/pbRFH4957naYbGC32mzUgxOzllzatPlp8Vvu+7o5ZTYn2ynaNBxaMpOs8rck3wJFch
DoZGhxwOlr7/H/7PXLUs69TRm0s/HS/Pj+OL/1Px6+GXo09vtivWmtZ8fPb15s+n2+v/LH6z9VP7
4+f7rQFkAILc
----END CUT----
----BEGIN RAW----
ERROR: C1 C2 LEN: 0 1 91
STR: 

CVS: $Id: sqlparser.lib.php 9317 2006-08-16 17:42:01Z lem9 $
MySQL: 5.0.77-log
USR OS, AGENT, VER: Mac SAFARI 5.0.535
PMA: 2.9.2
PHP VER,OS: 5.2.17 Linux
LANG: en-utf-8
SQL: ����v�8�(���S���3�{�p�M��U���i[�XrW���f13�L��d6ɔ���9� ���<ɇ�$H�[nJY�S�E�@l�������j��٥��wo^_�x�����ه!}5|����������������;
----END RAW----

SQL query:

����v�8�(���S���3�{�p�M��U���i[�XrW���f13�L��d6ɔ���9� ���<ɇ�$H�[nJY�S�E�@l�������j��٥��wo^_�x�����ه!}5|����������������;

MySQL said: 

#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 '‹' at line 1 

Ideas on how to resolve this? I can't trust B&M backups from this particular install :/

Andy Langton’s picture

I'm having the same problem:

Multiple occurences of:

user warning: in [path]/includes/database.mysqli.inc on line 134.

Ocasional occurences of:

user warning: 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 '~' at line 1 query: ~ in [path]includes/database.mysqli.inc on line 134.

This makes backups from BM unuusable for me, also.

ronan’s picture

That sort of looks like raw compressed output. A few things could be happening:

1) The last part of the filename (gz, bz2, zip) is getting removed so B&M and phpMyAdmin aren't able to figure out that the file is compressed an so are not decompressing the file before importing.

2) You have mod_deflate or mod_gzip enabled on your server and that, in combination with Internet Explorer is double compressing the file on download.

3) The file is getting corrupted somehow so decompression is failing. This one is not as likely since both B&M and PMA would error out at the decompression stage if that were the case.

Do any of these sound right? Are your backups compressed, and if so what's the filename when you download them? Are you able to decompress them manually (using gzip or WinZip or whatever)

ronan’s picture

Status: Active » Postponed (maintainer needs more info)
Bricks and Clicks Marketing’s picture

The boss seems fine with the nightly backups that the ISP does, so I'm not looking further into this atm. I have not experienced it on any of my other sites, so I'm guessing there is something different about this server.

Bricks and Clicks Marketing’s picture

The boss seems fine with the nightly backups that the ISP does, so I'm not looking further into this atm. I have not experienced it on any of my other sites, so I'm guessing there is something different about this server.

ronan’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Ok, I'll close it for now. Reopen if you have any other info.

Andy Langton’s picture

As a footnote, I was able to restore an uncompressed backup, so compression does seem to be the culprit.

yorryk’s picture

Solution that works for me:
get sql file (say file.sql) from export with no compression
gzip it to file.sql.gz
then import.

yorryk’s picture

Issue summary: View changes

Removing about a million lines of the same error code from the description