Goodspeed

导航

< 2025年1月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8

统计

使用mod_auth_mysql.so

CREATE TABLE users (
id int(14) NOT NULL auto_increment,
user_name CHAR(30) NOT NULL,
user_passwd CHAR(20) NOT NULL,
created timestamp(14) NOT NULL,
updated timestamp(14) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY user_name (user_name)
);
CREATE TABLE groups (
id int(14) NOT NULL auto_increment,
user_name CHAR(30) NOT NULL,
user_group CHAR(20) NOT NULL,
created timestamp(14) NOT NULL,
updated timestamp(14) NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY user_name (user_name,user_group)
);

INSERT INTO users(user_name,user_passwd) VALUES ('wangsong', ENCRYPT('123456'));
select * from users;
INSERT INTO groups(user_name,user_group) VALUES ('wangsong', 'test');
select * from groups;

AuthName "MySQL group authenticated zone"
AuthType Basic

AuthMYSQLEnable on
AuthMySQLUser root
AuthMySQLPassword 123456
AuthMySQLDB git
AuthMySQLUserTable users
AuthMySQLNameField user_name
AuthMySQLPasswordField user_passwd
AuthMySQLGroupTable groups
AuthMySQLGroupField user_group

posted on   Goodspeed  阅读(1433)  评论(1编辑  收藏  举报

点击右上角即可分享
微信分享提示