---
title: "Problem vid import (#1064)"
type: "forum-thread"
url: "https://www.webforum.nu/amne/databaser-sql/138847-problem-vid-import-1064"
topic: "Databaser & SQL"
topic_url: "https://www.webforum.nu/amne/databaser-sql"
author: "SimOnline"
published: "2005-12-05T19:14:15.000Z"
updated: "2005-12-05T21:08:32.000Z"
replies: 1
views: 293
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/databaser-sql/138847-problem-vid-import-1064"
---

# Problem vid import (#1064)

## #1 — SimOnline, 2005-12-05T19:14Z

Jag försöker importera från en .sql-fil till min MySQL-databas, men det vägrar fungera.

Så här ser .sql-filen ut:

```
#
# Table structure for table `scBookmarks`
#

CREATE TABLE `scBookmarks` (
  `bId` int(11) NOT NULL auto_increment,
  `uId` int(11) NOT NULL default '0',
  `bIp` varchar(40) default NULL,
  `bStatus` tinyint(1) NOT NULL default '0',
  `bDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
  `bModified` datetime NOT NULL default '0000-00-00 00:00:00',
  `bTitle` varchar(255) NOT NULL default '',
  `bAddress` varchar(255) NOT NULL default '',
  `bDescription` varchar(255) default NULL,
  PRIMARY KEY  (`bId`),
  UNIQUE KEY `scBookmarks_bStatus_bId_bDatetime` (`bStatus`,`bId`,`bDatetime`),
  KEY `scBookmarks_uId_bAddress` (`uId`,`bAddress`)
)

# --------------------------------------------------------

#
# Table structure for table `scCategories`
#

CREATE TABLE `scCategories` (
  `id` int(11) NOT NULL auto_increment,
  `bId` int(11) NOT NULL default '0',
  `category` varchar(32) NOT NULL default '',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `scCategories_category_bId` (`category`,`bId`),
  KEY `scCategories_bId` (`bId`)
)

# --------------------------------------------------------

#
# Table structure for table `scUsers`
#

CREATE TABLE `scUsers` (
  `uId` int(11) NOT NULL auto_increment,
  `username` varchar(25) NOT NULL default '',
  `password` varchar(75) NOT NULL default '',
  `uStatus` varchar(15) NOT NULL default 'active',
  `uDatetime` datetime NOT NULL default '0000-00-00 00:00:00',
  `uModified` datetime NOT NULL default '0000-00-00 00:00:00',
  `name` varchar(50) NOT NULL default '',
  `email` varchar(50) NOT NULL default '',
  `homepage` varchar(100) default NULL,
  `uContent` text,
  PRIMARY KEY  (`uId`)
)

# --------------------------------------------------------

#
# Table structure for table `scWatched`
#

CREATE TABLE `scWatched` (
  `wId` int(11) NOT NULL auto_increment,
  `uId` int(11) NOT NULL default '0',
  `watched` int(11) NOT NULL default '0',
  PRIMARY KEY  (`wId`),
  KEY `scWatched_uId` (`uId`)
)
```

 

Detta felmeddelande dyker upp:

```
 MySQL sa:

#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 'CREATE  TABLE  `scCategories` (  `id` int( 11  )  NOT  NULL  AUTO_INCREMENT ,
 `' at line 12
```

 

Jag är väldigt dålig på SQL, så hjälp tas tacksamt emot.

Permalänk: https://www.webforum.nu/p/138847

## #2 — Travoni, 2005-12-05T21:08Z

Ingen aning om varför, men jag fick det att funka om jag körde en tabell i taget.

Permalänk: https://www.webforum.nu/p/1722341

---

Tråden på webben: https://www.webforum.nu/amne/databaser-sql/138847-problem-vid-import-1064
