Jump to content

Whats Wrong With this MYSQL?


cursed

Recommended Posts

mySQL file is attached:

here are the tables for the mySQL:
[code]
CREATE TABLE `ads` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `code` text NOT NULL,
  `location` varchar(255) NOT NULL default '',
  `advertisername` varchar(255) NOT NULL default '',
  `adcomment` text NOT NULL,
  `impressions` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

CREATE TABLE `categories` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `type` varchar(255) NOT NULL default 'Games',
  `desc` varchar(255) NOT NULL default '',
  `keywords` varchar(255) NOT NULL default '',
  `order` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=22 DEFAULT CHARSET=latin1;

CREATE TABLE `comments` (
  `id` int(10) NOT NULL auto_increment,
  `gid` int(10) NOT NULL default '0',
  `uid` int(10) NOT NULL default '0',
  `comment` varchar(255) NOT NULL default '',
  `rating` enum('0','1','2','3','4','5','6','7','8','9','10') NOT NULL default '0',
  `date` int(10) NOT NULL default '0',
  `postip` varchar(16) NOT NULL default '',
  `active` enum('Yes','No') NOT NULL default 'Yes',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `comments_config` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `string` varchar(255) NOT NULL default '',
  `integer` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

CREATE TABLE `gameplays` (
  `id` int(10) NOT NULL auto_increment,
  `gid` int(10) NOT NULL default '0',
  `uid` int(10) NOT NULL default '0',
  `time` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `games` (
  `id` int(10) NOT NULL auto_increment,
  `nameid` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `desc` varchar(255) NOT NULL default '',
  `time` int(10) NOT NULL default '0',
  `width` int(10) NOT NULL default '0',
  `height` int(10) NOT NULL default '0',
  `cat` varchar(255) NOT NULL default '',
  `rating` decimal(3,2) NOT NULL default '0.00',
  `type` enum('SWF','extlink','DCR','CustomCode') NOT NULL default 'SWF',
  `authorsite` varchar(255) NOT NULL default '',
  `authorname` varchar(255) NOT NULL default '',
  `gameurl` varchar(255) NOT NULL default '',
  `code` text NOT NULL,
  `playcount` int(10) NOT NULL default '0',
  `weeklyplays` int(10) NOT NULL default '0',
  `flags` varchar(255) NOT NULL default '',
  `instructions` text NOT NULL,
  `keywords` varchar(255) NOT NULL default '',
  `disphtml` enum('Config','No','Yes') NOT NULL default 'Config',
  `disphtmlcode` text NOT NULL,
  `order` int(10) NOT NULL default '0',
  `active` enum('Yes','No') NOT NULL default 'Yes',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `games_config` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `string` varchar(255) NOT NULL default '',
  `integer` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;

CREATE TABLE `info` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `string` varchar(255) NOT NULL default '',
  `integer` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

CREATE TABLE `links` (
  `id` int(10) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `url` varchar(255) NOT NULL default '',
  `trackingurl` varchar(255) NOT NULL default '',
  `desc` varchar(255) NOT NULL default '',
  `in` int(10) NOT NULL default '0',
  `out` int(10) NOT NULL default '0',
  `homepage` enum('Yes','No') NOT NULL default 'Yes',
  `active` enum('Yes','No') NOT NULL default 'Yes',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

CREATE TABLE `links_config` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `string` varchar(255) NOT NULL default '',
  `integer` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;

CREATE TABLE `members` (
  `id` int(10) NOT NULL auto_increment,
  `username` varchar(16) NOT NULL default '',
  `password` varchar(32) NOT NULL default '',
  `email` varchar(255) NOT NULL default '',
  `emailshow` enum('No','Yes') NOT NULL default 'No',
  `receiveadminemails` enum('No','Yes') NOT NULL default 'No',
  `confcode` varchar(32) NOT NULL default '',
  `active` enum('Unconfirmed','No','Yes') NOT NULL default 'Unconfirmed',
  `regtime` int(10) NOT NULL default '0',
  `totalgames` int(10) NOT NULL default '0',
  `totalcomments` int(10) NOT NULL default '0',
  `aim` varchar(255) NOT NULL default '',
  `yahoo` varchar(255) NOT NULL default '',
  `msn` varchar(255) NOT NULL default '',
  `icq` varchar(255) NOT NULL default '',
  `location` varchar(255) NOT NULL default '',
  `websiteurl` varchar(255) NOT NULL default '',
  `avatarurl` varchar(255) NOT NULL default '',
  `info` varchar(255) NOT NULL default '',
  `admin` enum('No','Yes') NOT NULL default 'No',
  `favorites` text NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

CREATE TABLE `members_config` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `string` varchar(255) NOT NULL default '',
  `integer` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;

CREATE TABLE `news` (
  `id` int(10) NOT NULL auto_increment,
  `title` varchar(255) NOT NULL default '',
  `content` text NOT NULL,
  `date` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

CREATE TABLE `pages` (
  `id` int(10) NOT NULL auto_increment,
  `showinmenu` enum('Yes','No') NOT NULL default 'Yes',
  `title` varchar(255) NOT NULL default '',
  `content` text NOT NULL,
  `keywords` varchar(255) NOT NULL default '',
  `description` varchar(255) NOT NULL default '',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

CREATE TABLE `pm` (
  `id` int(10) NOT NULL auto_increment,
  `from` int(10) NOT NULL default '0',
  `to` int(10) NOT NULL default '0',
  `date` int(10) NOT NULL default '0',
  `subject` varchar(16) NOT NULL default '',
  `content` text NOT NULL,
  `readdate` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

CREATE TABLE `sessions` (
  `id` int(10) NOT NULL auto_increment,
  `userid` int(10) NOT NULL default '0',
  `ip` varchar(16) NOT NULL default '',
  `time` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=67 DEFAULT CHARSET=latin1;

CREATE TABLE `site_config` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `string` varchar(255) NOT NULL default '',
  `integer` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;

CREATE TABLE `taf_config` (
  `id` int(10) NOT NULL auto_increment,
  `name` varchar(255) NOT NULL default '',
  `string` varchar(255) NOT NULL default '',
  `integer` int(10) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
[/code]

I get this error:

Error 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 '; -- -- Dumping data for table `games` -- INSERT INTO `games` (`id`, `' at line 44


This is a game script and the SQL is to insert games into the database.


[attachment deleted by admin]
Link to comment
Share on other sites

so i would change this:

[code]
) ENGINE=MyISAM AUTO_INCREMENT=1758 DEFAULT CHARSET=latin1 AUTO_INCREMENT=1758 ;
[/code]

to

[code]
) AUTO_INCREMENT=1758 DEFAULT CHARSET=latin1 AUTO_INCREMENT=1758 ;
[/code]

?


because it still gives me the same error.
Link to comment
Share on other sites

no cursed, delete the charset, not the engine.

[code]
) ENGINE=MyISAM AUTO_INCREMENT=1758 DEFAULT CHARSET=latin1 AUTO_INCREMENT=1758 ;
[/code]
to:
[code]
) ENGINE=MyISAM AUTO_INCREMENT=1758 AUTO_INCREMENT=1758 ;
[/code]
Link to comment
Share on other sites

Thanks for the clarification, but once again, I have the same error:
Error 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 '; -- -- Dumping data for table `games` -- INSERT INTO `games` (`id`, `' at line 44
Link to comment
Share on other sites

[quote author=iamgregg link=topic=123578.msg514878#msg514878 date=1169926981]
Could it be something as simple as stating auto_increment twice?

[quote]) ENGINE=MyISAM [b]AUTO_INCREMENT=1758[/b] DEFAULT CHARSET=latin1 [b]AUTO_INCREMENT=1758[/b] ;[/quote]
[/quote]

That would have been my guess as well at first glance, but the sql does work in MYSQL 5.0

[quote author=cursed link=topic=123578.msg514858#msg514858 date=1169925119]
5.0.27-Debian_0.dotdeb.1

Same SQL, im using PHPMiniAdmin
[/quote]

As mentioned above the sql appears fine. I've tested it in MYSQL 5.0.27. I have to assume PHPminiadmin is parsing the file incorrectly somehow and sending a syntactically incorrect query when doing the import.

I recommend you import this file yourself using one of the methods below.

1) open a terminal and run
[code]
mysql -uusername -ppassword databasename < /path/to/sql.txt
[/code]

2) Login to the server with mysql monitor
[code]
mysql -u username -p
Enter password at prompt
[/code]

Then issue the following query after selecting the database
[code]
SOURCE /path/to/sql.txt
[/code]

You can try the "SOURCE" query using php...admin but I don't recall right now whether or not it's a client specific query.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.