Linux(FedoraCore6)でMySQLを使うメモ
インストール †
- パスワードの設定
(参考)MySQLの初期設定
- MySQL monitorに接続
# mysql -u root
DB管理ツール †
phpMyAdmin?でMySQLの操作、管理を行う。
(参考)
phpMyAdmin? †
- 設定
- ローカル(FedoraCore6をインストールしたPC自身)以外からのアクセスははじかれてしまう。
○ http://localhost/phpMyAdmin
× http://xxx.xxx.xxx.xxx/phpMyAdmin
Forbidden
You don't have permission to access /phpMyAdmin on this server.
Apache/2.2.3 (Fedora) Server at 10.10.50.222 Port 80
- httpd.confにphpMyAdmin?へのエイリアス設定を追加する。
(参考)
Apache の設定
FedoraCore6ビギナーズバイブル p.711 「ディレクトリやファイルを限定する」
/etc/httpd/conf/httpd.conf
<Directory “/usr/share/phpMyAdmin”>
DirectoryIndex index.php
Allow from 192.168.0
</Directory>
トラブル †
- 起動エラー
MySQLを起動させるとエラーが出て起動しない。
[root@localhost ~]# /etc/rc.d/init.d/mysqld start
MySQL データベースを初期化中: Neither host 'localhost.localdomain' nor 'localhost' could be looked up with
/usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with the --force option
[失敗]
Please configure the 'hostname' command to return a correct hostname. に一致する日本語のページ 約 13,900 件
…みんなも引っかかってるんだな。
(参考)MySQLメモ
Q. service mysqld start しようとしたら、次のエラーが
MySQL データベースを初期化中: Neither host 'localhost.localdomain' nor 'localhost' could be looked up with /usr/bin/resolveip
Please configure the 'hostname' command to return a correct hostname.
If you want to solve this at a later stage, restart this script with the --force option
A. 名前解決が出来ていない模様
/etc/hosts に以下の行が抜けている?
127.0.0.1 localhost.localdomain localhost
※ 自分とこの環境でこうなってたせい・・
::1 localhost.localdomain locallhost
無事解決!MySQLが起動した!メデタシ、メデタシ。
プラグイン †
(参考)CentOS5 にMySQL+Mecab+SennaをRPMでインストールしたときのメモ