how to remove mysql error #1064? [closed] - mysql

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
MySQL query:
CREATE TABLE FC_Categories (
CategoryID INTEGER NOT NULL AUTO_INCREMENT ,
CategoryName VARCHAR( 15 ) ,
Description TEXT,
Picture LONGBLOB,
UNIQUE (
CategoryName
),
PRIMARY KEY ( CategoryID )
) TYPE = MYISAM ;
MySQL error after running query:
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 'TYPE=MyISAM' at line 8

Type is obsolete now, and hence is the error.
Use Engine=MyISAM

please use ENGINE=MyISAM instead.

replace TYPE=MyISAM to ENGINE=MyISAM

Related

How to insert my data in my table without getting any error? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
** mysql script is the following. what i'm doing wrong with it? i am trying to insert my data into my table but it seems impossibl as i am receiving lots of errors. how can i fix this script ? i am using phpmyadmin for my connection**
Error
SQL query:
CREATE TABLE IF NOT EXISTS visitors (
id int(11) NOT NULL AUTO_INCREMENT,
country varchar(500) NOT NULL,
coffee int(11),
tea int(11),
mate int(11),
cocoa int(11),
PRIMARY KEY id (int)
)ENGINE=InnoDB DEFAULT CHARSET=latin1
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 'int)
)ENGINE=InnoDB DEFAULT CHARSET=latin1' at line 8
It is not the right syntax, try it like this :
INSERT INTO visitors (`id`,`country`,`coffee`,`tea`,`mate`, `cocoa`) VALUES (0,'Algeria','79','5','0','1');

Why does my query return a SQL Syntax Error while trying to create my table - MariaDB? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 2 years ago.
Improve this question
I've been trying to create a table, and I can't figure out what's wrong with the syntax. Created other tables just fine. If you could enlighten me, I'd truly appreciate it!
CREATE TABLE `wp_ytvideos`( `ID` VARCHAR NOT NULL, `videoTitle` VARCHAR NULL, `videoOwner` VARCHAR NULL, PRIMARY KEY(`ID`))
Mysql response:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'NOT NULL,
videoTitle VARCHAR NULL,
videoOwner VARCHAR NULL,
P' at line 2
Server version: 10.4.11-MariaDB - mariadb.org binary distribution
VARCHAR columns need a length specified at creation.
CREATE TABLE `wp_ytvideos` (`ID` VARCHAR(255) NOT NULL,
`videoTitle` VARCHAR(255) NULL,
`videoOwner` VARCHAR(255) NULL,
PRIMARY KEY(`ID`))

What is wrong with this Create Table statement [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 6 years ago.
Improve this question
please could you help me with this piece of code, I don't know what's wrong with it. It seems correct at simple glance but it just gets me #1064 syntax error. The MySQL version am running is 5.5
CREATE TABLE mytablename(
-> id SMALLINT NOT NULL AUTO_INCREMENT,
-> name VARCHAR(100) NOT NULL,
-> submission_date NOT NULL TIMESTAMP,
-> PRIMARY KEY (id)
-> )ENGINE=InnoDB;
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 '-> id SMALLINT NOT NULL AUTO_INCREMENT, -> name CHAR(100), ->
submission' at line 2
Remove those arrows and try escaping the column names with backticks:
CREATE TABLE mytablename(
`id` SMALLINT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NOT NULL,
`submission_date` NOT NULL TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;

TYPE = MYISAM throws SQL syntax error [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
For a website I am trying to build I need to manually import a sql file, but I get syntax errors and have no idea how to correct it.
SQL query:
-- MySQL dump 8.21
--
-- Host: localhost Database: dnaowner_aqsg
-- Server version 3.23.49a
--
-- Table structure for table 'announce'
--
CREATE TABLE announce(
id INT( 11 ) NOT NULL AUTO_INCREMENT ,
stamp DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
txt TEXT NOT NULL ,
postedby INT( 11 ) NOT NULL DEFAULT '0',
PRIMARY KEY ( id )
) TYPE = MYISAM ;
MySQL said:
#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=myisam' at line 16
ENGINE = MyISAM ;
instead of
TYPE = MYISAM ;
TYPE was deprecated in MySQL 4.0

Error while creating table? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
mysql> CREATE TABLE DEPARTMENT
-> (
-> "ID" NUMBER,
-> "NAME" VARCHAR2(30),
-> PRIMARY KEY ("ID")
-> )engine-INNODB;
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" NUMBER, "NAME" VARCHAR2(30), PRIMARY KEY
("ID") )engine-INNODB' at line 3
Can someone tell me what is that I am doing wrong here!!!!
The column names should not be in double quotes, and the database engine should use an "=" sign rather than a hyphen.
try this
CREATE TABLE `DEPARTMENT` (
`ID` int(6) NOT NULL auto_increment,
`NAME` varchar(30) NOT NULL default '',
PRIMARY KEY (`id`)
)
ENGINE=MyISAM AUTO_INCREMENT=1;