PhpMyAdminのインストール2006/09/13

1.mysqlの初期設定

(1)ルートパスワードの設定

[root@eds html]# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 4.0.25-Max

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

mysql> set password for root=password('xxxxxxxxl');
Query OK, 0 rows affected (0.10 sec)

mysql> quit
Bye

(2)パスワード設定のないユーザを削除

[root@eds html]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6 to server version: 4.0.25-Max

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

mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> delete from user where password="";
Query OK, 3 rows affected (0.02 sec)

2.PhpMyAdminのインストール

(1)ダウンロードしたファイルを展開し,ディレクトリ名を変更

[root@eds html]# tar -xzvf phpMyAdmin-2.8.2.tar.gz
[root@eds html]# mv phpMyAdmin-2.8.2 phpmyadmin

(2).htpasswdoの設定(ユーザ名:sqladmin)

[root@eds html]# htpasswd -c /home/httpd/.htpasswd sqladmin
New password:
Re-type new password:
Adding password for user sqladmin

(3)httpd.confの編集(None -> All)

# This controls which options the .htaccess files in directories can
# override. Can also be "All", or any combination of "Options", "FileInfo",
# "AuthConfig", and "Limit"
#
AllowOverride All

(4).htaccessの設定

[root@eds phpmyadmin]# cat /home/httpd/html/phpmyadmin/.htaccess
AuthUserFile /etc/httpd/conf/.htpasswd
AuthGroupFile /dev/null
AuthName "Please enter username and passwd"
AuthType Basic
Require valid-user

(5)httpdの再起動
[root@eds conf]# /etc/rc.d/init.d/httpd restart
httpdを停止中: [ OK ]
httpdを起動中: [ OK ]

(6)/home/httpd/html/mysqladmin/libraries/config.default.phpの設定

[root@eds libraries]# diff config.default.php config.default.php.org |grep '^<'
< $cfg['PmaAbsoluteUri'] = 'http://cess.info.yuge.ac.jp/phpmyadmin';
< $cfg['Servers'][$i]['host'] = 'cess'; // MySQL hostname or IP address
< $cfg['Servers'][$i]['password'] = 'xxxxxxxx'; // MySQL password (only needed
< $cfg['Export']['charset'] = 'ja-euc';

ブラウザから起動すると次のエラーが表示
#1130 - Host 'cess.info.yuge.ac.jp' is not allowed to connect to this
MySQL server

ルートユーザでmysqlへログインし,自由にサーバへつなぐことができて何で
もできるユーザを作成

mysql> GRANT ALL PRIVILEGES ON *.* TO sadmin@localhost IDENTIFIED BY 'yuge-sql' WITH GRANT OPTION;
Query OK, 0 rows affected (0.33 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO sadmin@"%" IDENTIFIED BY 'yuge-sql' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.17 sec)

(7)再度/home/httpd/html/mysqladmin/libraries/config.default.phpの設定

[root@eds libraries]# diff config.default.php config.default.php.org |grep '^<'
< $cfg['PmaAbsoluteUri'] = 'http://cess.info.yuge.ac.jp/phpmyadmin';
< $cfg['Servers'][$i]['host'] = 'cess'; // MySQL hostname or IP address
< $cfg['Servers'][$i]['user'] = 'sadmin'; // MySQL user
< $cfg['Servers'][$i]['password'] = 'xxxxxxx'; // MySQL password (only needed
< $cfg['Export']['charset'] = 'ja-euc';

命名の儀2006/09/13

41年ぶりの男子皇族として誕生された秋篠宮ご夫妻のお子さまの「命名の儀」が行われ,お名前は「悠仁(ひさひと)」また,調度品や身の回りの持ち物を他の皇族方と区別するために使う「お印(しるし)」は「高野槇(こうやまき)」に決まった.「悠」の字は,ゆったりとした気持ちで,長く久しく人生を歩んでほしい,お印の高野槇は、高野山に多い日本固有の直立の常緑樹で,大きく真っすぐ育ってほしいとの願いがあるという.ちなみに本校で名前に「悠」を使っている学生は7名で,全員男子学生である.

データベース(4年生授業)での初期設定とパスワード登録2006/09/13

(1)ユーザ登録

i03001のユーザにデータベースI4_DB以下の全ての権限を与える.

mysql> GRANT ALL PRIVILEGES ON I4_DB.* TO i03001@"%" WITH GRANT OPTION;

H18年度は,i03001-i03042,i02010,i02024,i06101を登録

(2)リモートログイン方法

[tabusa@tbspc tabusa]$ mysql -h 160.245.48.21 -u i03001

(3)パスワード設定

mysql> set password for i03001=password('password');
Query OK, 0 rows affected (0.03 sec)

次回のログインからは,-pオプションをつけてログイン

[tabusa@tbspc tabusa]$ mysql -h 160.245.48.21 -u i03001 -p
Enter password:

設定したデータベース(I4_DB)しか,表示されないことを確認.
mysql> show databases;
+----------+
| Database
+----------+
| I4_DB
| test  
+----------+
2 rows in set (0.00 sec)