Go Back   FlashFXP Forums > > > >

NeoXed's scripts nxAutoNuke, nxTools, etc.

Reply
 
Thread Tools Rate Thread Display Modes
Old 12-22-2005, 06:18 PM   #1
void4ever
Junior Member
 
Join Date: Nov 2005
Posts: 27
Default Importing Invite database

Hey there guys, so i'm having some trouble importing the invite sql statements to a linux box running Mysql v4.0.26

here is the error log

Query:
CREATE TABLE `invite_hosts` (
`ftp_user` varchar(255) NOT NULL default '',
`hostmask` varchar(255) NOT NULL default '',
PRIMARY KEY (`ftp_user`,`hostmask`)
)

Error occured at:2005-12-22 15:06:42
Line no.:18
Error Code: 1071 - Specified key was too long. Max key length is 500

unfortunatly i don't know jack about sql so i'm not sure how to rewrite this to fix it. I'm using the invite.sql file included with 0.6.0. And i know i got this to import once before on it's windows counterpart, same version.

Any ideas?

Void4ever
void4ever is offline   Reply With Quote
Old 12-23-2005, 04:34 AM   #2
Harm
Too much time...
Ultimate Scripter
 
Join Date: Jul 2003
Posts: 1,430
Default

You could try to use shorter varchar fields. If the maximum length of the key is 500 in this version of mysql, using VARCHAR(250) for each field should be ok.

Note that I have no idea how this invite script works. This small change shouldn't break anything but it might..
Harm is offline   Reply With Quote
Old 12-23-2005, 10:25 AM   #3
void4ever
Junior Member
 
Join Date: Nov 2005
Posts: 27
Default

I might try that, but whats odd is the user part of the database is importing just fine.

CREATE TABLE `invite_users` (
`ftp_user` varchar(255) NOT NULL default '', -- FTP user name.
`irc_user` varchar(255) default NULL, -- IRC user name.
`online` tinyint(1) NOT NULL default '0', -- Indicates if the user is on IRC.
`password` varchar(255) default NULL, -- Password hash (PKCS #5 v2 based).
`time` int(10) NOT NULL default '0', -- Time stamp of last activity.
PRIMARY KEY (`ftp_user`)
);

CREATE TABLE `invite_hosts` (
`ftp_user` varchar(255) NOT NULL default '', -- FTP user name.
`hostmask` varchar(255) NOT NULL default '', -- IRC host mask (ident@host).
PRIMARY KEY (`ftp_user`,`hostmask`)
);

As you can see the invite user table is using a 255 var as well. And i got no complaints from the server on that first part. And the other thing is if i remember i had the exact same version on my windows box (wanted to test the version to make sure it was compatible) and it worked just fine. Of course were talking different platforms here windows and linux, but that normally shouldn't affect a GOOD port.

Void4ever
void4ever is offline   Reply With Quote
Old 12-23-2005, 08:02 PM   #4
Harm
Too much time...
Ultimate Scripter
 
Join Date: Jul 2003
Posts: 1,430
Default

Quote:
Originally Posted by void4ever
CREATE TABLE `invite_users` (
`ftp_user` varchar(255) NOT NULL default '', -- FTP user name.
`irc_user` varchar(255) default NULL, -- IRC user name.
`online` tinyint(1) NOT NULL default '0', -- Indicates if the user is on IRC.
`password` varchar(255) default NULL, -- Password hash (PKCS #5 v2 based).
`time` int(10) NOT NULL default '0', -- Time stamp of last activity.
PRIMARY KEY (`ftp_user`)
);
In this case, the key is based on the ftp_user field and thus the key is 255 chars long.

Quote:
Originally Posted by void4ever
CREATE TABLE `invite_hosts` (
`ftp_user` varchar(255) NOT NULL default '', -- FTP user name.
`hostmask` varchar(255) NOT NULL default '', -- IRC host mask (ident@host).
PRIMARY KEY (`ftp_user`,`hostmask`)
);
In this case, the key is based on both the ftp_user and the hostmask fields and thus it's 2 * 255 = 510 chars long. It looks like this version of mysql can't handle more than 500 chars for the key.

If you're sure both versions are identical, it might be something else like an ini setting. I'm afraid I can't help you much with the mysql daemon configuration. I'm using databases, I'm not administrating them.
Harm is offline   Reply With Quote
Old 12-23-2005, 10:22 PM   #5
neoxed
Too much time...
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: May 2003
Posts: 1,326
Default

I've only tested it with MySQL v5.0, not sure how well it works with v4.0, or even v4.1 for that matter. Perhaps in v5.0 the length restriction was removed.
neoxed is offline   Reply With Quote
Old 12-24-2005, 12:21 AM   #6
void4ever
Junior Member
 
Join Date: Nov 2005
Posts: 27
Default

well i've done a bit of coding in my time so as far as i see it, there shouldn't be any issues reducing the var length then correct? As long as i'm not using a hostname name 200 some odd chars correct?

I appreciate the info guys!!!

Void4ever
void4ever is offline   Reply With Quote
Reply

Tags
default, error, key, sql, varchar255

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:37 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)