BACKUP Database problem

Started by Ricky000, July 17, 2014, 01:31:58 AM

Previous topic - Next topic

Ricky000

Hello;

I have search around the forum and couldn't find any solution for my problem i have had a few errors before and i was able to fix them... I am uploading my OLD SMF database to a new hosting and i am getting this error...


QuoteSQL query:

CREATE TABLE `smf_sessions` (
session_idchar( 32 ) NOT NULL default '',
last_update int( 10 ) unsigned NOT NULL default '',
data text NOT NULL default '',
PRIMARY KEY ( session_id )
) ENGINE = MYISAM ;

MySQL said: Documentation
#1067 - Invalid default value for 'last_update'

Please if some one can help me ... just to let you know i was using Arabic language pack for my old SMF and i will now as well...
PLEASE HELP thanks

Justyne

#1
Looks like broken SQL syntax to me if this is mySQL as you say.

How did you manage to make this backup?

CREATE TABLE `smf__sessions` (
  `session_id` varchar(32) NOT NULL DEFAULT '',
  `last_update` int(10) unsigned NOT NULL DEFAULT '0',
  `data` longtext NOT NULL,
  PRIMARY KEY (`session_id`)
) ENGINE=MyISAM;



Edit: Actually, that was a shoddy answer on my part. Can you tell us what MySQL version you were on at your old host and which one you will be on at your new host.

Also, which version of SMF?
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Ricky000

the new mySql version is 5.5.37-35.1-log i don't know the old one because the hosting is deleted my smf version is 1.1.8 i uploaded a fresh copy of the same version to my new hosting also i backed up the database using smf maintenance tab

thanks

Arantor

I'm extremely curious about this backup.

Firstly, there's no way it was produced by 1.1.8. 1.1.18 perhaps but not 1.1.8 since prior to 1.1.12 the backup only ever issued TYPE= not ENGINE= declarations.

I just did a similar backup from a 1.1.19 installation I have laying around (and I know that between 1.1.8 and 1.1.19 only 1.1.12 changed the backup, and it wouldn't have affected anything other than TYPE= vs ENGINE= in this case) and it gives me:

CREATE TABLE `smf_sessions` (
  session_id char(32) NOT NULL,
  last_update int(10) unsigned NOT NULL,
  data text NOT NULL,
  PRIMARY KEY (session_id)
) ENGINE=MyISAM;


I have no idea why you have a space missing or why your backup is otherwise damaged... strange that.

Ricky000

I changed  TYPE= to ENGINE declarations because i couldn't import my database through phpMYAdmin because it wasn't supported i read over the internet and i was told to change it...

Arantor

Nice of you to tell us that. Anything else you changed manually?

Ricky000

Im sorry not to mention it i have also fixed my smf_log_search_subjects because i had this error at the start

MySQL said: Documentation
#1062 - Duplicate entry '1-360' for key 'PRIMARY'

i found this line

INSERT INTO `smf_log_search_subjects` (`word`, `ID_TOPIC`) VALUES (0, 16),

selected and removed all until i got to the first:


DROP TABLE IF EXISTS `smf_log_search_topics`;

Only that INSERT and everything after it, up to "DROP" (without "DROP").

thats what i found on smf forum hope its not confusing

Sir Osis of Liver

Quote from: Ricky000 on July 17, 2014, 04:59:10 AM
i backed up the database using smf maintenance tab

If you backed up with the admin db backup feature, the backup may be corrupt.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Ricky000

How can i fix it then please i cant access my old forum due to my old hosting provider is delete any solutions to my problem??

This topic had the same issue as me i followed it but ended up with different error at the end they fixed it for him'
http://www.simplemachines.org/community/index.php?topic=337470.60

Please HELPME

Justyne

that is a different mysql error entirely.

Have you tried the code ‽ gave?
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Ricky000

Thank for your HELP bro now i get this error while importing my database due to it been Arabic language all the posts appears as ?? ?? <<< this question marks i tried importing it as UTF-8 i get all blank any solutions to this PROBLEM please someone HELP thanks

Arantor

Don't import it as UTF-8 because the data isn't in UTF-8.

Import it as ISO-8859-6.

Ricky000

i tried importing it as ISO-8859-6. only 1 table was uploaded smf_attachments ? whats the problem now

Arantor

I don't know, you tell me. What did it say to you?

Ricky000

Nothing no error and no successfull message came up only 1 table was imported

Arantor

Then I don't know what you did because there's more than one table in a backup file. Perhaps you need to remove all the existing tables and reimport fresh.

Ricky000

I dropped all tables and tried again even on a new database and am still getting only 1 table

Justyne

You seem to still be importing to Latin 1 as per screenshot.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Ricky000

sorry for late reply...

I am importing it as ISO-8859-6 but its going through utf as the image shows what will the problem be because it still uploading 1 table.

Justyne

Something is not going right. Look at "collation" on that screenie you attached. It shows UTF-8.

You need that collation to show you ISO-8859-6.

Make sure you do this from scratch. Make a new DB. Open PHP my admin, import your file. Before you click OK make sure you have the right encoding.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Ricky000

I created new database few times and selecting ISO-8859-6. while uploading but still uploading as latin1_swedish_ci now i have no idea why and only uploading 1 table ..

The image below is what am selecting and its not coming up with any message after importing...

Ricky000


Arantor

latin1_swedish_ci should be fine.

What I don't get is why it's only processing one table, since there should be no reason for it to stop there.

Ricky000

Yeah trried few times and with new database and still not importing it all...

Ricky000


Arantor

Well, if you have a stock SMF backup and all you changed were TYPE to ENGINE I see absolutely no reason why it shouldn't work, which makes me wonder if something else got broken in the process.

Ricky000

The files was fixed by Justyne because it wasn't importing into the database at the beginning ... after it uploaded successfull but i used to get my text as ????? because it is arabic i tried to upload it as UTF now i get blanks and tried ISO i get only 1 table uploaded

Justyne

Wait a minute. I never gave you a fixed version.

I did tell you how to fix your own version though.

Maybe, we misunderstood each other?

I didn't want to give you a file as I wasn't sure on the encoding, and my editor would have broken it.

Have a look in your PM history if you still have it. If not I'll send you what to do again.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Ricky000

Yes I know what you mean i did what you said to me and it imported successfully with no errors i thought this will be the fixed file i mean since it imported successfully by trying your way.

If its possible for you to fix the file and send it to me through PM ... i know i have been asking for too much but i really need this file to work PLEASE thanks

Justyne

I can give it a try later on, but I am not sure I know any more than you do at this point.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Sir Osis of Liver

Quote from: Krash on July 17, 2014, 03:02:19 PM
Quote from: Ricky000 on July 17, 2014, 04:59:10 AM
i backed up the database using smf maintenance tab

If you backed up with the admin db backup feature, the backup may be corrupt.


How large is the backup file?  There might not be anything in it but the one table.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Ricky000

Quote from: Krash on July 30, 2014, 01:25:38 PM
Quote from: Krash on July 17, 2014, 03:02:19 PM
Quote from: Ricky000 on July 17, 2014, 04:59:10 AM
i backed up the database using smf maintenance tab

If you backed up with the admin db backup feature, the backup may be corrupt.


How large is the backup file?  There might not be anything in it but the one table.


I have more than one table because it imports everything if i use utf8 but with blank no arabic text so i guess its not from it

Arantor

But is the database you've created also actually set to Arabic?

Ricky000

I have no idea what you mean by that i exported it from smf maintenance tab and my forum was arabic so i guess its set to arabic?

Advertisement: