Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Database Backup Error


gregwee

Recommended Posts

When I try to do a database backup from Admin/Tools/Database Backup Manager, I get the following error:

1064 - 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 'Timestamp,Status,Data,Cookies,IpLock,Ip,NoTimeout from sql_iden' at line 1

 

select ID,UniqueID,Server,Password,User,Database,Timestamp,Status,Data,Cookies,IpLock,Ip,NoTimeout from sql_iden

 

Anyone has any idea what's the problem? I'm on MySQL version 5.0.67-log and using OsCommerce v2.2 RC2a

 

Everything else in the store seems to be working fine.

Link to comment
Share on other sites

When I try to do a database backup from Admin/Tools/Database Backup Manager, I get the following error:

1064 - 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 'Timestamp,Status,Data,Cookies,IpLock,Ip,NoTimeout from sql_iden' at line 1

 

select ID,UniqueID,Server,Password,User,Database,Timestamp,Status,Data,Cookies,IpLock,Ip,NoTimeout from sql_iden

Database is a reserved word in MySQL 5.0. Should not be used as field name.

Link to comment
Share on other sites

Database is a reserved word in MySQL 5.0. Should not be used as field name.

 

Thanks for the info. Doing a search of all the files under Admin, I found the following line in usersystem.lib.php, line 57, which is what I believe caused this error:

 

	$tag = "INSERT INTO sql_iden(UniqueID, Server, Password, User, `Database`, Timestamp, NoTimeout, IpLock, IP, Cookies, Data, Status) values(\"$UnID\", \"$Server\", \"$Password\", \"$Username\",\"$Database\", $Time,  $use_time, $IpBlocker, \"$IP\", $CookieBlocker, \"$toTab\", $Status)";

 

It seems that this saves the session data. Even with this error, I found that the backup still seems to work, and will create the sql file in the backup directory.

 

Browsing the database structure, it seems that the sql_iden table actually does have a column named "Database", which is really stupid since this is a reserve word. Shouldn't this be a bug fix as I'm sure I'm not the only one who experienced this problem?

Link to comment
Share on other sites

I found the following line in usersystem.lib.php, line 57, which is what I believe caused this error:

 

	$tag = "INSERT INTO sql_iden(UniqueID, Server, Password, User, `Database`, Timestamp, NoTimeout, IpLock, IP, Cookies, Data, Status) values(\"$UnID\", \"$Server\", \"$Password\", \"$Username\",\"$Database\", $Time,  $use_time, $IpBlocker, \"$IP\", $CookieBlocker, \"$toTab\", $Status)";

 

It seems that this saves the session data. Even with this error, I found that the backup still seems to work, and will create the sql file in the backup directory.

 

Browsing the database structure, it seems that the sql_iden table actually does have a column named "Database", which is really stupid since this is a reserve word. Shouldn't this be a bug fix as I'm sure I'm not the only one who experienced this problem?

The file usersystem.lib.php is not part of osC, neither is the table sql_iden. Actually, osC does not (at least no longer) saves the contents of the session data in backups since it is useless to restore old data from that table.

Link to comment
Share on other sites

Thanks for the info. After doing a search as to where "usersystem.lib.php" is referenced, it looks like this is actually from MySQL Admin which I installed.

 

I guess I'll just be using MySQL to do full backups instead of the backup manager on osCommerce.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...