I have a PHP script produced by using Export in phpMyAdmin. When trying to Import elsewhere from that script I got all sort of errors. Thanks to this site I managed to modify it to this one and get further before an error crops up but I can't find help for this one.
Original export
-- phpMyAdmin SQL Dump
-- version 4.2.5
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Feb 23, 2015 at 05:23 PM
-- Server version: 5.0.95-log
-- PHP Version: 5.5.14
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: `graveyard`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE IF NOT EXISTS `admin` (
`adminId` int(11) NOT NULL auto_increment,
`userName` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`adminId`, `userName`, `password`) VALUES
(1, 'wardens', 'Bega&1120');
After looking at various questions I modified it to
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: `terrier`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE IF NOT EXISTS `terrier`.`admin` (
`adminId` int(11) NOT NULL auto_increment,
`userName` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL
PRIMARY KEY (`adminId`))
--
-- Dumping data for table admin
--
INSERT INTO admin (`adminId`, `userName`, `password`) VALUES
(1, 'wardens', 'Bega&1120');
This gets as far as the INSERT INTO command but throws up error
#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 '(`adminId`))
--
-- Dumping data for table admin
--
INSERT INTO admin (' at line 15
I suspect this is a problem due to different MySQL versions - or more likely my newby status.
See Question&Answers more detail:os