Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Type=MyISAM Error

Tags:

database

mysql

I am working on my forums website earlier this month and came across a little problem. Unfortunately, everything has gone smoothly except for my database. I was making a table in it called users with this script...

CREATE TABLE `users` (
`id` int(4) NOT NULL auto_increment,
`username` varchar(65) NOT NULL default '',
`password` varchar(65) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;

When I tried to run the code however, I get this 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=MyISAM AUTO_INCREMENT=2' at line 6

I have dealt with this once before by running it with Engine, but I got two different errors when I did that this time.

I did some research on it and thought my MySQL code may be outdated, but when I ran the code on the same version of MySQL from my one of my employees computers, it worked fine. After that, I tried running it on an older version of MySQL from my computer again, but still got an error.

My assumption is it may be a simple mistake, or a computer/server error. I would try to just do my website on a different computer, speaking that I own a computer shop, but I don't want to have to start all over since it is localhost. Also, I am at a loss for flash drives and with the weather we have been getting out here in north Scandinavia, there is no way I will be able to get it shipped any time soon.

So, as a last resort I decided to ask you guys. Help is appreciated.

like image 968
PCJackson Avatar asked Feb 21 '14 14:02

PCJackson


People also ask

What is MyISAM in MySQL?

MyISAM stands for Indexed Sequential Access Method. It was the default storage engine for MySQL until December 2009. With the release of MySQL 5.5, MyISAM was replaced with InnoDB. MyISAM is based on an ISAM algorithm that displays information from large data sets fast.


1 Answers

you must change this

  TYPE=MyISAM

to

 ENGINE=MyISAM

TYPE was deprecated in MySQL 4.0 and removed in MySQL 5.5.

documentation http://dev.mysql.com/doc/refman/5.6/en/create-table.html

like image 118
echo_Me Avatar answered Oct 02 '22 05:10

echo_Me