mysql:install_from_repository
差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
mysql:install_from_repository [2013/02/22 08:25] – 外部編集 127.0.0.1 | mysql:install_from_repository [2025/02/16 13:53] (現在) – 外部編集 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== MySQL Install from Repository | + | ====== |
- | * リポジトリ追加 | ||
- | PHPなど、使用する言語・環境に合わせたリポジトリからインストールする。 | ||
- | * epel リポジトリ | ||
< | < | ||
- | # rpm -ivh http://download.fedora.redhat.com/ | + | # cat /etc/ |
+ | CentOS release 6.7 (Final) | ||
+ | # uname -a | ||
+ | Linux my01 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux | ||
</ | </ | ||
- | * remi リポジトリ | + | |
+ | ===== リポジトリとインストール可能Ver ===== | ||
+ | |||
+ | ==== 標準リポジトリのみ ==== | ||
+ | |||
+ | updatesリポジトリからVer5.1がインストール可能 | ||
< | < | ||
- | # rpm -ivh http://rpms.famillecollet.com/ | + | # yum install mysql-server mysql-client mysql-devel |
+ | ~省略~ | ||
+ | ========================================================================================== | ||
+ | | ||
+ | バージョン | ||
+ | ========================================================================================== | ||
+ | インストールしています: | ||
+ | | ||
+ | mysql-server | ||
+ | ~省略~ | ||
</ | </ | ||
- | * インストール | + | ==== remiリポジトリ ==== |
+ | |||
+ | PHPとの親和を考えてremiリポジトリからインストール、と思うとVer5.5がインストール可能 | ||
< | < | ||
- | # yum -y --enablerepo=remi install mysql-server | + | # rpm -Uvh http:// |
- | # yum -y --enablerepo=remi install mysql-devel.x86_64 | + | # rpm -Uvh http:// |
+ | # rpm -Uvh http:// | ||
+ | |||
+ | # yum --enablerepo=remi, | ||
+ | ~省略~ | ||
+ | ========================================================================================== | ||
+ | | ||
+ | バージョン | ||
+ | ========================================================================================== | ||
+ | インストールしています: | ||
+ | | ||
+ | | ||
+ | | ||
+ | ~省略~ | ||
</ | </ | ||
- | * 文字コードの設定 | + | ==== 公式リポジトリ ==== |
+ | |||
+ | 公式リポジトリからは、標準でVer5.7が、任意でVer5.6がインストール可能 | ||
+ | |||
+ | < | ||
+ | # yum install http:// | ||
+ | |||
+ | # less / | ||
+ | |||
+ | [mysql-connectors-community] | ||
+ | name=MySQL Connectors Community | ||
+ | baseurl=http:// | ||
+ | enabled=1 | ||
+ | gpgcheck=1 | ||
+ | gpgkey=file:/// | ||
+ | |||
+ | [mysql-tools-community] | ||
+ | name=MySQL Tools Community | ||
+ | baseurl=http:// | ||
+ | enabled=1 | ||
+ | gpgcheck=1 | ||
+ | gpgkey=file:/// | ||
+ | |||
+ | # Enable to use MySQL 5.5 | ||
+ | [mysql55-community] | ||
+ | name=MySQL 5.5 Community Server | ||
+ | baseurl=http:// | ||
+ | enabled=0 | ||
+ | gpgcheck=1 | ||
+ | gpgkey=file:/// | ||
+ | |||
+ | # Enable to use MySQL 5.6 | ||
+ | [mysql56-community] | ||
+ | name=MySQL 5.6 Community Server | ||
+ | baseurl=http:// | ||
+ | enabled=0 | ||
+ | gpgcheck=1 | ||
+ | gpgkey=file:/// | ||
+ | |||
+ | [mysql57-community] | ||
+ | name=MySQL 5.7 Community Server | ||
+ | baseurl=http:// | ||
+ | enabled=1 | ||
+ | gpgcheck=1 | ||
+ | gpgkey=file:/// | ||
+ | |||
+ | |||
+ | # yum install mysql-community-server mysql-community-devel | ||
+ | ~省略~ | ||
+ | ========================================================================================== | ||
+ | | ||
+ | | ||
+ | ========================================================================================== | ||
+ | インストールしています: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ~省略~ | ||
+ | |||
+ | # yum --enablerepo=mysql56-community --disablerepo=mysql57-community install mysql-community-server mysql-community-devel | ||
+ | ~省略~ | ||
+ | ========================================================================================== | ||
+ | | ||
+ | | ||
+ | ========================================================================================== | ||
+ | インストールしています: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ~省略~ | ||
+ | </ | ||
+ | |||
+ | ===== インストール ===== | ||
+ | < | ||
+ | # yum --enablerepo=remi install mysql-server mysql-client mysql-devel | ||
+ | </ | ||
+ | |||
+ | 文字コードの設定 | ||
< | < | ||
# vi /etc/my.cnf | # vi /etc/my.cnf | ||
行 24: | 行 134: | ||
以下の行を先頭に追加 | 以下の行を先頭に追加 | ||
< | < | ||
- | [mysql] | ||
- | default_character_set=utf8 | ||
- | |||
[mysqld] | [mysqld] | ||
- | default_character_set=utf8 | ||
character_set_server=utf8 | character_set_server=utf8 | ||
skip_character_set_client_handshake | skip_character_set_client_handshake | ||
</ | </ | ||
- | * 起動 | + | 起動 |
< | < | ||
# / | # / | ||
</ | </ | ||
- | * 自動起動設定 | + | 自動起動設定 |
< | < | ||
# chkconfig mysqld on | # chkconfig mysqld on | ||
</ | </ | ||
- | * rootユーザのパスワードを設定 | + | ===== mysql_secure_installation ===== |
- | デフォルトではrootユーザはパスワード無になっているので、必ず設定する。 | + | {{section> |
- | < | + | |
- | # mysql -u root | + | |
- | mysql> UPDATE mysql.user SET Password | + | |
- | mysql> FLUSH PRIVILEGES; | + | |
- | </ | + | |
- | * ユーザ、DBを作成 | + | ===== ユーザ、DBを作成 |
使用するアプリケーション・環境に応じてユーザ、DBを追加する。 | 使用するアプリケーション・環境に応じてユーザ、DBを追加する。 | ||
+ | < | ||
+ | # mysql -u root -p | ||
+ | </ | ||
e.g.1) | e.g.1) | ||
< | < | ||
行 63: | 行 167: | ||
mysql> GRANT ALL ON openpne3.* TO ' | mysql> GRANT ALL ON openpne3.* TO ' | ||
</ | </ | ||
- | |||
- | * mysqlから抜ける | ||
< | < | ||
mysql> exit | mysql> exit | ||
</ | </ | ||
mysql/install_from_repository.1361521532.txt.gz · 最終更新: 2025/02/16 13:50 (外部編集)