Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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

query:

DROP TABLE IF EXISTS `mhr_accounting_dbs`

error 1064 filling tables

share|improve this question
    
Have you looked at the MySQL documentation for DROP TABLE ? –  Max Vernon Jan 24 at 12:37

1 Answer 1

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.

) TYPE=MyISAM;

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 2.19.1.2, “Upgrading from MySQL 4.1 to 5.0”, prior to upgrading to MySQL 5.1 or later.

http://dev.mysql.com/doc/refman/5.0/en/timestamp-initialization.html

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.

share|improve this answer

Your Answer

 
discard

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.