MySQL Errors when importing
#1

Код:
Error

Static analysis:

14 errors were found during analysis.

    An opening bracket followed by a set of values was expected. (near "ALTER" at position 198)
    Unexpected token. (near "`banlist`" at position 210)
    Unrecognized keyword. (near "ADD" at position 223)
    Unrecognized keyword. (near "PRIMARY KEY" at position 227)
    Unexpected token. (near "(" at position 239)
    Unexpected token. (near "`ID`" at position 240)
    Unexpected token. (near ")" at position 244)
    Unexpected token. (near "," at position 245)
    Unrecognized keyword. (near "ADD" at position 250)
    Unrecognized keyword. (near "KEY" at position 254)
    Unexpected token. (near "`banlist_ibfk_1`" at position 258)
    Unexpected token. (near "(" at position 275)
    Unexpected token. (near "`userID`" at position 276)
    Unexpected token. (near ")" at position 284)

SQL query:

INSERT INTO `players` (`ID`, `Name`, `Password_`, `VLevel`, `ALevel`, `Banned`, `BanReason`, `Score`, `Money`, `Kills`, `Deaths`, `Heads`, `Jailed`, `JailTime`, `Muted`, `MuteTime`) VALUES ALTER TABLE `banlist` ADD PRIMARY KEY (`ID`), ADD KEY `banlist_ibfk_1` (`userID`)

MySQL said: Documentation
#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 'ALTER TABLE `banlist`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `banlist_ibfk_1` (`u' at line 6
These are the errors. If someone can help me out, I'd appreciate it.
Reply
#2

What's the data type of engine ? Says it's unrecognized, moreover you're missing a comma or a closing bracket, read the error. And show the respective line.
Reply
#3

You have an excess comma after "Banned" just before where you're closing ")"
Reply
#4

I fixed these, thanks.

Engine is MyISAM, and I'm getting these errors now.
Код:
Error

Static analysis:

14 errors were found during analysis.

    An opening bracket followed by a set of values was expected. (near "ALTER" at position 198)
    Unexpected token. (near "`banlist`" at position 210)
    Unrecognized keyword. (near "ADD" at position 223)
    Unrecognized keyword. (near "PRIMARY KEY" at position 227)
    Unexpected token. (near "(" at position 239)
    Unexpected token. (near "`ID`" at position 240)
    Unexpected token. (near ")" at position 244)
    Unexpected token. (near "," at position 245)
    Unrecognized keyword. (near "ADD" at position 250)
    Unrecognized keyword. (near "KEY" at position 254)
    Unexpected token. (near "`banlist_ibfk_1`" at position 258)
    Unexpected token. (near "(" at position 275)
    Unexpected token. (near "`userID`" at position 276)
    Unexpected token. (near ")" at position 284)

SQL query:

INSERT INTO `players` (`ID`, `Name`, `Password_`, `VLevel`, `ALevel`, `Banned`, `BanReason`, `Score`, `Money`, `Kills`, `Deaths`, `Heads`, `Jailed`, `JailTime`, `Muted`, `MuteTime`) VALUES ALTER TABLE `banlist` ADD PRIMARY KEY (`ID`), ADD KEY `banlist_ibfk_1` (`userID`)

MySQL said: Documentation
#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 'ALTER TABLE `banlist`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `banlist_ibfk_1` (`u' at line 6
Reply
#5

Quote:
Originally Posted by KevinExec
Посмотреть сообщение
I fixed these, thanks.

Engine is MyISAM, and I'm getting these errors now.
Код:
Error

Static analysis:

14 errors were found during analysis.

    An opening bracket followed by a set of values was expected. (near "ALTER" at position 198)
    Unexpected token. (near "`banlist`" at position 210)
    Unrecognized keyword. (near "ADD" at position 223)
    Unrecognized keyword. (near "PRIMARY KEY" at position 227)
    Unexpected token. (near "(" at position 239)
    Unexpected token. (near "`ID`" at position 240)
    Unexpected token. (near ")" at position 244)
    Unexpected token. (near "," at position 245)
    Unrecognized keyword. (near "ADD" at position 250)
    Unrecognized keyword. (near "KEY" at position 254)
    Unexpected token. (near "`banlist_ibfk_1`" at position 258)
    Unexpected token. (near "(" at position 275)
    Unexpected token. (near "`userID`" at position 276)
    Unexpected token. (near ")" at position 284)

