PHPMyAdmin MYSQL Dump cannot create tables

Hi guys.

I have modified a version of opencart to include new tables and have modified the installer sql file. My queries run fine if I run them directly through the console but when I try to run the installer, it uses a PHPMyAdmin SQL dump and it fails complaining of a syntax error at “CREATE TABLE oc_address (
address_id” which is the first table below. I have racked my brains but cannot see any errors in the syntax, maybe I’m just tired! The strange thing is, the table which it seems to be complaining about is one of the ones I haven’t modified.

The original software which I developed live on my hosting used MySql 5.3 but I am trying to get it onto localhost (with wampserver) which has v 5.5 installed, I don’t know if this will make a difference?

Can anyone help me please?

– phpMyAdmin SQL Dump
– version 3.2.2

– Host: localhost
– Generation Time: Apr 06, 2010 at 10:14 PM
– Server version: 5.5.24
– PHP Version: 5.3.13

– Database: OpenCart

– Table structure for table oc_address

CREATE TABLE oc_address (
address_id int(11) NOT NULL AUTO_INCREMENT,
customer_id int(11) NOT NULL,
company varchar(32) COLLATE utf8_bin NOT NULL,
firstname varchar(32) COLLATE utf8_bin NOT NULL DEFAULT ‘’,
lastname varchar(32) COLLATE utf8_bin NOT NULL DEFAULT ‘’,
address_1 varchar(128) COLLATE utf8_bin NOT NULL,
address_2 varchar(128) COLLATE utf8_bin NOT NULL,
postcode varchar(10) COLLATE utf8_bin NOT NULL DEFAULT ‘’,
city varchar(128) COLLATE utf8_bin NOT NULL,
country_id int(11) NOT NULL DEFAULT ‘0’,
zone_id int(11) NOT NULL DEFAULT ‘0’,
PRIMARY KEY (address_id),
KEY customer_id (customer_id)

Hi there,
I can confirm that there’s nothing wrong with the code you provide.
I just tried running it on my machine (PHPmyAdmin ( - Xampp (latest) - MySQL (5.0.90)) and it did what was expected.
What is the error message you are getting?

Hi Pullo,

Thanks so much for trying the code, the error is ambiguous, just says you have an error in your mysql syntax near at "CREATE TABLE oc_addressat line 1 (

I don’t really know what to do, like I said the original dump was running on MySql 5.3 and I understand that there are slight syntax differences between the different versions but I can’t see anything wrong. I also don’t have Wamp server configured incorrectly because it runs the original script just not the modified version.

The script is really very long, I didn’t post the whole thing but if I delete a query the error just drops through to the next query so I’m a little puzzled. It seems to just keep finding errors on the first table creation of the script. Do you think it could be referring to an error later on in the script but telling me line 1 regardless?

I don’t have any experience of mysql dump from phpMyAdmin as I have always queried directly from php, the opencart installer must be designed to do this by default. Do you have any idea what the code looks like to do a PhpMyAdmin mysql dump? I thought maybe I could find it and convert it to a straight mysql query from php?

thanks again

I will examine it more closely tomorrow.

including the whole error message rather than some of it will help others assist you with the problem.

hi there
that is all of it, maybe i should enable error reporting on php too, perhaps it will give more information , this error is non bold text so i’m guessing it comes from mysql or phpmyadmin, have just run wamp server for the first time so haven’t turned it on

Hi there,
Just wanted to check if you found a solution to this.

Hi Pullo,

Thanks for asking, there must have been some sort of syntax error somewhere but I didn’t bother looking for it as the dump file was huge but what helped me was using PHPMyAdmin to create a dump file of my modified database and putting that file into opencart. There is an option under Export to create a dump file and you can either select structure, structure and data or just data, so I selected structure for a nice clean empty modified database :wink:

have a good day

Hi there silversurfer5150,

I’m glad you got it sorted.
What you described would have been my next best guess anyway.

My day will be over within the hours (living in Germany and all that). Nonetheless, I’ll do my best to sleep soundly :slight_smile: