user3383566
user3383566

Reputation: 11

Syntax error, unexpected TEXT_STRING (Wamp/MySQL Workbench)

My dad-in-law's webserver broke down yesterday, and we are trying to get a new one up running. We transfered the frm/MYD/MYI files to my computer, and I have now managed to restore the sql files and tables. But when I tried to launch the page, it just showed up a load of gibberish. I then opened the files in MySQL Workbench and found out that all (') had been replaced with (`)'s. So after painstakingly replacing them, I tried to forward engineer again, but still the same gibberish was shown. I checked the code again and noticed that I'm getting this error, all the way through the code at 'x':

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

CREATE SCHEMA IF NOT EXISTS 'x' DEFAULT CHARACTER SET latin1 ;

USE 'x' ;

-- -----------------------------------------------------
-- Table 'x'.'configuration'
-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS 'x'.'configuration' (
  'config_item' VARCHAR(64) NOT NULL DEFAULT '',
  'config_value' VARCHAR(255) NOT NULL DEFAULT '')
ENGINE = MyISAM
DEFAULT CHARACTER SET = latin1;

Any idea what the heck I'm doing wrong?

@Sirko Sooooo, like this?

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';

CREATE SCHEMA IF NOT EXISTS `x` DEFAULT CHARACTER SET latin1 ;

USE `x` ;

-- -----------------------------------------------------
-- Table `x`.`configuration`
-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `x`.`configuration` (
  `config_item` VARCHAR(64) NOT NULL DEFAULT '',
  `config_value` VARCHAR(255) NOT NULL DEFAULT '')
ENGINE = MyISAM
DEFAULT CHARACTER SET = latin1;

Upvotes: 1

Views: 1061

Answers (1)

AdiCrainic
AdiCrainic

Reputation: 276

Try this:

CREATE TABLE IF NOT EXISTS `x`.`configuration` (
  `config_item` VARCHAR(64) NOT NULL DEFAULT '',
  `config_value` VARCHAR(255) NOT NULL DEFAULT '')
ENGINE = MyISAM
DEFAULT CHARACTER SET = latin1;

Upvotes: 1

Related Questions