Dear Simon,
It's great. I'll add the sql dump below. I found a little typo in line 154 of
package Project::Net::FTP::DirHandle;
$sql = "select ID, name from directories
should be:
$sql = "select ID, name from DIRECTORIES
because MySQL is case sensitive in it's column names.
To use the sql dump below do as follows:
1. mysql -p -uroot -e "create database ftpdb"
2. mysql -uroot -p -e "grant all privileges on ftpdb.* to rich@localhost identified by '123456'"
3. mysql -p -uroot -e "flush privileges"
4. save the text below from "--MySQL dump 9.10" to the bottom as example.sql
5. mysql -v -p123456 -urich ftpdb < example.sql
6. change line 40-43 in package Project::Net::FTP::Server; from:
my $dbh = DBI->connect ("dbi:mysql(RaiseError=>1,AutoCommit=>1):dbname=TEST",
"username", "password")
or die "cannot connect to database: ftp: $!";
into:
my $dbh = DBI->connect ("dbi:mysql(RaiseError=>1,AutoCommit=>1):dbname=ftpdb",
"rich", "123456")
or die "cannot connect to database: ftp: $!";
Kind regards,
Arjan Widlak
-- MySQL dump 9.10
--
-- Host: localhost Database: ftpdb
-- ------------------------------------------------------
-- Server version 4.0.18
--
-- Table structure for table `DIRECTORIES`
--
CREATE TABLE DIRECTORIES (
ID int(11) NOT NULL default '0',
parent_ID int(11) default NULL,
name text NOT NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
--
-- Dumping data for table `DIRECTORIES`
--
INSERT INTO DIRECTORIES VALUES (1,0,'');
INSERT INTO DIRECTORIES VALUES (2,1,'Home');
INSERT INTO DIRECTORIES VALUES (3,1,'Website');
INSERT INTO DIRECTORIES VALUES (4,1,'Private');
INSERT INTO DIRECTORIES VALUES (5,1,'Test');
--
-- Table structure for table `FILES`
--
CREATE TABLE FILES (
ID int(11) NOT NULL default '0',
directory_ID int(11) default NULL,
name text NOT NULL,
data blob,
PRIMARY KEY (ID)
) TYPE=MyISAM;
--
-- Dumping data for table `FILES`
--
--
-- Table structure for table `USERS`
--
CREATE TABLE USERS (
id int(11) NOT NULL auto_increment,
username text NOT NULL,
password text,
PRIMARY KEY (id)
) TYPE=MyISAM;
--
-- Dumping data for table `USERS`
--
INSERT INTO USERS VALUES (1,'rich','MpU8yRWrKoWKc');
INSERT INTO USERS VALUES (2,'dan','MpU8yRWrKoWKc');
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.