Jump to content

mySQL Database on Ubuntu

Recommended Posts

I saw this post and I figured I would add my two cents. Here is a snippet of what I use to create the pureftp database from command line in mysql on my ubuntu box

Create a database called pureftpd and a MySQL user named pureftpd which the PureFTPd daemon will use later on to connect to the pureftpd database:

mysql -u root -p


GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO 'pureftpd'@'localhost' IDENTIFIED BY 'ftpdpass';

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO 'pureftpd'@'localhost.localdomain' IDENTIFIED BY 'ftpdpass';


Replace the string ftpdpass with whatever password you want to use for the MySQL user pureftpd. Still on the MySQL shell, we create the database table we need (yes, there is only one table!):

USE pureftpd;


User varchar(16) NOT NULL default '',

status enum('0','1') NOT NULL default '0',

Password varchar(64) NOT NULL default '',

Uid varchar(11) NOT NULL default '-1',

Gid varchar(11) NOT NULL default '-1',

Dir varchar(128) NOT NULL default '',

ULBandwidth smallint(5) NOT NULL default '0',

DLBandwidth smallint(5) NOT NULL default '0',

comment tinytext NOT NULL,

ipaccess varchar(15) NOT NULL default '*',

QuotaSize smallint(5) NOT NULL default '0',

QuotaFiles int(11) NOT NULL default 0,


UNIQUE KEY User (User)



As you may have noticed, with the quit; command we have left the MySQL shell and are back on the Linux shell.

BTW, (I'm assuming that the hostname of your ftp server system is server1.example.com) you can access phpMyAdmin under http://server1.example.com/phpMyAdmin/ (you can also use the IP address instead of server1.example.com) in a browser and log in as the user pureftpd. Then you can have a look at the database. Later on you can use phpMyAdmin to administrate your PureFTPd server.

Link to post
Share on other sites
  • Create New...