php - 导入时出现 SQL 语法错误

标签 php mysql

我想将 SQL 导入到新数据库中。

这是我的 SQL 代码:

-- phpMyAdmin SQL Dump
-- version 2.11.9.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 03, 2013 at 05:43 PM
-- Server version: 5.0.67
-- PHP Version: 5.2.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

--
-- Database: `rss_aggregator`
--

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

--
-- Table structure for table `admin`
--

CREATE TABLE IF NOT EXISTS `admin` (
  `id` varchar(1) NOT NULL,
  `admin` varchar(40) NOT NULL,
  `password` varchar(255) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `admin`
--

INSERT INTO `admin` (`id`, `admin`, `password`) VALUES
('1', 'admin', 'c3284d0f94606de1fd2af172aba15bf3');

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

--
-- Table structure for table `categories`
--

CREATE TABLE IF NOT EXISTS `categories` (
  `category_id` int(12) NOT NULL auto_increment,
  `category_title` varchar(255) character set utf8 collate utf8_persian_ci NOT NULL,
  `category_order` int(12) NOT NULL,
  PRIMARY KEY  (`category_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `categories`
--

INSERT INTO `categories` (`category_id`, `category_title`, `category_order`) VALUES
(1, 'cate1', 2),
(2, 'cate2', 1);

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

--
-- Table structure for table `feeditems`
--

CREATE TABLE IF NOT EXISTS `feeditems` (
  `item_id` int(12) NOT NULL auto_increment,
  `item_title` varchar(255) NOT NULL,
  `item_url` varchar(255) NOT NULL,
  `item_category_id` int(12) NOT NULL,
  `item_feed_id` int(12) NOT NULL,
  `item_details` text character set utf8 collate utf8_persian_ci NOT NULL,
  `item_datetime` varchar(100) NOT NULL,
  `item_unix_datetime` int(12) NOT NULL,
  `item_hits` int(12) NOT NULL,
  `item_published` int(1) NOT NULL,
  `item_pinned` int(1) NOT NULL,
  PRIMARY KEY  (`item_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;

--
-- Dumping data for table `feeditems`
--


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

--
-- Table structure for table `feeds`
--

CREATE TABLE IF NOT EXISTS `feeds` (
  `feed_id` int(12) NOT NULL auto_increment,
  `feed_url` varchar(255) NOT NULL,
  `feed_title` varchar(100) NOT NULL,
  `feed_logo` varchar(255) NOT NULL,
  `feed_category_id` int(12) NOT NULL,
  `feed_last_update` int(12) NOT NULL,
  `feed_items` int(3) NOT NULL,
  PRIMARY KEY  (`feed_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;

--
-- Dumping data for table `feeds`
--

INSERT INTO `feeds` (`feed_id`, `feed_url`, `feed_title`, `feed_logo`, `feed_category_id`, `feed_last_update`, `feed_items`) VALUES
(1, 'http://url1', 'item1', '86371381906650.jpg', 1, 1381906864, 5),
(2, 'http://url2', 'item2', '33781381908943.jpg', 2, 1383498344, 10);

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

--
-- Table structure for table `setting`
--

CREATE TABLE IF NOT EXISTS `setting` (
  `id` int(1) NOT NULL,
  `seo_title` varchar(255) NOT NULL,
  `seo_keywords` text NOT NULL,
  `seo_description` text NOT NULL,
  `site_template` varchar(100) NOT NULL,
  `direct_links` int(1) NOT NULL,
  `new_items_number` int(2) NOT NULL,
  `top_hits_items_number` int(2) NOT NULL,
  `category_items_number` int(2) NOT NULL,
  `ad_slot_728` text NOT NULL,
  `ad_slot_300` text NOT NULL,
  `friendly_urls` int(1) NOT NULL,
  `pagination_style` int(1) NOT NULL,
  `display_rss` int(1) NOT NULL,
  `display_category_rss` int(1) NOT NULL,
  `rss_items_number` int(4) NOT NULL,
  `facebook` varchar(255) NOT NULL,
  `twitter` varchar(255) NOT NULL,
  `google_plus` varchar(255) NOT NULL,
  `display_calendar` int(1) NOT NULL,
  `google_analytics` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Dumping data for table `setting`
--

INSERT INTO `setting` (`id`, `seo_title`, `seo_keywords`, `seo_description`, `site_template`, `direct_links`, `new_items_number`, `top_hits_items_number`, `category_items_number`, `ad_slot_728`, `ad_slot_300`, `friendly_urls`, `pagination_style`, `display_rss`, `display_category_rss`, `rss_items_number`, `facebook`, `twitter`, `google_plus`, `display_calendar`, `google_analytics`) VALUES
(1, 'title of the page', 'keyworks', 'desc', 'v2', 0, 15, 15, 15, '<img src="upload/top.jpg" />', '<img src="upload/left.jpg" />', 1, 2, 1, 1, 10, 'http://www.facebook.com', 'http://twitter.com', '', 0, '');

当我想将其导入新数据库时,我收到此错误:

 #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 'phpMyAdmin SQL Dump -- version 2.11.9.2

最佳答案

我重新组织了。

数据库名称:deneme

PHP版本:7.0.13

我用土耳其语准备的。但语法是相同的

try

Pic

关于php - 导入时出现 SQL 语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41652007/

相关文章:

php - 在 VSCode 上调试 Laravel 应用程序

mysql - 添加到查询以获得以前结果 SQL 的总和

简单查询上的 Python MySQL 语法错误

php - 获取 15 至 30 分钟前的数据

php - 如何使用 OpenCart 模块从 Controller 中的模型调用函数?

php - 通过php获取myisam_sort_buffer_size值?

php - 当用户离开页面时使 Laravel 中的登录无效

php - 公司市场信息 雅虎 RSS 源

php - 将 GET 数据从数据库发送到 url

php - Laravel 手动身份验证