MySQLの導入MySQLサーバのインストールここまでの段階で、基本パッケージはインストールされている。 mysql.i386 5.0.22-2.2.el5_1.1 installed MySQLサーバをインストールする。 # yum install mysql-server MySQLの設定設定ファイルを編集する。 # vi /etc/my.cnf Vineのときの設定を参考に、 次のような設定を追加する。 [mysql] default-character-set = utf8 [mysqld] default-character-set = utf8 skip-character-set-client-handshake old-passwords=1 MySQLサーバの起動MySQLがOSの起動時に動くようにする。 # chkconfig mysqld on # service mysqld start MySQLデータベースの初期設定まず、データベース管理者のパスワードを作る # mysql -u root mysql> set password for root@localhost=password('パスワード'); mysql> set password for root@'ホスト名'=password('パスワード'); 次に、匿名ユーザを削除する。 mysql> delete from mysql.user where user=''; 設定を確認する。 mysql> select user,host,password from mysql.user; ... mysql> flush privileges; ←設定を反映する。 mysql> exit 参考 |