Error in upgrade_from_array - mysql: 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 'myhandyrestaurant' at line 1


DROP TABLE IF EXISTS `mhr_accounting_dbs`

error 1064 filling tables

  • Have you looked at the MySQL documentation for DROP TABLE ? – Max Vernon Jan 24 '14 at 12:37

The upgrade_from_array message is not something "coming from" MySQL. That's coming from the application.

It looks like you are trying to install some very, very old software called "My Handy Restaurant" that hasn't been updated since 2005 and is only compatible in its current form with some ancient versions of MySQL... specifically, prior to MySQL 4.1... which, itself, is officially so old that its online documentation promises to still be available online "until December 31, 2010."

The source files of that project appear to have been generated from a server running version 4.0.23 (which was released December 18, 2004).

Even better, it looks like the software may also be mis-reporting the actual error, because the error message shown is not actually correlated to the query that it supposedly issued prior to encountering the error.

But if you get past that error, there's more fun in store.


A quick check of the source shows that they are using the obsolete TYPE declaration instead of ENGINE, which was documented in MySQL 4.1 as something that "likely will be removed in the future"... and, indeed, it was deprecated in MySQL 5.1 and removed entirely in MySQL 5.5...

Other obsolete code in this application includes invalid column definitions:

`timestamp` timestamp(14) NOT NULL,

...in fact, I seem to remember a question here about this exact same column definition very recently, though I'm not able to put my finger on it, now. I suspected it was from old MySQL but I didn't realize just how old. Again, pre-4.1.

In older versions of MySQL (prior to 4.1), the properties of the TIMESTAMP data type differed significantly in several ways from what is described in this section (see the MySQL 3.23, 4.0, 4.1 Reference Manual for details); these include syntax extensions which are deprecated in MySQL 5.1, and no longer supported in MySQL 5.5. This has implications for performing a dump and restore or replicating between MySQL Server versions. If you are using columns that are defined using the old TIMESTAMP(N) syntax, see Section, “Upgrading from MySQL 4.1 to 5.0”, prior to upgrading to MySQL 5.1 or later.


Unless you have access to a newer version of this software, your only viable option will be to learn the specifics of what it's doing wrong, and try to fix it yourself... but it doesn't look like you're up against something simple that you'll need to troubleshoot -- you're up against something that needs some potentially substantial rewrite.

Worse than any of that news, this particular software does not appear to be safe to use.

It uses the ancient and deprecated original PHP mysql connector API (note the "warning" in the red box).

It also includes a number of potential sql injection vulnerabilities, like this one:

$query="SELECT * FROM `#prefix#users` WHERE `id`='".$_REQUEST['userid']."'";

That's taking a parameter directly from the query string or form post and just dropping it right into a database query.

This software should not be used in this condition.

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.