PDA

View Full Version : Gars help


Bridges
10-14-2006, 11:05 AM
I backup my live database, which seem to be good. And now I'm going to restore it to a new database. So I can upgrade my forums. I like to play it safe.

This is the error I keep getting when I go to restore the database.
ERROR 1064 at line 205455: 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 'default smallint(6) NOT NULL default '0',
allowhtml tinyint(4


I compare the two database. The one I'm restoring stops at table 68. Which is gars. The next one is most likely what is causing the error and that is
gars_custom_fields.

Any help would be great!

Thanks!

The Geek
10-14-2006, 11:42 AM
Check the SQL for instances of order and mod

Change those to `order` and `mod`

HTHs

Bridges
10-14-2006, 11:46 AM
huh!? I don't think I'm understanding you here.

The Geek
10-14-2006, 12:43 PM
In your backup file (most likley a backup.sql or similar). Do a search for order and mod in the GARS table's fields and change them to `order` and `mod` (notice the ` areound the field names). Just make sure you dont change any instances of order by (which you shouldnt really have in a backup file anyway.

HTHs

The reason its hiuccuping is because your backup didnt fully qualify the names (which isnt uncommon) and the word order and mod are reserved SQL qords. Therefore mysql gets confused seeing them as field names. the ` around the field name helps mysql out.

Bridges
10-14-2006, 12:50 PM
Oh... I see. I'm starting to understand now. One last question for then,

What is best to open the backup.sql file with?

Thanks!

The Geek
10-14-2006, 01:09 PM
That depends on the size. You can usually open in notepad, however I am guessing that its a pretty massive file! It will still open in notepad (or any other text editor) it will just take awhile. Try to avoid opening it in anything that will apply formatting (i.e. wordpad or word)

Bridges
10-14-2006, 11:46 PM
Yes the file is 283.mb

Is there anyway I can fix this before I make the backup? I like to save time when I upgrade to vb3.6, so I'm not closed to long. I will be restoring to a test site first.

Bridges
10-15-2006, 12:56 AM
This was my methond of backing up, if that matters or not

mysqldump -u dbusername -p databasename > backupname.sql

The Geek
10-15-2006, 05:50 AM
Maybe make 2 backups: 1 of the table definitions, 1 of the data. Then again, depending on the type of inserts, you may need to change both. :(

Bridges
10-15-2006, 01:11 PM
Update on how things went. I decided to take another backup by using this command below this time. Everything went with no problems.


mysqldump --opt -Q -u dbusername -p databasename > backupname.sql


Thanks for your help!

The Geek
10-16-2006, 07:33 PM
Thanks for the follow up. I am sure it will help others :)

Bridges
10-17-2006, 10:27 AM
I try to all ways follow up, probably because it bugs me when someone asks for help and they either don't reply back after they fixed it or worse, reply back and say never mind I fixed it.

Here I am reading say a two page thread that has been going on for two or three days that I could use help with and I'm sure many others too. In the end he says thanks I fixed. That bugs me.