AWS EC2 を使ってWordPressの実行環境を構築してみた(2)
(MySQL install)
$ sudo yum -y install mysql55 mysql55-server mysql55-devel
・自動起動設定
$ sudo chkconfig mysqld on
・バックアップ取得
$ sudo cp -a /etc/my.cnf{,.bk}
・my.cnfの編集
$ sudo vi /etc/my.cnf
--------------------------------
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server=utf8 ←この行を追加
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql] ←この行を追加
default-character-set=utf8 ←この行を追加
--------------------------------
$ sudo service mysqld start
$ sudo mysql_secure_installation
$ sudo mysql -u root -p
mysql> create database db_name;
mysql> grant all privileges on db_name.* to db_user@localhost identified by 'db_pw';
mysql> quit;
-- Build a WordPress execution environment using the EC2 --
(MySQL install)
$ sudo yum -y install mysql55 mysql55-server mysql55-devel
・Automatic start setting
$ sudo chkconfig mysqld on
・create buckup
$ sudo cp -a /etc/my.cnf{,.bk}
・my.cnf edit
$ sudo vi /etc/my.cnf
--------------------------------
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server=utf8 ← add line
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql] ← add line
default-character-set=utf8 ← add line
--------------------------------
$ sudo service mysqld start
$ sudo mysql_secure_installation
$ sudo mysql -u root -p
mysql> create database db_name;
mysql> grant all privileges on db_name.* to db_user@localhost identified by 'db_pw';
mysql> quit;
0 件のコメント:
コメントを投稿