Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2009
    Posts
    31
    Plugin Contributions
    0

    Default MYSQL Import Error

    Hi, i am moving ZenCart from one server to another and i have the exported mysql database and when i try and import in phpmyadmin i get the following error:


    Error

    SQL query:

    # HeidiSQL Dump
    #
    # --------------------------------------------------------
    # Host: 67.225.243.221
    # Database: dressup_zencart
    # Server version: 5.0.85-community
    # Server OS: pc-linux-gnu
    # Target compatibility: ANSI SQL
    # HeidiSQL version: 4.0
    # Date/time: 2009-12-21 14:29:45
    # --------------------------------------------------------
    /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI,NO_BACKSLASH_ESCAPES';*//*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;*/#
    # Database structure for database 'dressup_zencart'
    #
    CREATE DATABASE /*!32312 IF NOT EXISTS*/ "dressup_zencart"/*!40100 DEFAULT CHARACTER SET latin1 */;

    MySQL said: Documentation
    #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 'SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;*/

    #' at line 14

  2. #2
    Join Date
    Nov 2004
    Location
    Norfolk, United Kingdom
    Posts
    3,036
    Plugin Contributions
    2

    Default Re: MYSQL Import Error

    Disable that line with a # in front of it:

    #!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI,NO_BACKSLASH_ESCAPES';*//*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

    and also disable this one, which creates the database (you create the db in phpMyAdmin before you import into it):

    #CREATE DATABASE /*!32312 IF NOT EXISTS*/ "dressup_zencart"/*!40100 DEFAULT CHARACTER SET latin1 */;

    Vger

  3. #3
    Join Date
    Dec 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: MYSQL Import Error

    Then i get this:

    Error

    SQL query:

    # HeidiSQL Dump
    #
    # --------------------------------------------------------
    # Host: 67.225.243.221
    # Database: dressup_zencart
    # Server version: 5.0.85-community
    # Server OS: pc-linux-gnu
    # Target compatibility: ANSI SQL
    # HeidiSQL version: 4.0
    # Date/time: 2009-12-21 14:29:45
    # --------------------------------------------------------
    #/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI,NO_BACKSLASH_ESCAPES';*/
    #/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;*/
    #
    # Database structure for database 'dressup_zencart'
    #
    #CREATE DATABASE /*!32312 IF NOT EXISTS*/ "dressup_zencart" /*!40100 DEFAULT CHARACTER SET latin1 */;
    USE "dressup_zencart";

    MySQL said: Documentation
    #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 '"dressup_zencart"' at line 23






    I have dressup_zencart database created... idk why it would error

  4. #4
    Join Date
    Dec 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: MYSQL Import Error

    and if i comment that out i get more error:



    Error

    SQL query:

    # HeidiSQL Dump # # -------------------------------------------------------- # Host: 67.225.243.221 # Database: dressup_zencart # Server version: 5.0.85-community # Server OS: pc-linux-gnu # Target compatibility: ANSI SQL # HeidiSQL version: 4.0 # Date/time: 2009-12-21 14:29:45 # -------------------------------------------------------- #/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ANSI,NO_BACKSLASH_ESCAPES';*/ #/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;*/ # # Database structure for database 'dressup_zencart' # #CREATE DATABASE /*!32312 IF NOT EXISTS*/ "dressup_zencart" /*!40100 DEFAULT CHARACTER SET latin1 */; #USE "dressup_zencart"; # # Table structure for table 'zen_address_book' # CREATE TABLE /*!32312 IF NOT EXISTS*/ "zen_address_book" ( "address_book_id" int(11) NOT NULL auto_increment[...]

    MySQL said: Documentation
    #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 '"zen_address_book" (
    "address_book_id" int(11) NOT NULL auto_increment,
    "c' at line 30

  5. #5
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: MYSQL Import Error

    1. You can't use "CREATE DATABASE" or "USE" statements in an import via phpMyAdmin.
    And, if you create your backup/export using the instructions mentioned in our FAQ articles ( https://www.zen-cart.com/tutorials/i...hp?article=103 ) then the export won't even include those statements.

    2. You appear to be editing the file with a tool that changes the line-endings of the text in the file, and thus you're getting all the content confused. Just look at the difference between what you posted last and the post before it.
    You need a reliable text editor. Perhaps the free Notepad++ (http://notepad-plus.sf.net) might be a wise choice.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #6
    Join Date
    Dec 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: MYSQL Import Error

    i been using notepad.

  7. #7
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: MYSQL Import Error

    That's probably what's breaking the content of your file.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  8. #8
    Join Date
    Dec 2009
    Posts
    31
    Plugin Contributions
    0

    Default Re: MYSQL Import Error

    the sql file was exported using phpmyadmin according to the guy who owns the other server just like the tutorial says. Why would notepad break the file ?

  9. #9
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: MYSQL Import Error

    1. Using the tutorial I mentioned, if one actually follows it exactly, does an export of the specified database, not all databases in the account, and thus the CREATE DATABASE and USE statements will not be added to the exported file.

    2. Notepad, being a MS windoze native app, commonly damages files. It's a well known fact that Notepad is ill-suited for working with files used on webservers, especially if the server runs the more suitable linux operating system.
    The free Notepad++ application is much better suited to working with web files, and has the added benefit of giving you line numbers and syntax highlighting to quickly spot self-generated errors before they become problems.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Import Datafeed to MySQL database?
    By kirei in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 27 Nov 2009, 10:09 PM
  2. MySQL database import error
    By xikan in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 24 Aug 2009, 02:39 AM
  3. Unable to import MYSQL database
    By 1just4help in forum Installing on a Windows Server
    Replies: 25
    Last Post: 2 Jun 2009, 06:29 PM
  4. Error after MySQL Import
    By paults in forum Installing on a Linux/Unix Server
    Replies: 4
    Last Post: 27 May 2007, 05:22 AM
  5. Import Categories Description Mysql
    By cjsmiff in forum Basic Configuration
    Replies: 2
    Last Post: 16 Apr 2007, 01:26 AM

Posting Permissions

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