下記の4つの記事を書いてきましたが、今回はまとめです。
AWS SDK for PHPでS3にファイルアップロード
RDSのcharacter_set_*をutf8に変更
RDSにskip-character-set-client-handshakeを設定
RDSでタイムゾーン(UTC)を変更
設定スクリプトは、下記になります。
——–【PHP】——–
require_once("./sdk.class.php"); $rds = new AmazonRDS(); $rds->set_region(AmazonRDS::REGION_APAC_NE1); $response = $rds->modify_db_parameter_group('suz-lab', array( array( "ParameterName" => "skip-character-set-client-handshake", "ParameterValue" => "true", "ApplyMethod" => "pending-reboot" ), array( "ParameterName" => "init_connect", "ParameterValue" => "SET time_zone = 'Asia/Tokyo';", "ApplyMethod" => "immediate" ), array( "ParameterName" => "character_set_client", "ParameterValue" => "utf8", "ApplyMethod" => "immediate" ), array( "ParameterName" => "character_set_connection", "ParameterValue" => "utf8", "ApplyMethod" => "immediate" ), array( "ParameterName" => "character_set_database", "ParameterValue" => "utf8", "ApplyMethod" => "immediate" ), array( "ParameterName" => "character_set_filesystem", "ParameterValue" => "utf8", "ApplyMethod" => "immediate" ), array( "ParameterName" => "character_set_results", "ParameterValue" => "utf8", "ApplyMethod" => "immediate" ), array( "ParameterName" => "character_set_server", "ParameterValue" => "utf8", "ApplyMethod" => "immediate" ) )); var_dump($response);
RDS立ち上げた際には、上記を行うのがいいと思います。