Jump to content

Recommended Posts

Posted

Hi, I need help with my MySQL database. I was entering tables and content into it and I was able to enter all of my tables except for these two tables, which for some reason, just will not load. It returns a syntax error, and I just don't know enough about MySQL to fix it.

 

I am wondering if anyone would be able to fix this for me or tell me how to fix it, thanks.

 

I attatched an sql file with the two problem tables so anyone can have a look at it.

 

The specific error is an SQL syntax error.

mysql.zip

  • 3 months later...
Posted
>option varchar( 50 ) NOT NULL default '',

<span style='color:blue'>OPTION</span> is a reserved word, you will need to change the that to something else.

 

I'm having this exact same problem when trying to re-populate a database. I don't know much about SQL syntax, but I'm not afraid to modify query if you could tell me what to change OPTION to.

 

What disturbs me is that this query was generated through my site's cpanel backup page under 'Download a MySQL Database Backup'. I have not modified this backup in any way, and yet I can't restore it. I have tried using the restore feature in cpanel backup and I have tried manually executing the query through phpMyAdmin but it keeps getting hung on this syntax error.

 

One last question. If I change OPTION to something else and successfully recreate the tables and data in my database, will my CMS (originally Mambo but now Joomla) be able to read the database? And if OPTION is a reserved word how did it get in there in the first place?

Posted

One of those little annoying things from Mambo :)

 

When you export your tables with phpMyAdmin make sure you select "Enclose table and field names with backquotes" and "Complete inserts", after that you should be able to restore your database.

 

The problem is because Mambo used some restricted words.

Posted
One of those little annoying things from Mambo :)

 

When you export your tables with phpMyAdmin make sure you select "Enclose table and field names with backquotes" and "Complete inserts", after that you should be able to restore your database.

 

The problem is because Mambo used some restricted words.

 

Unfortunately it's too late for me to correctly generate another backup of my database, and I'm stuck with the bad one. Thinking that I had good backups (I took several) generated from the cpanel backup page, I deleted my database. Is there anything I can do to fix the backup I have?

Posted

If you upload the backup to the server, and then open a ticket at the help desk (link at the top of this page) we'll try restoring it for you.

 

Please give us as much info as possible (database name, is it to be completely overwritten, file name, location, passwords )

Posted (edited)
If you upload the backup to the server, and then open a ticket at the help desk (link at the top of this page) we'll try restoring it for you.

 

Please give us as much info as possible (database name, is it to be completely overwritten, file name, location, passwords )

 

Yeah, I did that last night and got nowhere. I specifically laid out the problem, included everything the tech asked for, and even gave him a screenshot of the error. After 8 hours of back and forth all I got was "your database is corrupted. Provide us with another one." Yeah, no kidding.

 

As an aside, I am very disappointed in the tech support provided through the ticketing system. I found that corresponding with the tech was unbearable. It seemed as if he was more interested in symantecs than working to help me. At one point he actually asked me for permission to delete my database so that he could recreate it. Had he even looked at it he would have noticed that it was empty.

 

Anyway - *deep breath* - I think I've found something that might help me out. Over on the Mambo forums there's a thread that discusses problems with using the reserved words 'option' and 'fulltext'. Here's the link if anyone else runs into the problem.

 

One last thing. Can the cpanel backup actually produce a good db backup in some cases? Seems to me it would be best to just disable that functionality and point people in the direction of the phpMyAdmin interface to generate backups.

Edited by DrewT
Posted

Welcome to the forums, Drew :)

 

As I understand it, the help desk is not for supporting third party scripts

They can't be expected to know all the thousands of possible scripts we might put on our sites.

So the fact that you got a tech to look at your script say a lot about him.

Thats what I like about this place.

 

As to the cpanel backup

I have never heard of anyone having a problem with database backups or restores.

I have been using it for years.

It looks like the bad table name used by Mambo is the only reason your backup did not work.

 

And thanks for the link, that may help others.

Posted
Welcome to the forums, Drew :)

 

As I understand it, the help desk is not for supporting third party scripts

They can't be expected to know all the thousands of possible scripts we might put on our sites.

So the fact that you got a tech to look at your script say a lot about him.

Thats what I like about this place.

 

As to the cpanel backup

I have never heard of anyone having a problem with database backups or restores.

I have been using it for years.

It looks like the bad table name used by Mambo is the only reason your backup did not work.

 

And thanks for the link, that may help others.

 

Thanks for the welcome. I've been lurking here for a couple of years and have noticed how responsive and helpful everyone seems to be. I've been able to teach myself out of a lot of problems by reading these forums.

 

I don't want to get into a flame war about the help desk, but I think they should be expected to know about problems that can potentially be caused by cpanel. Fact is, it doesn't enclose table and field names with backquotes by default, which can cause huge problems during a restore for those using old database structures. Instead of just telling me that my database was corrupt, I would expect them to recognize a problem like this and at the very least be able to point the finger at the source. I guess my approach is that if I - someone who just started working with mySQL - can determine and correct the problem within a few hours by searching forums, then someone who gets paid to do it day in and out should have an inkling of what's going on.

 

All that said, I agree with you completely that the problem stems from the database structure utilized and/or promoted by Mambo/Joomla. Fortunately, they're aware of it and are working to eliminate the use of reserved words.

 

Finally, IMHO, there ought to at least be a warning of some kind on the cpanel backups page informing users that the structure provided may not be suitable for all types of database restores. Either that or just point people to phpMyAdmin where they can export everything.

 

Sorry for ranting. Please understand that not long ago I thought I'd lost weeks of work despite using best practices.

Posted
then someone who gets paid to do it day in and out should have an inkling of what's going on

But the support team is paid to keep the servers running not to troubleshoot whatever database errors MySQL or cPanel may have caused.

 

Welcome to the forums.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...