웹마스터 팁
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
[추천 소스] phpMyAdmin 다중사용자용...
2001.11.29 07:49
http://mysql.netardor.net/phpMyAdmin.tar.gz이런것도 팁이 될런지 모르겠고... 또한 제가 무식하게 사용하는건지도
모르겠습니다만...
여러명이 사용하는 서버에서 각각의 사용자가 phpMyAdmin 을 사용하려고
하는 상황이다보니 다들 자기 계정에 phpMyAdmin 을 올려놓고 config.inc.php 에 자신의 DB 정보를 넣고 사용하더군요.
좀 낭비다 싶어 config.inc.php 파일을 다음과 같이 수정했습니다.
if(!isset($PHP_AUTH_USER)) {
auth();
}
else {
$id=$PHP_AUTH_USER;
$pass=$PHP_AUTH_PW;
}
$user_db = $id;
if ( $id == 'root' ) $user_db = '';
$cfgServers[1]['host'] = 'localhost'; // MySQL hostname
$cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port
$cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfgServers[1]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfgServers[1]['adv_auth'] = false; // Use advanced authentication?
$cfgServers[1]['stduser'] = $id; // MySQL standard user (only needed with advanced auth)
$cfgServers[1]['stdpass'] = $pass; // MySQL standard password (only needed with advanced auth)
$cfgServers[1]['user'] = $id; // MySQL user (only needed with basic auth)
$cfgServers[1]['password'] = $pass; // MySQL password (only needed with basic auth)
$cfgServers[1]['only_db'] = $user_db; // If set to a db-name, only this db is accessible
// It may also be an array of db-names
이렇게 하니 자신의 apache auth 에서 자신의 DB 아이디와 비밀번호를
넣으니 자신의 DB 만 나오더군요.
root 로 로그인 했을때는 모두 다 나오게 예외처리를 하긴 했습니다만..
phpMyAdmin 2.2.0 으로 했구요.
http://mysql.netardor.net/phpMyAdmin.tar.gz
여기서 다운로드 받으실 수 있습니다...
모르겠습니다만...
여러명이 사용하는 서버에서 각각의 사용자가 phpMyAdmin 을 사용하려고
하는 상황이다보니 다들 자기 계정에 phpMyAdmin 을 올려놓고 config.inc.php 에 자신의 DB 정보를 넣고 사용하더군요.
좀 낭비다 싶어 config.inc.php 파일을 다음과 같이 수정했습니다.
if(!isset($PHP_AUTH_USER)) {
auth();
}
else {
$id=$PHP_AUTH_USER;
$pass=$PHP_AUTH_PW;
}
$user_db = $id;
if ( $id == 'root' ) $user_db = '';
$cfgServers[1]['host'] = 'localhost'; // MySQL hostname
$cfgServers[1]['port'] = ''; // MySQL port - leave blank for default port
$cfgServers[1]['socket'] = ''; // Path to the socket - leave blank for default socket
$cfgServers[1]['connect_type'] = 'tcp'; // How to connect to MySQL server ('tcp' or 'socket')
$cfgServers[1]['adv_auth'] = false; // Use advanced authentication?
$cfgServers[1]['stduser'] = $id; // MySQL standard user (only needed with advanced auth)
$cfgServers[1]['stdpass'] = $pass; // MySQL standard password (only needed with advanced auth)
$cfgServers[1]['user'] = $id; // MySQL user (only needed with basic auth)
$cfgServers[1]['password'] = $pass; // MySQL password (only needed with basic auth)
$cfgServers[1]['only_db'] = $user_db; // If set to a db-name, only this db is accessible
// It may also be an array of db-names
이렇게 하니 자신의 apache auth 에서 자신의 DB 아이디와 비밀번호를
넣으니 자신의 DB 만 나오더군요.
root 로 로그인 했을때는 모두 다 나오게 예외처리를 하긴 했습니다만..
phpMyAdmin 2.2.0 으로 했구요.
http://mysql.netardor.net/phpMyAdmin.tar.gz
여기서 다운로드 받으실 수 있습니다...