Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Unable to Load SQL statement in PHPMyadmin


Guest

Recommended Posts

I am trying to load a database onto my webserver to get my shop going. I created the database on through tools provided by my ISP.

 

When I backup using osCommerce It produces the 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 'order' at line 1

show fields from order

[TEP STOP]

 

 

It still creates the backup although it doesn't contain all the information about the products I have loaded into the system. It creates an SQL script that, when run, installs all of the tables in the original osCommerce install but it doesnt seem to contain the tables created in contribs I have installed or product data.

 

So instead I backed up thorugh the MySql prompt on my machine by using the command:

 

mysqldump --opt -u dbusername -p dbname > dbname.bak.dump

 

This makes a backup of all tables and contents into a text file.

 

The only problem is that when I try and load this file as an SQL statement with PHPmyAdmin it gets to the first LOCK TABLES line and then halts. It gives an error:

 

#1044 Access denied for user 'namegivenbyisp'@'%' to database 'databasename'

 

 

Does this mean that my ISP has banned my user from performing certain tasks? If that's the case then how do I backup my database in MySQL without making LOCK TABLE commands etc and produce a clean SQL script backup?

 

Sorry for my ignorance I really don't know that much about MySQL but I am undergoing a steep learning curve.

 

Any help would be greatly appreciated

Link to comment
Share on other sites

mysqldump --add-drop-table -u username -p databasename > databasename.sql

will allow a full backup, you will be prompted for a password

Link to comment
Share on other sites

mysqldump --add-drop-table -u username -p databasename > databasename.sql

will allow a full backup, you will be prompted for a password

 

 

I tried that too, it still creates the LOCK TABLE lines before it does an INSERT, I really need to know a way of making a script like the backup osCommerce does, just plain jane, so to speak.

Link to comment
Share on other sites

Take a look at the text of the file and see if there are differences in the comment characters or delimiters between what you have and what your current machine exports.

 

I've run into that before although my memory is hazy about which one was the hassle. I just remember doing a global search and replace and viola... import successful.

 

If the lock table line is really the problem just edit the .sql file or pull the bits you need to import and paste them into the sql field in phpMyAdmin.

 

Hope that helps.

 

Iggy

Everything's funny but nothing's a joke...

Link to comment
Share on other sites

Take a look at the text of the file and see if there are differences in the comment characters or delimiters between what you have and what your current machine exports.

 

I've run into that before although my memory is hazy about which one was the hassle. I just remember doing a global search and replace and viola... import successful.

 

If the lock table line is really the problem just edit the .sql file or pull the bits you need to import and paste them into the sql field in phpMyAdmin.

 

Hope that helps.

 

Iggy

 

 

Thanks Iggy I'll give it a go, although the file is huge about 1.5 MB so finding all those buggers is going to be painful. :'(

Link to comment
Share on other sites

I took out all the LOCK TABLES and it seemed to work although it did say that the SQL statement was empty. But it added all the data anyway

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...