ProFTPD的MySQL数据库

运维 系统运维
ProFTPD是一个Unix平台 或 Unix类(如Linux, FreeBSD等) 的FTP服务器程序,是自由软件基金会版权声明 发布一项的免费软件,可以说任何人 只要遵守自由软件基金会版权声明,都可以自己修改源始代码。本文讲述的是ProFTPD的MySQL数据库的使用。

  ProFTPD中的MySQL数据库

  一、创建一个ProFTPD的数据库proftpd;

  首先您应该会把MySQL数据库服务器打开,以MySQL的超级管理员root进入创建名为proftpd的数据库;

  [root@localhost ~]# mysql -uroot -p

  Enter password: 注:在这里请您输入MySQL的管理密码;

  Welcome to the MySQL monitor. Commands end with ; or \g.

  Your MySQL connection id is 41 to server version: 4.1.11

  Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

  mysql>create database proftpd;

  mysql>Grant select,insert,update,delete,create,drop,index,alter,create temporary tables,lock tables on proftpd.* to proftpd@localhost Identified by "123456";

  mysql>quit

  说明:

  create database proftpd; 这行是创建名为proftpd的数据库;

  Grant 这行是为proftpd 数据库授权,让用户名为proftpd,密码为123456(这只是一个例子,密码自己定义),这个用来管理proftpd这个数据库;

  quit 这行是退出mysql界面;

  二、导入proftpd数据库;

  下面是一个现成的数据库,你只需要导入就行了,比较简单;把下面的代码拷贝下来,然后另存为 proftpd.sql;然后通过下面的命令来导入;

  [root@localhost ~]# mysql -uproftpd -p proftpd

  Enter password: 在这里输入proftpd 数据库管理员proftpd 的密码,我们前面举例是123456,以你设置的为准;

  下面是proftpd的数据库,您可以拷贝下来,另存为 proftpd.sql ,然后用上面的命令来导入;

