Error Connecting with MySql

Maf. King maf at chilwell.net
Mon Nov 13 11:22:27 EST 2017


Hi Mubasher,

did you also see the reply from John Ralls a couple of hours after I posted? 

He knows much more about GC than I do, and his reply suggested an alternative 
route for you.

sorry for the distraction,
Maf.



On Monday, 13 November 2017 13:25:16 GMT you wrote:
> Hi,
> 
> Thank you for Reply, However the Method You suggested to search "1970" in
> the xml file was not successful. As I did not found any such value. Please
> see my attached .gnucash file.
> I did exactly as you said. Even I created a new file with empty records but
> just default accounts. I am using the current month as starting financial
> period. however I was not able to save the accounts data in my sql. I
> checked the data base and there is infact gnucash database present with
> empty data but just table structures.
> Still getting the following error in trace file.
> 
> * 18:17:16  CRIT <gnc.backend.dbi> [mysql_error_fn()] DBI error: 1292:
> Incorrect datetime value: '19700101000000' for column 'timespec_val' at row
> 1
> * 18:17:16  CRIT <gnc.backend.dbi> [conn_execute_nonselect_statement()]
> Error executing SQL INSERT INTO
> slots(obj_guid,name,slot_type,int64_val,string_val,double_val,timespec_val,g
> uid_val,numeric_val_num,numeric_val_denom,gdate_val)
> VALUES('a45d5c866dc46a8f1a7cf3fc69409530','options',9,0,NULL,0,'19700101000
> 000','294bb3c78ecd0a60512614788b61f92c',0,1,NULL) * 18:17:16  CRIT
> <gnc.backend.sql> [gnc_sql_do_db_operation()] SQL error: INSERT INTO
> slots(obj_guid,name,slot_type,int64_val,string_val,double_val,timespec_val,g
> uid_val,numeric_val_num,numeric_val_denom,gdate_val)
> VALUES('a45d5c866dc46a8f1a7cf3fc69409530','options',9,0,NULL,0,'19700101000
> 000','294bb3c78ecd0a60512614788b61f92c',0,1,NULL) * 18:17:16  CRIT
> <gnc.backend.sql> save_slot: assertion 'pSlot_info->is_ok' failed
> * 18:17:16  CRIT <gnc.backend.dbi> gnc_dbi_transaction_rollback: assertion
> 'sql_savepoint > 0' failed
> 
> What can I do now?
> 
> *Best Regards,*
> 
> 
> *Mubasher Usman*
> 
> *Software Engineer (J2EE)*
> ​*NovaPex Tech. & *​
> *T​​TR-Group ​DE​*
> Tel:  +92 311 1379796 | Skype: mubasherusman
> 
> <https://pk.linkedin.com/in/mubasherusman>
> <https://www.facebook.com/mubasherusman>
> 
> *​*
> *Disclaimer:* This email and any files transmitted with it are confidential
> and intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify the
> sender. If you are not the intended recipient of this e-mail, you are
> prohibited from reading, printing, duplicating, disseminating or otherwise
> using this information. Please note that any views or opinions presented in
> this email are solely those of the author. Recipient should check this
> email and any attachments for the presence of viruses.
> 
> On Sat, Nov 11, 2017 at 6:45 PM, Maf. King <maf at chilwell.net> wrote:
> > On Friday, 10 November 2017 10:26:10 GMT Mubasher Usman wrote:
> > > Hi,
> > > 
> > > Gnucash ver 2.6.18 windows.
> > > MySQL 5.7.20 latest one just downloaded today.
> > > 
> > > i am trying to save my accounts (by save as) into mysql database with
> > 
> > root
> > 
> > > user having full permissions. But I always get the eror and upon
> > 
> > searching
> > 
> > > the error in tace files I found the following.
> > > 
> > > * 14:57:36  CRIT <GLib> g_utf8_to_utf16: assertion 'str != NULL' failed
> > > * 14:57:45  CRIT <gnc.backend.dbi> [mysql_error_fn()] DBI error: 1292:
> > > Incorrect datetime value: '19700101000000' for column 'timespec_val' at
> > 
> > row
> > 
> > > 1
> > 
> > Hi,
> > 
> > somehow, one of your transactions has a bogus date in it of 1st Jan 1970.
> > Seems that MySQL doesn't like this date!
> > 
> > guess you'll have to manually modify the XML data file by searching for
> > that
> > date and changing the year to something more likely.
> > 
> > Turn compression off (if it is enabled) save as a new XML data file. Shut
> > GC
> > down.  Take good backups of the new file, (then take another backup!) then
> > open
> > the file with some simple text editor and search for the string
> > "1970010100"
> > Modify all the found strings and save back out.  Then test in GC and
> > finally
> > try the save as SQL
> > 
> > HTH,
> > Maf.


-- 
Maf. King
PGP Key fingerprint = 8D68 A91F 733B 2C1F 43B7  2B7C E591 E8E1 0DE7 C542





More information about the gnucash-user mailing list