Fedora 10 によるサーバー構築(9):MySQLのインストールと設定
Fedora 10 によるサーバー構築・メニュー
-
- Fedora 10 によるサーバー構築(1):Fedora Core 10 (64bit) のインストール
- Fedora 10 によるサーバー構築(2):ネットワーク、ディスプレイの設定
- Fedora 10 によるサーバー構築(3):ユーザー登録とSamba、SSH、FTPサーバーの設定
- Fedora 10 によるサーバー構築(4):Apacheのインストールと設定
- Fedora 10 によるサーバー構築(5):Javaのインストールと設定
- Fedora 10 によるサーバー構築(6):Tomcatのインストールと設定
- Fedora 10 によるサーバー構築(7):mod_jkコネクタによるApacheとTomcatの連携の設定
- Fedora 10 によるサーバー構築(8):Tomcat Managerの設定
- Fedora 10 によるサーバー構築(9):MySQLのインストールと設定
- Fedora 10 によるサーバー構築(10):Webminのインストールと設定
Fedora Core 10 (64bit) でサーバーを構築する。
MySQLのインストールと設定
- 公式マニュアル
- 参考URL
MySQLのインストール
- インストール
# yum install mysql-server
以下がインストールされる。
mysql.x86_64 0:5.0.77-1.fc10 mysql-libs.x86_64 0:5.0.77-1.fc10 perl-DBD-MySQL.x86_64 0:4.005-8.fc9 perl-DBI.x86_64 0:1.607-1.fc10
MySQLの設定
- /etc/my.confの設定 必要なら、"ft_min_word_len=2"の設定は、全文検索のワードサイズをデフォルトの1文字から2文字に変更する。
- MySQLの起動・終了・再起動
- MySQL自動起動設定
- MySQL自動起動設定の確認。ランレベル2〜5がonならOK。
- MySQLの初期設定
- ユーザーの作成
# vi /etc/my.conf
以下、編集内容。
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Default to using old password format for compatibility with mysql 3.x # clients (those using the mysqlclient10 compatibility package). old_passwords=1 default-character-set=utf8 ← 追加 最後に追加 [mysql] default-character-set=utf8 ft_min_word_len=2
# /etc/rc.d/init.d/mysqld start # /etc/rc.d/init.d/mysqld stop # /etc/rc.d/init.d/mysqld restart
# chkconfig mysqld on
# chkconfig --list mysqld mysqld 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# mysql_secure_installation Enter current password for root (enter for none): ←[Enter] : Set root password? [Y/n] ←[Y] New password: ← rootパスワード入力 Re-enter new password: ← rootパスワード入力 Password updated successfully! Reloading privilege tables.. ... Success! : Remove anonymous users? [Y/n] ←[Y](匿名ユーザー削除) ... Success! : Disallow root login remotely? [Y/n] ←[Y](リモートからのrootログイン禁止) ... Success! : Remove test database and access to it? [Y/n] ←[Y](testデータベース削除) - Dropping test database... ... Success! - Removing privileges on test database... ... Success! : Reload privilege tables now? [Y/n] ←[Y] ... Success! : Thanks for using MySQL!
MySQLへrootでログインしてユーザーを作成する。
# mysql -u root -p mysql> grant select,insert,delete,update,create,drop,file,alter,index on *.* to [user] identified by '[password]'; mysql> flush privileges; mysql> exit