SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast Anders N's Avatar
    Join Date
    Dec 2004
    Location
    Norway
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error when trying to import MySQL

    Here's the case:
    Im trying to move a Joomla installation from one server to another. Everything went fine, until i tried importing the Sql file to the new server through phpMyAdmin. Get an error saying this:
    Error

    SQL query:

    -- phpMyAdmin SQL Dump
    -- version 2.9.1.1
    -- http://www.phpmyadmin.net
    --
    -- Host: 192.168.1.3:3306
    -- Generation Time: Feb 17, 2007 at 04:09 AM
    -- Server version: 4.1.15
    -- PHP Version: 5.2.0-8
    --
    -- Database: `pspart`
    --
    CREATE DATABASE `pspart` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;



    MySQL said:
    #1064 - Der er en fejl i SQL syntaksen nær 'DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci' på linje 1
    The top of the Sql file looks like this:
    Code:
    -- phpMyAdmin SQL Dump
    -- version 2.9.1.1
    -- http://www.phpmyadmin.net
    -- 
    -- Host: 192.168.1.3:3306
    -- Generation Time: Feb 17, 2007 at 04:09 AM
    -- Server version: 4.1.15
    -- PHP Version: 5.2.0-8
    -- 
    -- Database: `xxx`
    -- 
    CREATE DATABASE `pspart` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    USE `xxx`;
    
    -- --------------------------------------------------------
    
    -- 
    -- Table structure for table `jos_banner`
    -- 
    
    CREATE TABLE `jos_banner` (
      `bid` int(11) NOT NULL auto_increment,
      `cid` int(11) NOT NULL default '0',
    Can anyone tell me how to fix this? Please use simple words, as I'm not used to dealing with these things, and English is not my primary language.
    Do you see how not drunk I am? Fix it!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,021
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    what version of mysql is the server where you are trying to run this sql?

    the error message suggests that it might be older than 4.1
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast Anders N's Avatar
    Join Date
    Dec 2004
    Location
    Norway
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have no idea. Anyway, I got it working, by removing any reference of DEFAULT CHARACTER SET latin1* from the SQL.
    Do you see how not drunk I am? Fix it!

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,021
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    run this query:
    Code:
    select version() as v
    i'm betting 4.0 or earlier
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


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
  •