職場で社内情報共有ツールとして使えるものを選出
してくれ。との要望が。。。
それも、出来ればお金をかけない方向性でとの事。
思いつくものは、MovableType、XOOPS、WordPress。
とりあえず、要望として第一に挙がったのが
MovableTypeだったので、インストールを試みた。
MovableTypeを使うには事前準備として、以下が必要だ。
■Webサーバー(Apacheなど)が利用可能な事
■MySQLなどのデータベースが利用可能な事
■プログラム実行環境(PerlやPHPなど)が必要(#whereis perlで確認しておく)
「インストール環境」
■OS:CentOS4
■DB:MySQL
■MT:MovableType4.13
今回は、CentOSをインストールする事から始めた。
CDからのインストールだったので楽々インストール完了。
(ただ、MySQLのチェックボックスをONにしてインストール
したが、MySQLが起動しない。
しかも、何故かMYSQLSERVERがインストールされていない。)
再度、CDからソフトウエアのインストールを試す。
詳細インストールを覗くと、MYSQLSERVERがデフォルトでは
チェックが入っていないのでインストールされない。という
情けないお粗末な結果が判明。
MYSQLSERVERにチェックを入れ、無事インストールが完了。
# /etc/init.d/mysqld start #MySQLの起動コマンド
# /etc/init.d/mysqld stop #MySQLの停止コマンド
無事、MySQLの起動コマンドで起動した〜。
次は、データベースの作成と自動実行の登録。
サーバ再起動する度に起動コマンド実行するのは大変
ですからねー。
その後のMySQLの設定は、ここを参考にした。
# mysql -u root
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
インストール直後のデータベース表示
mysql> show databases;
+-----------+
| Databases |
+-----------+
| mysql |
| test |
+-----------+
データベースが「mysql」と「test」の2つが存在している。
「mysql」データベースのテーブル名表示
mysql> show tables from mysql;
+-----------------+
| Tables_in_mysql |
+-----------------+
| columns_priv |
| db |
| func |
| host |
| tables_priv |
| user |
+-----------------+
6 rows in set (0.00 sec)
MySQLアカウントのrootが自動的に作成されているがパスワードが
設定されていないので設定する。
rootにパスワードを設定する(パスワードを"se-heigi"とする場合)
mysql> SET PASSWORD FOR root@localhost=PASSWORD('se-heigi');
Query OK, 0 rows affected (0.00 sec)
MySQL monitorの終了
mysql> exit
Bye
MySQL monitorにrootで接続する
(この時、"-p"オプションを指定しパスワード入力をする)
# mysql -u root -p
上記で設定したパスワード"se-heigi"を入力
Enter password:se-heigi(通常は表示されません)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5 to server version: 3.23.58
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
「use」コマンドで「mysql」データベースに切り替える。
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に接続できるユーザの表示
mysql> select host,user,password from user;
+------------------------+------+------------------+
| host | user | password |
+------------------------+------+------------------+
| localhost | root | 451b483e5c7325d5 |
| se-memo.nifty.com | root | |
| se-memo.nifty.com | | |
| localhost | | |
+------------------------+------+------------------+
4 rows in set (0.00 sec)
パスワード無しのユーザ(匿名ユーザ)の削除(セキュリティの為)
mysql> delete from user where user="";
Query OK, 2 rows affected (0.00 sec)
MySQLに接続できるユーザの表示
mysql> select host,user,password from user;
+------------------------+------+------------------+
| host | user | password |
+------------------------+------+------------------+
| localhost | root | 451b483e5c7325d5 |
| se-memo.nifty.com | root | |
+------------------------+------+------------------+
2 rows in set (0.00 sec)
パスワード無しのユーザが削除されたホスト「se-memo.nifty.com 」
にもパスワードを設定する
mysql> SET PASSWORD FOR root@se-memo.nifty.com=PASSWORD('se-heigi');
Query OK, 0 rows affected (0.00 sec)
MySQLに接続できるユーザの表示
mysql> select host,user,password from user;
+------------------------+------+------------------+
| host | user | password |
+------------------------+------+------------------+
| localhost | root | 451b483e5c7325d5 |
| se-memo.nifty.com | root | 451b483e5c7325d5 |
+------------------------+------+------------------+
2 rows in set (0.00 sec)
MySQL monitorの終了
mysql> exit
Bye
基礎からのMySQL [基礎からのシリーズ] (プログラマの種シリーズ)