Phpmyadmin Error Code 1064
Contents |
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
Error 1064 (42000): You Have An Error In Your Sql Syntax;
about Stack Overflow the company Business Learn more about hiring developers or posting 1064 mysql ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack
Error Code 1064 In Mysql
Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up phpMyadmin - Error #1064 up vote 2 down vote favorite When mysql error 1064 (42000) trying to create this table in my db, I get an 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 'unsigned NOT NULL default '0', PRIMARY KEY (reminder_id), KEY reminder_id (rem' at line 5 CREATE TABLE reminder_events ( reminder_id bigint(20) unsigned NOT NULL auto_increment, reminder_name varchar(255) NOT NULL default '', #1064 - you have an error in your sql syntax reminder_desc text, reminder_date varchar(8) unsigned NOT NULL default '0', PRIMARY KEY (reminder_id), KEY reminder_id (reminder_id) ) TYPE=MyISAM; Can anyone see what I'm doing wrong? mysql phpmyadmin mysql-error-1064 share|improve this question edited Jan 13 '11 at 10:58 ajreal 36.7k85899 asked Jan 13 '11 at 10:34 En-Motion 30421025 add a comment| 3 Answers 3 active oldest votes up vote 2 down vote accepted The problem is that you're trying to define a text field (varchar) as being unsigned, which is something that can only apply to a numerical field. i.e.: "reminder_date varchar(8) unsigned NOT NULL default '0'," makes no sense. However, as the field is called "reminder_date", I'm guessing you're attempting to store a date, in which case you really want to use MySQLs DATE field type. e.g.: "reminder_date DATE NOT NULL," Additionally, if you're going to want to search on any of these fields, you should also add some indexes to speed up the searches. So, if you wanted to be able to search on the name and date, you could use: CREATE TABLE reminder_events ( reminder_id bigint(20) unsigned NOT NULL auto_increment, reminder_name varchar(255) NOT NULL DEFAULT '', reminder_desc text, reminder_date DATE NOT NULL, PRIMARY KEY (reminder_id), KEY reminder_id (reminder_id), KEY reminder_name (reminder_name), KEY reminder_date (re
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
You Have An Error In Your Sql Syntax Check The Manual That Corresponds To Your Mysql Server Version
Us Learn more about Stack Overflow the company Business Learn more about hiring developers error 1064 mysql 42000 mysqldump or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack
Error 1064 Mysql 42000 Create Table
Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Creating tables in PhpMyAdmin - error 1064 http://stackoverflow.com/questions/4679080/phpmyadmin-error-1064 up vote 0 down vote favorite The code: delimiter $$ CREATE TABLE "login" ( "IdUser" int(11) NOT NULL AUTO_INCREMENT, "username" varchar(45) CHARACTER SET latin1 NOT NULL, "pass" varchar(45) CHARACTER SET latin1 NOT NULL, PRIMARY KEY ("IdUser") ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8$$ CREATE TABLE "photos" ( "IdPhoto" int(11) NOT NULL AUTO_INCREMENT, "title" varchar(100) CHARACTER SET latin1 NOT NULL, "IdUser" int(11) NOT NULL, PRIMARY KEY ("IdPhoto") ) ENGINE=MyISAM http://stackoverflow.com/questions/18005685/creating-tables-in-phpmyadmin-error-1064 AUTO_INCREMENT=2 DEFAULT CHARSET=utf8$$ Errors: #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 '"login" ( "IdUser" int(11) NOT NULL AUTO_INCREMENT, "username" varchar(45)' at line 1 #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 '"photos" ( "IdPhoto" int(11) NOT NULL AUTO_INCREMENT, "title" varchar(100)' at line 1 Any ideas? I'm brand new to this so any help would be very much appreciated. Thank you. mysql sql table phpmyadmin share|improve this question edited Aug 1 '13 at 22:46 peterm 57.6k56277 asked Aug 1 '13 at 22:25 Matt Walker 111 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote Use backticks like this ` instead of double quotes throughout For example: `IdUser` int(11) NOT NULL AUTO_INCREMENT, share|improve this answer answered Aug 1 '13 at 22:29 user1864610 add a comment| up vote 1 down vote You can use double quotes in identifiers only if the ANSI_QUOTES SQL mode is enabled. SET sql_mode='ANSI_QUOTES'; Here is SQLFiddle demo Otherwise just use back tick
Plans & Pricing Partners Support Resources Preview Forums Forums Quick Links Search Forums New Posts Search titles only Posted by Member: Separate names with a comma. Newer Than: Search this thread only Search this forum only Display https://forums.cpanel.net/threads/phpmyadmin-error-1064-create-table-problem.213611/ results as threads More... Useful Searches Recent Posts Resources Resources Quick Links Search Resources Most Active Authors Latest Reviews Feature Requests Defects Menu Log in Sign up The Community Forums Interact with an entire community of cPanel http://www.yiiframework.com/forum/index.php/topic/24958-solved-mysql-error-1064-sql-syntax/ & WHM users! cPanel Forums > cPanel & WHM® (for Linux® Servers) > Database Discussions > This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More. error 1064 phpMyAdmin - Error #1064 -- Create Table problem Discussion in 'Database Discussions' started by quantass, Jun 6, 2011. quantass Registered Joined: Jun 6, 2011 Messages: 3 Likes Received: 0 Trophy Points: 1 I am using CPanel 11 and the built in phpMyAdmin. I'm trying to import my SQL statements in but am getting the following error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL you have an server version for the right syntax to use near '`0`, `ip_address` varchar(16) NOT NULL DEFAULT `0`, `user_agent` varchar(5' at line 2 CREATE TABLE IF NOT EXISTS `ci_sessions` ( `session_id` varchar( 40 ) NOT NULL DEFAULT `0` , `ip_address` varchar( 16 ) NOT NULL DEFAULT `0` , `user_agent` varchar( 50 ) NOT NULL , `last_activity` int( 10 ) unsigned NOT NULL DEFAULT `0` , `user_data` text NOT NULL , PRIMARY KEY ( `session_id` ) ) ENGINE = MYISAM DEFAULT CHARSET = latin1;Click to expand... Any clue as to the issue? My local mySQL is version 5.1.41 and was used to export the statement. #1 quantass, Jun 6, 2011 cPanelTristan Quality Assurance Analyst Staff Member Joined: Oct 2, 2010 Messages: 7,623 Likes Received: 19 Trophy Points: 38 Location: somewhere over the rainbow cPanel Access Level: Root Administrator Just to clarify, you used the same server to export the statement that you are using to import the statement with both running the same MySQL version? Next, what is the exact statement you are using to import? It almost seems as if you aren't separating the ENGINE and DEFAULT CHARSET statements in any way. cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs -- Tristan, Technical Analyst III, Forums Specialist,
Extensions Demos Logo Documentation Take the Tour Tutorials Class Reference Wiki Guide 2.0 Class Reference 2.0 Screencasts Resources Development Contribute to Yii Latest Updates Report a Bug Report a Security Issue Community Forum Live Chat News Hall of Fame Badges search Yii Framework Forum: [SOLVED] mySQL Error #1064 - SQL syntax - Yii Framework Forum Jump to content Sign In » New user? Register Now! Help Search Advanced ForumsMembers Yii Framework Forum > Archives > Agile Web Application Development with Yii1.1 and PHP5 View New Content Page 1 of 1 You cannot start a new topic This topic is locked [SOLVED] mySQL Error #1064 - SQL syntax pp 96 97 single quotes vs backquotes for CREATE TABLE #1 windsor Junior Member Group: Members Posts: 63 Joined: 04-October 11 Location:Tampa, FL Posted 21 October 2011 - 03:48 PM Getting 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 ''tbl_project_user_assignment' ( 'project_id' Int(11) NOT NULL, 'user_id' Int(11)' at line 1 When trying to import this SQL statement using phpMyAdmin and mySQL CREATE TABLE IF NOT EXISTS 'tbl_project_user_assignment' ( 'project_id' Int(11) NOT NULL, 'user_id' Int(11) NOT NULL, 'create_time' DATETIME, 'create_user_id' INTEGER, 'update_time' DATETIME, 'update_user_id' INTEGER, PRIMARY KEY ('project_id','user_id') ) ENGINE = InnoDB ; What worked for me is to change the single quotes to back quotes like below: CREATE TABLE IF NOT EXISTS `tbl_project_user_assignment` ( `project_id` Int(11) NOT NULL, `user_id` Int(11) NOT NULL, `create_time` DATETIME, `create_user_id` INTEGER, `update_time` DATETIME, `update_user_id` INTEGER, PRIMARY KEY (`project_id`,`user_id`) ) ENGINE = InnoDB ; I don't know why this worked, but it did This is my environment: MySQL Server: localhost via TCP/IPServer version: 5.5.16Protocol version: 10User: root@localhost MySQL charset: UTF-8 Unicode (utf8) Web server Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1MySQL client version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $PHP extension: mysql phpMyAdmin Version information: 3.4.5, latest stable version: 3.4.6 0 Back to top of the page up there ^ Forum Home News and announcements