Error #1064 In Phpmyadmin
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 about Stack Overflow the company Business mysql error 1064 Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Phpmyadmin Error 1064 Import
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just erreur 1064 phpmyadmin like you, helping each other. Join them; it only takes a minute: Sign up phpMyadmin - Error #1064 up vote 2 down vote favorite When trying to create this table in my db, I get an error: error 1064 (42000) #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 '', reminder_desc text, reminder_date varchar(8) unsigned NOT NULL default '0', PRIMARY KEY (reminder_id), KEY reminder_id (reminder_id) ) TYPE=MyISAM; Can
Error 1064 Mysqldump
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.6k75899 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 (reminder_date) ) TYPE=MyISAM; share|improve this answer edited Jan 13 '11 at 10:44 answered Jan 13 '11 at 10:37 middaparka 42.3k894104 Thanks for that. –En-Motion Jan 13 '11 at 11:32 @En-Motion - N
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 Stack Overflow the company Business Learn more about hiring sql error 1064 developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question error 1064 sqlstate 42000 x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
Error 1064 Sqlstate 42000 (er_parse_error)
it only takes a minute: Sign up MySQL error #1064, an error in your SQL syntax; check the manual that corresponds to the MySQL up vote 0 down vote favorite I'm trying to run a SQL query, using XAMPP, http://stackoverflow.com/questions/4679080/phpmyadmin-error-1064 phpmyadmin and it returns 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 'source tables/unit_type.sql' at line 1 I have looked everywhere and can't seem to find anything that works DROP TABLE IF EXISTS `unit_type`; CREATE TABLE `unit_type` ( `unit_type_id` INTEGER NOT NULL AUTO_INCREMENT, `matcher_id` VARCHAR(32) NULL, `unit_type_name` VARCHAR(64) NOT NULL, `vendor_name` VARCHAR(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL, `description` http://stackoverflow.com/questions/26927292/mysql-error-1064-an-error-in-your-sql-syntax-check-the-manual-that-correspond VARCHAR(2000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL, `protocol` VARCHAR(16) NOT NULL, PRIMARY KEY (`unit_type_id`), UNIQUE INDEX `uq_unit_type_name` (`unit_type_name`(64)) ) ENGINE = innodb CHARACTER SET = latin1 COLLATE = latin1_general_ci; Any help is appreciated. mysql phpmyadmin share|improve this question edited Jan 9 '15 at 12:27 marc_s 452k938641029 asked Nov 14 '14 at 9:58 Alexandru Patriche 2314 1 The problem is not the code in the script. It is how you execute it. Look at the error message: Error at code line source tables/unit_type.sql –juergen d Nov 14 '14 at 9:59 maybe your mysql version is too low. –mohammad falahat Nov 14 '14 at 10:06 This error message doesn't make sense with the code you posted. Are you running this from within phpMyAdmin? Using the SQL tab? Is the SQL you've posted what you paste directly in the SQL tab or is it contained in a file you're trying to import? If you're trying to import a file, use the Import tab instead. Is the SQL file on the server or on your local machine? –Isaac Bennetch Dec 15 '14 at 23:56 You appear to be trying to execute a script in the MySQL CLI, or PHP's query panel. Is that right? –Strawberry Jan 9 '15 at 12:32 add a comment| active oldest votes Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Faceboo
Plans & Pricing Partners Support Resources Preview Forums Forums Quick Links Search Forums New Posts Search titles only Posted by Member: https://forums.cpanel.net/threads/phpmyadmin-error-1064-create-table-problem.213611/ Separate names with a comma. Newer Than: Search this thread only http://www.yiiframework.com/forum/index.php/topic/24958-solved-mysql-error-1064-sql-syntax/ Search this forum only Display 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 & WHM users! error 1064 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. phpMyAdmin - Error #1064 -- Create Table problem Discussion in 'Database Discussions' started by quantass, Jun 6, 2011. quantass Registered Joined: Jun 6, 2011 sql error 1064 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 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
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 ^ For