コンテンツ
ConoHa VPSへMySQLの最新バージョンをインストール、設定する方法
こちらの記事では、
ConoHa VPSサーバーへMySQLの最新バージョンをインストールする方法をまとめています。
※現時点での最新バージョンは、MySQL5.7です。
MySQLをインストール
■yumリポジトリを追加
# rpm -ivh http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
■MySQLをインストール
# yum -y install mysql-community-devel
# yum -y install mysql-community-server
■MySQLを起動
# systemctl start mysqld
■自動起動を設定
# systemctl enable mysqld
■初期パスワードを確認
# grep password /var/log/mysqld.log
=========================================================================
[Note] A temporary password is generated for root@localhost: <パスワード>
=========================================================================
で初期パスワードを確認できます。
セキュリティ設定
最後に、セキュリティの設定を行っておきます。
# mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:<現在のパスワード>
The existing password for the user account root has expired. Please set a new password.
New password:<新しく設定するパスワード>
Re-enter new password:<新しく設定するパスワード>
Estimated strength of the password: 100
Change the password for root ? ((Press y|Y for Yes, any other key for No) :<空でEnter>
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
All done!
※新パスワードの設定以降は、すべてy(Yes)で問題ないです。
ここまで来れば、
MySQL5.7のインストール、設定まで完了です。
この記事へのコメントはありません。