#p#

  1.   -- 数据库: `proftpd`  
  2.  
  3.   --  
  4.  
  5.   -- --------------------------------------------------------  
  6.  
  7.   --  
  8.  
  9.   -- 表的结构 `ftpgroups`  
  10.  
  11.   --  
  12.  
  13.   CREATE TABLE `ftpgroups` (  
  14.  
  15.   `groupname` varchar(30) NOT NULL default '',  
  16.  
  17.   `gid` int(11) NOT NULL default '1000',  
  18.  
  19.   `members` varchar(255) NOT NULL default ''  
  20.  
  21.   ) ENGINE=MyISAM DEFAULT CHARSET=latin1;  
  22.  
  23.   -- --------------------------------------------------------  
  24.  
  25.   --  
  26.  
  27.   -- 表的结构 `ftpusers`  
  28.  
  29.   --  
  30.  
  31.   CREATE TABLE `ftpusers` (  
  32.  
  33.   `userid` varchar(30) NOT NULL default '',  
  34.  
  35.   `passwd` varchar(80) NOT NULL default '',  
  36.  
  37.   `uid` int(10) unsigned NOT NULL default '1000',  
  38.  
  39.   `gid` int(10) unsigned NOT NULL default '1000',  
  40.  
  41.   `homedir` varchar(255) NOT NULL default '',  
  42.  
  43.   `shell` varchar(255) NOT NULL default '/sbin/nologin',  
  44.  
  45.   `count` int(10) unsigned NOT NULL default '0',  
  46.  
  47.   `host` varchar(30) NOT NULL default '',  
  48.  
  49.   `lastlogin` varchar(30) NOT NULL default '',  
  50.  
  51.   UNIQUE KEY `userid` (`userid`)  
  52.  
  53.   ) ENGINE=MyISAM DEFAULT CHARSET=latin1;  
  54.  
  55.   --  
  56.  
  57.   -- 导出表中的数据 `ftpusers`  
  58.  
  59.   --  
  60.  
  61.   INSERT INTO `ftpusers` VALUES ('test', 'test', 1000, 1000, '/home/test', '/sbin/nologin',0,'','');  
  62.  
  63.   -- --------------------------------------------------------  
  64.  
  65.   --  
  66.  
  67.   -- 表的结构 `quotalimits`  
  68.  
  69.   --  
  70.  
  71.   CREATE TABLE `quotalimits` (  
  72.  
  73.   `name` varchar(30) default NULL,  
  74.  
  75.   `quota_type` enum('user','group','class','all') NOT NULL default 'user',  
  76.  
  77.   `per_session` enum('false','true') NOT NULL default 'false',  
  78.  
  79.   `limit_type` enum('soft','hard') NOT NULL default 'soft',  
  80.  
  81.   `bytes_in_avail` float NOT NULL default '0',  
  82.  
  83.   `bytes_out_avail` float NOT NULL default '0',  
  84.  
  85.   `bytes_xfer_avail` float NOT NULL default '0',  
  86.  
  87.   `files_in_avail` int(10) unsigned NOT NULL default '0',  
  88.  
  89.   `files_out_avail` int(10) unsigned NOT NULL default '0',  
  90.  
  91.   `files_xfer_avail` int(10) unsigned NOT NULL default '0'  
  92.  
  93.   ) ENGINE=MyISAM DEFAULT CHARSET=latin1;  
  94.  
  95.   -- --------------------------------------------------------  
  96.  
  97.   --  
  98.  
  99.   -- 表的结构 `quotatallies`  
  100.  
  101.   --  
  102.  
  103.   CREATE TABLE `quotatallies` (  
  104.  
  105.   `name` varchar(30) NOT NULL default '',  
  106.  
  107.   `quota_type` enum('user','group','class','all') NOT NULL default 'user',  
  108.  
  109.   `bytes_in_used` float NOT NULL default '0',  
  110.  
  111.   `bytes_out_used` float NOT NULL default '0',  
  112.  
  113.   `bytes_xfer_used` float NOT NULL default '0',  
  114.  
  115.   `files_in_used` int(10) unsigned NOT NULL default '0',  
  116.  
  117.   `files_out_used` int(10) unsigned NOT NULL default '0',  
  118.  
  119.   `files_xfer_used` int(10) unsigned NOT NULL default '0'  
  120.  
  121.   ) ENGINE=MyISAM DEFAULT CHARSET=latin1;  

【编辑推荐】

  1. ProFTPD 下的五大问题
  2. vsftpd安装篇
  3. vsftpd 启动篇
  4. ProFTPD的配置
  5. ProFTPD的配置
  6. 如何安装ProFTPD
责任编辑:zhaolei 来源: 网络转载
相关推荐

2011-02-22 14:26:04

ProFTPD

2011-03-03 10:00:14

ProFTPD建立MySQL

2011-03-08 08:49:55

MySQL优化单机

2011-05-13 09:42:21

2009-05-08 09:56:37

MaxDBMySQL数据库管理

2011-03-09 08:53:02

MySQL优化集群

2017-09-26 13:35:40

Mysql数据库设计树状数据

2011-08-23 15:16:54

OracleMySQL

2011-03-31 14:34:46

cactimysql备份

2011-03-30 13:57:41

MySQL数据库自动备份

2010-10-13 11:54:00

MySQL数据库表

2010-11-23 11:04:25

查看MySQL数据库

2011-04-07 15:47:28

MySQL数据库

2011-05-11 10:26:36

MySQL数据库无缝迁移

2011-03-03 17:56:52

MySQL数据库优化

2011-04-14 11:09:14

MySQL数据库

2019-11-07 14:46:09

数据库MySQL命令

2010-06-02 16:57:50

MySQL数据库同步

2010-06-12 12:45:14

高效MySQL数据库

2019-03-01 13:40:01

MySQL数据库备份案例
点赞
收藏

51CTO技术栈公众号