SQL query:

INSERT INTO `players` (`ID`, `Name`, `Password_`, `VLevel`, `ALevel`, `Banned`, `BanReason`, `Score`, `Money`, `Kills`, `Deaths`, `Heads`, `Jailed`, `JailTime`, `Muted`, `MuteTime`) VALUES ALTER TABLE `banlist` ADD PRIMARY KEY (`ID`), ADD KEY `banlist_ibfk_1` (`userID`)

MySQL said: Documentation
#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 'ALTER TABLE `banlist`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `banlist_ibfk_1` (`u' at line 6
What? The correct syntax is -

INSERT INTO <Table name> (Column names) VALUES (vaules); you're using ALTER TABLE? it should be an independent statement. You're setting it to primary key while inserting values? Should set it, while creating the table.
Reply
#6

Код:
-- phpMyAdmin SQL Dump
-- version 4.4.15.2
-- http://www.phpmyadmin.netnl67291bd060fa9...6.00583737-- Host: us.hostskool.com
-- Generation Time: Apr 04, 2016 at 11:16 AM
-- Server version: 5.5.47-cll-lve
-- PHP Version: 5.4.45

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: `TeamWarZ`
--

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

--
-- Table structure for table `banlist`
--

CREATE TABLE IF NOT EXISTS `banlist` (
  `ID` int(11) NOT NULL,
  `Name` varchar(32) NOT NULL,
  `Password_` varchar(64) NOT NULL,
  `IP` varchar(32) NOT NULL,
  `BanReason` varchar(512) NOT NULL,
  `BannedBy` varchar(32) NOT NULL,
  `Date` date NOT NULL,
  `Banned` tinyint(1) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=6514 DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `players`
--

CREATE TABLE IF NOT EXISTS `players` (
  `ID` int(11) unsigned NOT NULL,
  `Name` varchar(32) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
  `Password_` varchar(64) NOT NULL,
  `VLevel` tinyint(1) unsigned NOT NULL,
  `ALevel` int(11) unsigned NOT NULL,
  `Banned` tinyint(1) unsigned NOT NULL,
  `BanReason` varchar(512) NOT NULL,
  `Score` int(11) unsigned NOT NULL,
  `Money` int(11) NOT NULL,
  `Kills` int(11) NOT NULL,
  `Deaths` int(11) NOT NULL,
  `Heads` int(11) unsigned NOT NULL,
  `Jailed` tinyint(1) unsigned NOT NULL,

  `JailTime` int(11) unsigned NOT NULL,
  `Muted` tinyint(1) unsigned NOT NULL,

  `MuteTime` int(11) unsigned NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;

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

--
-- Dumping data for table `players`
--

INSERT INTO `players` (`ID`, `Name`, `Password_`, `VLevel`, `ALevel`, `Banned`, `BanReason`, `Score`, `Money`, `Kills`, `Deaths`, `Heads`, `Jailed`, `JailTime`, `Muted`, `MuteTime`) VALUES

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

--
-- Indexes for dumped tables
--


--
-- Indexes for table `banlist`
--
ALTER TABLE `banlist`
  ADD PRIMARY KEY (`ID`),
  ADD KEY `banlist_ibfk_1` (`userID`);

--
-- Indexes for table `players`
--
ALTER TABLE `players`
  ADD PRIMARY KEY (`ID`),
  ADD UNIQUE KEY `Name` (`Name`);


--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `banlist`
--
ALTER TABLE `banlist`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=6514;

--
-- AUTO_INCREMENT for table `players`
--
ALTER TABLE `players`
  MODIFY `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=15;

/*!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 */;
That's the whole database. Can you edit it for me so it works please bud?
Reply
#7

Bumping for Zeus.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)