最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

FTP服务器之pure-ftpd配置Mysql虚拟ftp账号_MySQL

来源:动视网 责编:小采 时间:2020-11-09 19:26:40
文档

FTP服务器之pure-ftpd配置Mysql虚拟ftp账号_MySQL

FTP服务器之pure-ftpd配置Mysql虚拟ftp账号_MySQL:1. Mysql的连接 [root@localhost ~]# mysql -uroot -pxxxxxx(your mysql password) 2. 建立mysql认证数据库 mysql>create database pureftpd;mysql>grant privileges all on pureftpd.* to puref
推荐度:
导读FTP服务器之pure-ftpd配置Mysql虚拟ftp账号_MySQL:1. Mysql的连接 [root@localhost ~]# mysql -uroot -pxxxxxx(your mysql password) 2. 建立mysql认证数据库 mysql>create database pureftpd;mysql>grant privileges all on pureftpd.* to puref


1. Mysql的连接

 [root@localhost ~]# mysql -uroot -pxxxxxx(your mysql password)

2. 建立mysql认证数据库

mysql>create database pureftpd;mysql>grant privileges all on pureftpd.* to pureftpuser@localhost identified by 'pureftpuser';mysql>flush privileges;mysql>use pureftpd;Mysql> create table if not exists `users`(	`user` varchar(16) not null default '',	`password` varchar(32) not null default '',	`uid` int(11) not null,	`gid` int (11) not null,	`dir` varchar(128) not null default '',	`quotafiles` int(10) not null default '500',	`quotasize` int(10) not null default '30',	`ulbandwidth` int(10) not null default '80',	`dlbandwidth` int(10) not null default '80',	`ipaddress` varchar(15) not null default '*',	`comment` tinytext,	`status` enum('0','1') not null default '1',	`ulratio` smallint(5) not null default '1',	`dlratio` smallint(5) not null default '1',	primary key (`user`),	unique key `user` (`user`)	)engine=innodb default charset=utf8;mysql> show tables;+--------------------+| Tables_in_pureftpd |+--------------------+| users |+--------------------+1 row in set (0.00 sec)mysql> desc users;+-------------+---------------+------+-----+---------+-------+| Field | Type | Null | Key | Default | Extra |+-------------+---------------+------+-----+---------+-------+| user | varchar(16) | NO | PRI | | || password | varchar(32) | NO | | | || uid | int(11) | NO | | NULL | || gid | int(11) | NO | | NULL | || dir | varchar(128) | NO | | | || quotafiles | int(10) | NO | | 500 | || quotasize | int(10) | NO | | 30 | || ulbandwidth | int(10) | NO | | 80 | || dlbandwidth | int(10) | NO | | 80 | || ipaddress | varchar(15) | NO | | * | || comment | tinytext | YES | | NULL | || status | enum('0','1') | NO | | 1 | || ulratio | smallint(5) | NO | | 1 | || dlratio | smallint(5) | NO | | 1 | |+-------------+---------------+------+-----+---------+-------+14 rows in set (0.15 sec)



3 创建pureftp虚拟用户

mysql> insert into users values ('bev','pureftpuser','2000','2000','/var/pureftp/bev','500','30','30','50','*','','1','1','1');mysql> select * from users/G;*************************** 1. row *************************** user: bev password: 5bc915d575ad9c57aa0fc6e1fd719615 uid: 2000 gid: 2000 dir: /var/pureftp/bev quotafiles: 500 quotasize: 30ulbandwidth: 30dlbandwidth: 50 ipaddress: * comment: status: 1 ulratio: 1 dlratio: 11 row in set (0.11 sec)ERROR: No query specified

4. 注意mysql账户密码的加密方式需要与pureftp支持的机密方式相吻合,不然会出现530错误

mysql> update users set password=md5('pureftpuser') where user='bev';

我在这里选择的MD5加密方式,那么在下面配置pureftp的加密方式时一定选择MD5。

5. 修改pureftp关于mysql模块的配置文档

[root@localhost ~]# vi /usr/local/pure-ftpd/etc/pure-ftpd.conf # MySQL configuration file (see README.MySQL)MySQLConfigFile /usr/local/pure-ftpd/etc/pureftpd-mysql.conf保存退出[root@localhost ~]# vi /usr/local/pure-ftpd/etc/pureftpd-mysql.conf # Optional : define the location of mysql.sock if the server runs on this host.MYSQLSocket /var/lib/mysql/mysql.sock(设置成你的mysql.sock路径)# Mandatory : user to bind the server as.MYSQLUser pureftpuser# Mandatory : user password. You must have a password.MYSQLPassword pureftpuser# Mandatory : database to open.MYSQLDatabase pureftpd# Mandatory : how passwords are stored# Valid values are : "cleartext", "crypt", "sha1", "md5" and "password"# ("password" = MySQL password() function)# You can also use "any" to try "crypt", "sha1", "md5" *and* "password"MYSQLCrypt md5MYSQLGetPW SELECT Password FROM users WHERE User='/L'MYSQLGetUID SELECT Uid FROM users WHERE User='/L'MYSQLGetGID SELECT Gid FROM users WHERE User='/L'MYSQLGetDir SELECT Dir FROM users WHERE User='/L'MySQLGetQTAFS SELECT QuotaFiles FROM users WHERE User='/L'MySQLGetQTASZ SELECT QuotaSize FROM users WHERE User='/L'MySQLGetRatioUL SELECT ULRatio FROM users WHERE User='/L'MySQLGetRatioDL SELECT DLRatio FROM users WHERE User='/L'MySQLGetBandwidthUL SELECT ULBandwidth FROM users WHERE User='/L'MySQLGetBandwidthDL SELECT DLBandwidth FROM users WHERE User='/L'

6. 重启pureftp,测试刚刚建立的bev是否生效了。

好了,下篇博客,将简单总结下pureftp搭建过程中遇见的问题,及其解决办法。

文档

FTP服务器之pure-ftpd配置Mysql虚拟ftp账号_MySQL

FTP服务器之pure-ftpd配置Mysql虚拟ftp账号_MySQL:1. Mysql的连接 [root@localhost ~]# mysql -uroot -pxxxxxx(your mysql password) 2. 建立mysql认证数据库 mysql>create database pureftpd;mysql>grant privileges all on pureftpd.* to puref
推荐度:
标签: 用户 配置 mysql
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top