MYSQLのインストール

オフィシャルのサイトにしたがって、インストールしました。

インストール

# sudo yum -y update
# sudo yum -y install mysql-server
# sudo /etc/init.d/mysqld start

初期設定

# sudo /usr/bin/mysql_secure_installation

このコマンドを実行すると、対話式に色々と聞かれます。

  • Current Root Passwordを入力してください。
    • A.何も入力せず、Enterを押してください。(デフォルトでrootのパスワードはないから)
  • If the above step worked correctly you should be prompted with a question asking you if you would like to set your root password. Please press Y and press Enter.
    • A.Yを押してmysql用のrootのパスワードを設定してください。
  • You will be prompted to remove the MySQL anonymous users. For security reasons we want to do this.
    • A.セキュリティ的によくないので、Yを入力してEnterを押してください
  • Delete test Databaseを消しますか
    • A.セキュリティ的によくないので、Yを入力してEnterを押してください

サービス登録

#ntsysv

mysqlを選択する

再起動したときに、自動で立ち上がるようにしときましょう。

参考サイト

・オフィシャルwiki(mysqlインストール編)
http://cloudservers.rackspacecloud.com/index.php/CentOS_-_MySQL_Installation