[GNC] mysql setup in linux (debian)

gnu Gord gnucashgord at gmail.com
Mon Feb 1 13:36:13 EST 2021


Thanks to all that commented on this and thanks to the '/tmp/gnucash.trace'
file, I think I have discovered the problem.
It appears that mysql (or somewhere in the backend of gnuCash) does not
like a back slash character as the last character in a field. The data I
was trying to save had one entry with a 'notes' field that had a backslash
as the last character. The text was "2 books one for A one for\". It
appears when I save this as an XML file there is no problem but if I try to
save this as a mysql I get an error message. A backslash other than at the
end of the field does not appear to cause a problem.
BTW if I remove the backslash and successfully save to a mysql file and
then go back into the register GnuCash will not let me add a backslash to a
field. However, if I save it as an XML file the backslash is allowed.

Here are the relevant lines from the 'gnucash.trace' file:

* 09:09:43 ERROR <gnc.backend.dbi> [error_handler()] DBI error: 1064: You
have an error in your SQL syntax; check the manual that corresponds to your
MariaDB server version for the right syntax to use near '1970-01-01
00:00:00',0,1)' at line 1
* 09:09:43 ERROR <gnc.backend.dbi>
[GncDbiSqlConnection::execute_nonselect_statement()] Error executing SQL
INSERT INTO
slots(obj_guid,name,slot_type,int64_val,string_val,timespec_val,numeric_val_num,numeric_val_denom)
VALUES('c4f3c08454534822a2ff8cbb662b44cf','notes',4,0,'2 books one for A
one for\','1970-01-01 00:00:00',0,1)
* 09:09:43 ERROR <gnc.backend.sql>
[GncSqlBackend::execute_nonselect_statement()] SQL error: INSERT INTO
slots(obj_guid,name,slot_type,int64_val,string_val,timespec_val,numeric_val_num,numeric_val_denom)
VALUES('c4f3c08454534822a2ff8cbb662b44cf','notes',4,0,'2 books one for A
one for\','1970-01-01 00:00:00',0,1)
* 09:09:43 ERROR <gnc.backend.sql> [GncSqlTransBackend::commit()]
Transaction Chapters dated 2011-02-21 in account Gifts not saved due to
Slots save failed. Check trace log for SQL errors.


On Sun, Jan 31, 2021 at 9:14 PM Cam Ellison <cam at ellisonet.ca> wrote:

> On 2021-01-31 20:05, David Cousens wrote:
> > I don't have any experience of MySQL with GnuCash but I would try and
> > look at
> > logs for the MySQL server in  /var/log/mysql. If the problem is with
> > the
> > server rather than GnuCash itself, that may indicate it. Also check the
> > Gnucash,trace file ( https://wiki.gnucash.org/wiki/Tracefile) which
> > should
> > be in /tmp but is also located in /var/tmp on some systems.
>
> Looking in the logs will work only if logging is enabled, which in
> Debian it is not, by default. He'll have to set that.
>
> It is possible that the DB was saved correctly. 3.1M in XML is not very
> large, and I seem to recall encountering an error msg of some sort when
> I converted from XML. Using PHPMyAdmin or similar, or logging into mysql
> via CL as root should allow for determining whether the tables were
> created and loaded. Alternatively, try to load the DB as a new file.
>
> HTH
>
> Cam
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>


More information about the gnucash-user mailing list