Jump to content

mySQL Database on Ubuntu


wildweaselmi

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





CREATE DATABASE pureftpd;



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';



FLUSH PRIVILEGES;










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;





CREATE TABLE ftpd (



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,



PRIMARY KEY (User),



UNIQUE KEY User (User)



) TYPE=MyISAM;





quit;





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 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
Reply to this topic...

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