Jump to content
  • 0

[ Error with MySQL ] - 'clan_id' int...


healthydude

Question


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   2
  • Joined:  02/05/13
  • Last Seen:  

Hey first of all thanks for taking the time to even view this issue.

So I've been following this guide: https://github.com/rathena/rathena/wiki/SQL_Installation

and I'm stuck in this part:


GdUYaiU.png


Well, the problem is, when I click the thunderbolt icon, it shows this error:

438493204_July72018-Error.thumb.jpg.587d7b598d83ca5929e5dab78a9fd5b6.jpg

Error says:

12:32:11    `clan_id` int(11) unsigned NOT NULL AUTO_INCREMENT,   `name` varchar(24) NOT NULL DEFAULT '',   `master` varchar(24) NOT NULL DEFAULT '',   `mapname` varchar(24) NOT NULL DEFAULT '',   `max_member` smallint(6) unsigned NOT NULL DEFAULT '0',   PRIMARY KEY (`clan_id`) ) ENGINE=MyISAM AUTO_INCREMENT=5    Error Code: 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 '`clan_id` int(11) unsigned NOT NULL AUTO_INCREMENT,   `name` varchar(24) NOT NUL' at line 1    0.000 sec

My problem is this error, it doesn't create the necessary tables for the 'ragnarok' database.

Here are the only tables that shows up:


1148161579_July72018-Error2.jpg.e1c11e328a7ce2f3407f4d9d26355b9f.jpg

Attached is the copy of my downloaded main.sql from rAthena git:

Download Here: main.sql

I want to be honest here, I got really amateur experience when it comes to creating SQL databases and I would find it really helpful if someone get guide me towards the right direction here.

Looking forward for any help!

Regards,
healthydude

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  64
  • Reputation:   2
  • Joined:  02/05/13
  • Last Seen:  

I removed this entire line of code from the main.sql and I got rid of the error, but I'm not sure what the outcome might be:

--
-- Table structure for table `clan`
--
CREATE TABLE IF NOT EXISTS `clan` (
  `clan_id` int(11) unsigned NOT NULL auto_increment,
  `name` varchar(24) NOT NULL DEFAULT '',
  `master` varchar(24) NOT NULL DEFAULT '',
  `mapname` varchar(24) NOT NULL DEFAULT '',
  `max_member` smallint(6) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`clan_id`)
) ENGINE=MyISAM auto_increment=5;

-- ----------------------------
-- Records of clan
-- ----------------------------
INSERT INTO `clan` VALUES ('1', 'Swordman Clan', 'Raffam Oranpere', 'prontera', '500');
INSERT INTO `clan` VALUES ('2', 'Arcwand Clan', 'Devon Aire', 'geffen', '500');
INSERT INTO `clan` VALUES ('3', 'Golden Mace Clan', 'Berman Aire', 'prontera', '500');
INSERT INTO `clan` VALUES ('4', 'Crossbow Clan', 'Shaam Rumi', 'payon', '500');

-- ----------------------------
-- Table structure for `clan_alliance`
-- ----------------------------
CREATE TABLE IF NOT EXISTS `clan_alliance` (
  `clan_id` int(11) unsigned NOT NULL DEFAULT '0',
  `opposition` int(11) unsigned NOT NULL DEFAULT '0',
  `alliance_id` int(11) unsigned NOT NULL DEFAULT '0',
  `name` varchar(24) NOT NULL DEFAULT '',
  PRIMARY KEY (`clan_id`,`alliance_id`),
  KEY `alliance_id` (`alliance_id`)
) ENGINE=MyISAM;

-- ----------------------------
-- Records of clan_alliance
-- ----------------------------
INSERT INTO `clan_alliance` VALUES ('1', '0', '3', 'Golden Mace Clan');
INSERT INTO `clan_alliance` VALUES ('2', '0', '3', 'Golden Mace Clan');
INSERT INTO `clan_alliance` VALUES ('2', '1', '4', 'Crossbow Clan');
INSERT INTO `clan_alliance` VALUES ('3', '0', '1', 'Swordman Clan');
INSERT INTO `clan_alliance` VALUES ('3', '0', '2', 'Arcwand Clan');
INSERT INTO `clan_alliance` VALUES ('3', '0', '4', 'Crossbow Clan');
INSERT INTO `clan_alliance` VALUES ('4', '0', '3', 'Golden Mace Clan');
INSERT INTO `clan_alliance` VALUES ('4', '1', '2', 'Arcwand Clan');

--
-- Table structure for table `elemental`
--

CREATE TABLE IF NOT EXISTS `elemental` (
  `ele_id` int(11) unsigned NOT NULL auto_increment,
  `char_id` int(11) NOT NULL,
  `class` mediumint(9) unsigned NOT NULL default '0',
  `mode` int(11) unsigned NOT NULL default '1',
  `hp` int(11) unsigned NOT NULL default '0',
  `sp` int(11) unsigned NOT NULL default '0',
  `max_hp` int(11) unsigned NOT NULL default '0',
  `max_sp` int(11) unsigned NOT NULL default '0',
  `atk1` MEDIUMINT(6) unsigned NOT NULL default '0',
  `atk2` MEDIUMINT(6) unsigned NOT NULL default '0',
  `matk` MEDIUMINT(6) unsigned NOT NULL default '0',
  `aspd` smallint(4) unsigned NOT NULL default '0',
  `def` smallint(4) unsigned NOT NULL default '0',
  `mdef` smallint(4) unsigned NOT NULL default '0',
  `flee` smallint(4) unsigned NOT NULL default '0',
  `hit` smallint(4) unsigned NOT NULL default '0',
  `life_time` int(11) NOT NULL default '0',
  PRIMARY KEY  (`ele_id`)
) ENGINE=MyISAM;

 

Edited by Emistry
Please use codebox
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   0
  • Joined:  11/19/16
  • Last Seen:  

Has anyone officially solved this problem?? I've having it right now at the moment, with the latest rathena files from git.

The clan tables can't be created on mysql, but I don't see any notible syntax errors on the clan code at all...

Help?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  12/29/12
  • Last Seen:  

Hi, 

The clan table should be created first before the char table. Reason is that the char table is assigning the clan_id as reference from a table that isn't technically created yet.

Edit the main.sql file, just cut and paste this lines for clan and clan_alliance just above of the lines for the 'char' table.

 

Hope this helps. Let me know.

clansql.PNG

Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...