ユーザ用ツール

サイト用ツール


mysql:install_from_repository

文書の過去の版を表示しています。


Install from Repository

主要repoの一発インストール

CentOS 5.x(rpmforgeは一発無理)

rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm
rpm -ivh rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm 
 

CentOS 6.x

rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
 
2014/02/17 15:00

インストール

# yum --enablerepo=remi install mysql-server mysql-client mysql-devel

文字コードの設定

# vi /etc/my.cnf

以下の行を先頭に追加

[mysqld]
character_set_server=utf8
skip_character_set_client_handshake

起動

# /etc/rc.d/init.d/mysqld start

自動起動設定

# chkconfig mysqld on

mysql_secure_installation

Set root password? [Y/n]

UPDATE mysql.user SET Password=PASSWORD('$esc_pass') WHERE User='root';

Remove anonymous users? [Y/n]

DELETE FROM mysql.user WHERE User='';

Disallow root login remotely? [Y/n]

DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');

Remove test database and access to it? [Y/n]

DROP DATABASE test;
DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'

Reload privilege tables now? [Y/n]

FLUSH PRIVILEGES;
2014/02/17 15:00

ユーザ、DBを作成

使用するアプリケーション・環境に応じてユーザ、DBを追加する。

# mysql -u root -p

e.g.1)

mysql> GRANT ALL ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'redmine';
mysql> CREATE DATABASE redmine;

e.g.2)

mysql> GRANT USAGE ON *.* TO 'openpne'@'localhost' IDENTIFIED BY 'pwd';
mysql> GRANT ALL ON openpne3.* TO 'openpne'@'localhost';
mysql> exit
mysql/install_from_repository.1415093101.txt.gz · 最終更新: 2025/02/16 13:50 (外部編集)