home
GnuCash Error and Solution (workaround)
I beat my head against a GnuCash error for hours and finally found a workaround. First, the error messages (italics are mine, of course):
This database is from an older version of GnuCash. Select OK to upgrade it to the current version, Cancel to mark it read-only.
The server at URL mysql://gnucash@localhost/gnucash experienced an error or encountered bad or corrupt data.
Re-saving user data... [This is what GnuCash says in the lower-right.]
[The /tmp/gnucash.trace shows:]
CRIT <gnc.backend.dbi> [mysql_error_fn()] DBI error: 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
Workaround steps:
- "Save As" your accounts in the "xml" "data format" (assuming you still have a working version; note that the file contents look nothing like XML)
- Backup the ~/.gnucash directory (in Linux)
- Delete the ~/.gnucash directory (otherwise you may confuse GnuC)
- Make sure the database does NOT exist
- Do NOT let GnuC create the database the first time around (not sure it matters, but this is what I did)
- Run GnuCash
- File->Open the "XML" file. (You may need to delete the ...xml.LCK file, first)
- Now create the database
- File->Save As to the database
If something goes wrong, you may have to loop through all of it again--deleting the .gnucash directory, get rid of the database, etc.
Versions involved:
- I started with version 2.3.10 (dated 2010-02-17). I don't know if it causes this error or not, because my goal was to move to another machine with a higher version.
- I first had problems with version 2.4.2.
- I upgraded to 2.4.7 (2011-10-04), but I had the same problem.
Page created 2011/10/04