导入mysql时出现语法错误

时间:2013-05-08 20:52:59

标签: mysql syntax

这是我想在我的数据库中使用的sql,但我有一个问题:

-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 27, 2012 at 07:12 PM
-- Server version: 5.5.19
-- PHP Version: 5.3.8

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `lol`
--

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

  CREATE TABLE IF NOT EXISTS `users` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `username` varchar(48) CHARACTER SET utf8 NOT NULL,
 `password` varchar(48) CHARACTER SET utf8 NOT NULL,
 `email` varchar(255) CHARACTER SET utf8 NOT NULL,
 `sid` varchar(32) NOT NULL,
 PRIMARY KEY (`id`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1020 ;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `username`, `password`, `email`, `sid`) VALUES
(1001, 'Larry', 'md5passhere', ' @', ''),

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

当我想将其导入数据库时​​,我有这个错误:

#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 CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */' at line 8 

我不知道如何通过网络搜索解决这个问题我找不到有关我的问题的有用信息,所以你想我怎么解决这个问题?

2 个答案:

答案 0 :(得分:5)

在你[{1}}结束时,你有一个不属于INSERT INTO users的{​​{1}},你可能还想在,后删除另一个;?< / p>

<强>更新

/* */;

答案 1 :(得分:1)

删除SQL脚本的注释部分,特别是“;”