Home > OS >  Does anyone know how to fix Error 1103 in MySQL?
Does anyone know how to fix Error 1103 in MySQL?

Time:12-04

I am quite new to MySQL, I downloaded the file and then opened it in SQL I ran it, but it didn't work and stated the following

Error Code: 1103. Incorrect table name 'campaign';/!40101 SET @saved_cs_client = @@character_set_client /;/!40101 SET character_set'

This is where I believe the problem is

DROP TABLE IF EXISTS `campaign';
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `campaign` (
  `id` bigint(20) NOT NULL,
  `name` text,
  `sub_category_id` bigint(20) DEFAULT NULL,
  `country_id` bigint(20) DEFAULT NULL,
  `currency_id` bigint(20) DEFAULT NULL,
  `launched` datetime DEFAULT NULL,
  `deadline` datetime DEFAULT NULL,
  `goal` double DEFAULT NULL,
  `pledged` double DEFAULT NULL,
  `backers` bigint(20) DEFAULT NULL,
  `outcome` text,
  PRIMARY KEY (`id`),
  KEY `country_id` (`country_id`),
  KEY `sub_category_id` (`sub_category_id`),
  KEY `currency_id` (`currency_id`),
  CONSTRAINT `campaign_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `country` (`id`),
  CONSTRAINT `campaign_ibfk_2` FOREIGN KEY (`sub_category_id`) REFERENCES `sub_category` (`id`),
  CONSTRAINT `campaign_ibfk_3` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;

Dumping data for table `campaign`
--
LOCK TABLES `campaign` WRITE;
/*!40000 ALTER TABLE `campaign` DISABLE KEYS */;
INSERT INTO `campaign` VALUES (1,'Ragdolls',23,2,2)
INSERT INTO `campaign` VALUES (8667,'Blank Screen Films Summer Project 2013')
/*!40000 ALTER TABLE `campaign` ENABLE KEYS */;
UNLOCK TABLES;

Feel free to ask any question to attain more insight.

CodePudding user response:

Where you have:

DROP TABLE IF EXISTS `campaign';

this is supposed to be:

DROP TABLE IF EXISTS `campaign`;

Either you accidentally changed the backtick to a single quote, or something in your "downloaded the file and then opened it in SQL" changed it on you.

CodePudding user response:

  1. Select table in the VT;
  2. Select Data page, view table content;
  3. Select Database page and refresh it by pressing F5 button;
  4. Return to Data page and try to refresh data by pressing F5 button;
  5. See error massage: SQL Error (1103): Incorrect table name ''
  • Related