You need one database and at least two tables in that database.
#sudo mysql
Create database
mysql> CREATE DATABASE proftpd;
If you do not want to create a database just do:
mysql> use [DATABASE];
where database is the database you want to use or
mysql> use proftpd;
if you created the database above.
Create tables for users and groups
mysql> CREATE TABLE users (
userid varchar(10) NOT NULL default '',
uid int(10) unsigned NOT NULL auto_increment,
gid int(10) unsigned NOT NULL default '0',
passwd varchar(255) NOT NULL default '',
homedir varchar(255) NOT NULL default '',
description varchar(255) NOT NULL default '',
disabled int(10) unsigned NOT NULL default '0',
shell varchar(20) NOT NULL default '',
expires datetime NOT NULL default '0000-00-00 00:00:00',
email varchar(255) NOT NULL default '',
name varchar(255) NOT NULL default '',
ul_bytes bigint(20) NOT NULL default '0',
dl_bytes bigint(20) NOT NULL default '0',
login_count bigint(20) NOT NULL default '0',
dl_count bigint(20) NOT NULL default '0',
ul_count bigint(20) NOT NULL default '0',
last_login datetime default NULL,
PRIMARY KEY (uid)
) TYPE=MyISAM;
mysql> CREATE TABLE groups (
groupid varchar(10) NOT NULL default '',
gid int(10) unsigned NOT NULL auto_increment,
members varchar(255) NOT NULL default '',
PRIMARY KEY (gid)
) TYPE=MyISAM;
mysql
> INSERT INTO users (uid) VALUES (9999);
mysql>
INSERT INTO groups (gid) VALUES (9999);
mysql>
DELETE FROM users WHERE uid=9999;
mysql>
DELETE FROM groups WHERE gid=9999;
The last four lines is there to make the default uid and gid 10000. This might be a good idea since you do not want your ftp users to conflict with your system users.
User privileges
You should also give access for the proftpd mysql database user to read and write these tables:
mysql>
GRANT ALL ON users TO proftpd@localhost IDENTIFIED BY 'proftpd';
mysql>
GRANT ALL ON groups TO proftpd@localhost IDENTIFIED BY 'proftpd';
This creates a database user named proftpd which can connect from localhost with password "proftpd". Since we want to use this database from another system too we want to add another host to this user:
mysql>
GRANT ALL ON users TO proftpd@server1.ubuntulinux.co.in IDENTIFIED BY 'proftpd';
mysql>
GRANT ALL ON groups TO proftpd@server1.ubuntulinux.co.in IDENTIFIED BY 'proftpd';