Error 1064 Foreign Key
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have
Error 1064 Mysql 42000 Foreign Key
Meta Discuss the workings and policies of this site About Us Learn error 1064 mysqldump more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us sql error 1064 Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like
Error 1064 Sqlstate 42000
you, helping each other. Join them; it only takes a minute: Sign up MySQL CREATE TABLE & FOREIGN KEY Error up vote 3 down vote favorite 1 I'm not a DB guy, but I've been hacking away at this one for a bit and can't seem to nail the issue. I've read the relevant doc page
Error 1064 Sqlstate 42000 (er_parse_error)
(http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.html) and I can't see where my syntax may be an issue. ERROR 1064 (42000) at line 84: 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 'FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE RESTRICT ON UPDATE C' at line 5 This is the relevant SQL - order(id) and user(id) are auto incrementing int(10) fields in their respective tables. DROP TABLE IF EXISTS `user_orders`; CREATE TABLE `user_orders` ( `user_id` int(10) unsigned NOT NULL default '0', `order_id` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`user_orders_user_id`, `user_orders_order_id`) FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE RESTRICT ON UPDATE CASCADE, FOREIGN KEY (order_id) REFERENCES order(id) ON DELETE RESTRICT ON UPDATE CASCADE, ) AUTO_INCREMENT=50; Help would be appreciated - especially if you can explain what I've missed. mysql mysql-error-1064 share|improve this question edited Oct 27 '11 at 5:44 mu is too short 284k41552558 asked Oct 27 '11 at 5:40 elithrar 9,58822752 add a comment| 2 A
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 error 1064 you have an error in your sql syntax site About Us Learn more about Stack Overflow the company Business Learn more
Error 1064 Mysql Workbench
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x error 1064 mysql 42000 insert Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up mysql error http://stackoverflow.com/questions/7912085/mysql-create-table-foreign-key-error 1064 in foreign keys [closed] up vote 0 down vote favorite i have table Movie which is : CREATE TABLE Movie( ----- MID INT AUTO_INCREMENT, PRIMARY KEY (MID) ); and when i want to create table rent i get the following error: CREATE TABLE Rent( ID INT AUTO_INCREMENT, name VARCHAR(20), MID INT, PRIMARY KEY (ID), FOREIGN KEY (MID) REFRENCES Movie(MID) ); error message: ERROR http://stackoverflow.com/questions/24259230/mysql-error-1064-in-foreign-keys 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 'REFRENCES Movie(MID) )' at line 6 please help ty. mysql foreign-keys share|improve this question asked Jun 17 '14 at 8:36 Sina 659 closed as off-topic by M Khalid Junaid, realspirituals, Gergo Erdosi, Mike Szyndel, nkjt Jun 17 '14 at 9:41 This question appears to be off-topic. The users who voted to close gave this specific reason:"This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – M Khalid Junaid, realspirituals, Gergo Erdosi, Mike Szyndel, nkjtIf this question can be reworded to fit the rules in the help center, please edit the question. Your REFRENCES spelling is incorrect –Sadikhasan Jun 17 '14 at 8:37 yea . great thank you. just an E
DOMAINS WEB DESIGN WEB DESIGN SERVICES CREATE YOUR OWN WEBSITE SITE HOSTING TOOLS MEET US MEET http://www.inmotionhosting.com/support/website/database-troubleshooting/error-1064 US ABOUT US PARTNERS & AWARDS BLOG WE'RE HIRING CONTACT US AMP LOGIN SUPPORT CENTER Search Support Center Product Guides Dedicated Hosting Reseller Hosting KnowledgeBase Website Email Domain Names Reseller Billing Community Support Browse Questions Ask a Question User Submitted Articles Education Channels Android BoldGrid cPanel DokuWiki error 1064 Drupal 7 Drupal 8 Everything Email Joomla 2.5 Joomla 3.1 K2 Magento 1.6 Mambo MediaWiki Moodle Movable Type OpenCart OpenCart 2.0 osCommerce PHP-Fusion PHP-Nuke phpBB phpList Premium Website Builder PrestaShop 1.5 PrestaShop 1.6 SMF Tiki Wiki VirtueMart 3 Web Hosting Manager Website Design WordPress Tools & error 1064 mysql Resources Email Configuration Blacklist Check Visual DNS Lookup Quick Tagger Icon Sets Favicon Generator Bounce Back Parser What is my IP address? >>Website .htaccess (17)Adobe Flash (2)APIs (2)Backup and Restore (15)Billing (8)Browser Issues (2)Connecting to a Database (5)cPanel (26)cPanel Account Management (16)Cron Jobs (4)Cube Cart (2)Database Setup (5)Database Troubleshooting (6)Domain Management (2)Dreamweaver (12)Drush (2)eCommerce (7)Elasticsearch (4)Fantastico (4)File Management (16)File Manager (6)FTP (10)FTP Client Setup (21)General Server Setup / Management (15)Getting Started Guides (18)Ghost (3)Google Tools (21)How To (23)HTML (2)Image Editing (2)IP Addresses (3)iWeb (1)JavaScript (2)Joomla (10)Joomla 2.5 (36)Koken (11)Linux (27)Logaholic (5)Magento (2)Maintaining Your Website (1)Managing Files (7)Microsoft FrontPage (11)Microsoft Publisher (1)ModSecurity (7) MODx (3)New Customers (7)Open Classifieds (1)PCI Compliance (7)PHP (15)PHP Configuration (7)PHP Troubleshooting (6)phpBB (25)phpMyAdmin (10)Premium Website Builder (22)Prestashop (1)Protecting Files (5)Publishing Your Site (2)Python (1)Redirects (4)Restricting Bots (5)Search Engine Optimization (1)Secure Socket Layer (SSL) Tutorials (