mysql:12734
From: "yama tan" <"yama tan" <kouji-ya@xxxxxxxxxx>>
Date: Tue, 07 Feb 2006 14:11:57 +0900
Subject: [mysql 12734] Re: mod_auth_mysqlについて教えて下さい。
koujiです。
皆さん色々とご迷惑お掛け致します。
少しまとめさせて下さい。
皆様から下記問題点のご指摘を受けました。
1.MySQLに認証させるパスワードは暗号化 =>AuthMySQLPwEncryption noneを追加
2.htaccessの記述ミス => AuthMySQLUser <no default -- NULL>
AuthMySQLPassword <no default -- NULL>
と、CONFIGUREファイルに記載がありまし
た。
もし記述する場合はgrant selectで指定した
「yama」ですよね。
3.flush-privileges =>実行済み
2.3については問題ないと自分では思っているのですが
いかがでしょうか?
※ 1.の暗号化については必ず必要となりますでしょう?
===================================================
# /usr/local/apache2/bin/apxs -c -L/usr/local/mysql/lib \
-I/usr/local/mysql/include -lmysqlclient -lm -lz mod_auth_mysql.c
# pwd
/usr/local/mysql/lib
# ls
libdbug.a libmysql.imp libmysqlclient_r.a libmystrings.a
libmygcc.a libmysqlclient.a libmysqld.a libmysys.a
# /usr/local/apache2/bin/apxs -i mod_auth_mysql.la
# cat /usr/local/apach2/conf/httpd.conf | grep mysql
LoadModule mysql_auth_module modules/mod_auth_mysql.so
# mysql -u root
mysql> create database http_auth;
Query OK, 1 row affected (0.05 sec)
mysql> grant select on http_auth.* to yama@localhost identified by 'yama';
Query OK, 0 rows affected (0.05 sec)
mysql> use http_auth;
Database changed
mysql> create table mysql_auth (
-> user_name char(30) NOT NULL,
-> user_passwd char(20),
-> user_group char(10),
-> primary key (user_name)
-> );
mysql> \q
# vi /var/www/html/.htaccess
AuthName "MySQL Testing"
AuthType Basic
AuthMySQLHost localhost
AuthMySQLDB http_auth
AuthMySQLUserTable mysql_auth
AuthMySQLEnable On
require valid-user
AuthMySQLPwEncryption none
# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use http_auth;
Database changed
mysql> insert into mysql_auth (username,passwd) values ("test","test");
Query OK, 1 row affected (0.02 sec)
mysql> select * from mysql_auth;
+----------+--------+
| username | passwd |
+----------+--------+
| test | test |
+----------+--------+
1 row in set (0.02 sec)
mysql> \q
Bye
==============================================================
>From: y-iida@xxxxxxxxxx
>Reply-To: ml@xxxxxxxxxx
>To: ml@xxxxxxxxxx
>Subject: [mysql 12733] Re: mod_auth_mysqlについて教えて下さい。
>Date: 7 Feb 2006 13:38:36 +0900
>
>mysqladminでflush-privileges (詳しくは、マニュアルを) してないとか?
>
>
> >mysql> select * from mysql_auth;
> >+-----------+---------------+
> >| user_name | user_passwd |
> >+-----------+---------------+
> >| test | zzXUHfURnGg8I |
>...
> >としたのですが状況変わらずです...
>--
> iida
>
_________________________________________________________________
パソコンでも携帯電話でも使える 「MSN Hotmail」
http://promotion.msn.co.jp/hotmail/
12728 2006-02-07 11:41 ["yama tan" <kouji-ya] mod_auth_mysqlについて教えて下さい。 12729 2006-02-07 11:55 ┣[島村 優太郎 <ml@xxxx] 12730 2006-02-07 12:50 ┃┗["yama tan" <kouji-ya] 12733 2006-02-07 13:38 ┃ ┗[<y-iida@xxxxxxxxxx> ] -> 12734 2006-02-07 14:11 ┃ ┗["yama tan" <kouji-ya] 12732 2006-02-07 13:32 ┗[bon <bon@xxxxxxxxxx>]