SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question 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
    -- http://www.phpmyadmin.net
    --
    -- 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`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1;
    "Persistence is the path to perfection"

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,892
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi there,
    I can confirm that there's nothing wrong with the code you provide.
    I just tried running it on my machine (PHPmyAdmin (3.5.2.2) - Xampp (latest) - MySQL (5.0.90)) and it did what was expected.
    What is the error message you are getting?

  3. #3
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Quote Originally Posted by Pullo View Post
    Hi there,
    I can confirm that there's nothing wrong with the code you provide.
    I just tried running it on my machine (PHPmyAdmin (3.5.2.2) - 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_address`at 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.
    "Persistence is the path to perfection"

  4. #4
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,707
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    including the whole error message rather than some of it will help others assist you with the problem.

  5. #5
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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
    "Persistence is the path to perfection"

  6. #6
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,892
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi there,
    Just wanted to check if you found a solution to this.

  7. #7
    SitePoint Evangelist silversurfer5150's Avatar
    Join Date
    Aug 2010
    Posts
    534
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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

    have a good day
    "Persistence is the path to perfection"

  8. #8
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,892
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi there silversurfer5150,

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

    Quote Originally Posted by silversurfer5150 View Post
    have a good day
    My day will be over within the hours (living in Germany and all that). Nonetheless, I'll do my best to sleep soundly


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •