内容へ移動
メモとかメモのようなものとか(By ルーキーの中のひと)
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
ODT 出力
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
トレース:
os:centos:mysql
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== MySQL ====== ===== Install ===== 標準は <code> # yum info mysql.x86_64 Available Packages Name : mysql Arch : x86_64 Version : 5.1.69 Release : 1.el6_4 Size : 907 k Repo : updates Summary : MySQL client programs and shared libraries URL : http://www.mysql.com License : GPLv2 with exceptions Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a : client/server implementation consisting of a server daemon (mysqld) : and many different client programs and libraries. The base package : contains the standard MySQL client programs and generic MySQL files. </code> と言うわけで古すぎるので、新しめの5.5を入れる\\ remiに新しいのが置かれるようになったので <code> # yum install --enablerepo=remi mysql </code> <code> # yum install http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/MySQL-client-5.5.31-2.el6.x86_64.rpm \ http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/MySQL-shared-compat-5.5.31-2.el6.x86_64.rpm \ http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/MySQL-server-5.5.31-2.el6.x86_64.rpm \ http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/MySQL-devel-5.5.31-2.el6.x86_64.rpm </code> shared-compatを入れた後ならsharedも入るので入れる <code> # yum install http://ftp.jaist.ac.jp/pub/mysql/Downloads/MySQL-5.5/MySQL-shared-5.5.31-2.el6.x86_64.rpm </code> ===== 起動 ===== # service mysql start ←mysqldからmysqlに変更されてる... 自動起動をONにする # chkconfig mysql on ===== 設定 ===== utf-8をDefaultにする。(/etc/my.cnf) <code> [mysqld] ... #default-character-set = utf8 ←5.5で廃止されてます character_set_server = utf8 [mysql] default-character-set = utf8 [mysqldump] default-character-set = utf8 </code> ===== rootパスワードの設定 ===== 初期ではrootパスワードが設定されていないので、とっとと設定します。((5.6ではデフォルトパスワードが設定されて、/root/.mysql_secret に置かれてるらしい))(( なお、mysql.user.password_expiredの値(5.6の新機能)が'Y'になっているのでパスワードを変更しないとあっちこっちで'You must SET PASSWORD before executing this statement'と怒られます)) <code> # mysql -u root mysql> SET PASSWORD FOR root@localhost = PASSWORD('*********'); </code> ===== my.cnfサンプル ===== /usr/share/mysql にある((5.6で廃止された?)) それぞれ以下の様な内容 ^ファイル名^内容^ |my-small.cnf|64MB以下のメモリを搭載したPC| |my-medium.cnf|128MB以下のメモリを搭載したPC| |my-large.cnf|512MB以下のメモリを搭載したPC| |my-huge.cnf|1GB~2GB以下のメモリを搭載したPC| |my-innodb-heavy-4G.cnf|4GBのメモリとInnoDBで作成されたデータベースによって構築されたPC| ===== 外部からの接続を許可する ===== [[serverapps:db:mysql:connectexternal]] ===== データディレクトリの変更 ===== ふつうは cp -rpf origin-path new-path として、/etc/my.cnfのdatapathなんかを変更すればOKのはず だが、 The server quit without updating PID file /new-path/xxxxxxxxx.pid). などと言って、立ち上がらなかったので mysql_install_db --datadir=/new-path/mysql --user=mysql してから service mysql start
os/centos/mysql.txt
· 最終更新: 2021/05/11 16:07 by
40.77.167.76
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
ODT 出力
文書の先頭へ