Mysql Primary Key Syntax Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have
Type=innodb Error
Meta Discuss the workings and policies of this site About Us mysql type=innodb syntax error Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads #1273 - unknown collation: 'utf8mb4_unicode_520_ci' with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers,
Type Myisam
just like you, helping each other. Join them; it only takes a minute: Sign up MySQL query syntax error in CREATE TABLE near UNIQUE KEY up vote 1 down vote favorite I have executed this query in MySQL but it is showing a syntax error near Unique key statement. Can anybody help me to clear the
Mysql Server Version For The Right Syntax To Use Near '' At Line 1
error? CREATE TABLE IF NOT EXISTS `friends` ( `Id` int(10) unsigned NOT NULL AUTO_INCREMENT, `providerId` int(10) unsigned NOT NULL DEFAULT '0', `requestId` int(10) unsigned NOT NULL DEFAULT '0', `status` binary(1) NOT NULL DEFAULT '0', PRIMARY KEY (`Id`), UNIQUE KEY `Index_3` (`providerId`,`requestId`), KEY `Index_2` (`providerId`,`requestId`,`status`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='providerId is the Id of the users who wish to be friend with' AUTO_INCREMENT=7 ; The error message is given below: ERROR 1064(42000): 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 ''Id'),UNIQUE KEY Index_2(providerId,requestId),KEY Index_3 (providerId,requ' at line 1 mysql sql share|improve this question edited Sep 9 '13 at 11:54 Jonathan Leffler 440k62511824 asked Sep 9 '13 at 11:21 user2738779 66 Post the error message. –Radu Gheorghiu Sep 9 '13 at 11:23 Redundant comma here: status binary(1) NOT NULL DEFAULT '0', PRIMARY KEY (Id), –Itay Sep 9 '13 at 11:23 The statement you posted
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about error 1064 (42000): you have an error in your sql syntax; Stack Overflow the company Business Learn more about hiring developers or posting ads with
Innodb Tables
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is engine=innodb a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Syntax error when running a MySQL CREATE TABLE statement [duplicate] up vote 7 http://stackoverflow.com/questions/18697090/mysql-query-syntax-error-in-create-table-near-unique-key down vote favorite 3 This question already has an answer here: 1064 error in CREATE TABLE … TYPE=MYISAM 2 answers CREATE TABLE users ( user_id INT(8) NOT NULL AUTO_INCREMENT, user_name VARCHAR(30) NOT NULL, user_pass VARCHAR(255) NOT NULL, user_email VARCHAR(255) NOT NULL, user_date DATETIME NOT NULL, user_level INT(8) NOT NULL, UNIQUE INDEX user_name_unique (user_name), PRIMARY KEY (user_id) ) TYPE=INNODB; When running this query on the SQL server, I am getting the http://stackoverflow.com/questions/9620439/syntax-error-when-running-a-mysql-create-table-statement following 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 'TYPE=INNODB' at line 10 Any help on why this is coming up? mysql sql database syntax share|improve this question edited Mar 8 '12 at 15:46 Jonathan Leffler 440k62511824 asked Mar 8 '12 at 15:43 user180857 702214 marked as duplicate by PeeHaa, Tyler Crompton, Ocramius, hakre, thaJeztah Apr 8 '13 at 19:38 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. add a comment| 4 Answers 4 active oldest votes up vote 26 down vote accepted Instead of TYPE=INNODB set Engine=InnoDB share|improve this answer answered Mar 8 '12 at 15:45 hsz 73k32155235 add a comment| Did you find this question interesting? Try our newsletter Sign up for our newsletter and get our top new questions delivered to your inbox (see an example). Subscribed! Success! Please click the link in the confirmation email to activate your subscription. up vote 5 down vote Use ENGINE=InnoDB; http://dev.mysql.com/doc/refman/5.0/en/using-innodb-tables.html share|improve this answer answered Mar 8 '12 at 15:46 dotoree 2,5271421 add a comment| up vote 1 down vote The man
Connectors More MySQL.com Downloads Developer Zone Section Menu: Documentation Home MySQL 5.7 Reference Manual Preface and Legal Notices http://dev.mysql.com/doc/en/create-table.html General Information Installing and Upgrading MySQL Using MySQL as a Document Store Tutorial MySQL Programs MySQL Server Administration Security Backup and Recovery Optimization Language Structure Globalization Data Types Functions and Operators SQL Statement Syntax Data Definition Statements ALTER DATABASE Syntax ALTER EVENT Syntax ALTER FUNCTION Syntax ALTER INSTANCE Syntax ALTER syntax error LOGFILE GROUP Syntax ALTER PROCEDURE Syntax ALTER SERVER Syntax ALTER TABLE Syntax ALTER TABLE Partition Operations ALTER TABLE Online Operations in MySQL Cluster ALTER TABLE and Generated Columns ALTER TABLE Examples ALTER TABLESPACE Syntax ALTER VIEW Syntax CREATE DATABASE Syntax CREATE EVENT Syntax CREATE FUNCTION Syntax CREATE INDEX Syntax mysql primary key CREATE LOGFILE GROUP Syntax CREATE PROCEDURE and CREATE FUNCTION Syntax CREATE SERVER Syntax CREATE TABLE Syntax CREATE TABLE ... LIKE Syntax CREATE TABLE ... SELECT Syntax Using FOREIGN KEY Constraints Silent Column Specification Changes CREATE TABLE and Generated Columns Secondary Indexes and Generated Virtual Columns Setting NDB_TABLE options in table comments CREATE TABLESPACE Syntax CREATE TRIGGER Syntax CREATE VIEW Syntax DROP DATABASE Syntax DROP EVENT Syntax DROP FUNCTION Syntax DROP INDEX Syntax DROP LOGFILE GROUP Syntax DROP PROCEDURE and DROP FUNCTION Syntax DROP SERVER Syntax DROP TABLE Syntax DROP TABLESPACE Syntax DROP TRIGGER Syntax DROP VIEW Syntax RENAME TABLE Syntax TRUNCATE TABLE Syntax Data Manipulation Statements CALL Syntax DELETE Syntax DO Syntax HANDLER Syntax INSERT Syntax INSERT ... SELECT Syntax INSERT DELAYED Syntax INSERT ... ON DUPLICATE KEY UPDATE Syntax LOAD DATA INFILE Syntax LOAD XML Syntax REPLACE Syntax SELECT Syntax SELECT ... INTO Syntax JOIN Synta